Help using Base SAS procedures

Proc print issue

Posts: 22

Proc print issue

I am having a problem getting proc print to do what I want. This is the current code:


options ls=120 nodate orientation=landscape;

ODS html headtext="<STYLE> TD {MSO-NUMBER-FORMAT:\@}</STYLE>"

                   file="&loca.summary4.xls" style=default;

  Title  "Mayo Clinic Cancer Center - Summary 4";

  Title2 "Reporting Period: &start_dt2 - &end_dt2";

  TITLE3 "Report Prepared: &PREP_DT";

  proc print data=fl_p4_fnl NOOBS SPLIT='#';

    by inter sponsor;

    where ccs_open <= &end_dt.;

    var datacntr msite nci_num pi_mayo_irb pgm ccs_open ccs_cls newphase type multi_site s_desc

        ntarget ntarget_yc  scotyr_c jackyr_c rochyr_c  Mhsyr_c mayoyr_c tota_c  totf_c totr_c  totMhs_c totm_c;

    format site1 site.;

    label inter       = ''

          sponsor     = ''

          msite       = 'Site'

          nci_num     = 'Proto#ID'

          pi_mayo_irb = 'PI'

          pgm         = 'Prog#Code'

          ccs_open    = 'Date#Opened'

          ccs_cls     = 'Date#Closed'

          newphase    = 'Phase'

          type        = 'Primary#Purpose'

          datacntr    = 'Data#Center'

          s_desc      = 'Official Title'

          ntarget     = "Total Targeted Accrual#Entire Study"

          ntarget_yc  = "Total Targeted Accrual#Your Center"

          multi_site  = 'Is multi-site#trial?'

          mayoyr_c    = 'Center#12 mos'

          rochyr_c    = 'Rochester#12 mos'

          jackyr_c    = 'Florida#12 mos'

          scotyr_c    = 'Arizona#12 mos'

          totm_c      = 'Center#To Date'

          totr_c      = 'Rochester#To Date'

          totf_c      = 'Florida#To Date'

          tota_c      = 'Arizona#To Date'

          totMhs_c    = 'Mayo Health#To Date'

          Mhsyr_c     = 'Mayo Health#12 mos'

          datacntr    = 'Specific#Funding#Source'



ods html close;


The columns are fine. However, the section title comes out as

'=Intervention '=Externally Peer-Reviewed

I know the variable names are blank as I set them that way in the Labels area. I want it to come out as


Externally Peer-Reviewed

So, I need to be able to split the "By" variables to different lines and omit the standard section heading. Any ideas?

Super User
Posts: 23,733

Re: Proc print issue

I think you're looking to explore the #byval and #byvar options and nobyline options.

You may want to change your escapechar to something other than "#" otherwise you may run into errors.

Posts: 22

Re: Proc print issue

OK, thanks. It is reaching a point where it is not worth the time I am spending on  it.

Super User
Posts: 23,733

Re: Proc print issue

Learn how to do it once and then your done Smiley Happy

Posts: 22

Re: Proc print issue

True enough

Ask a Question
Discussion stats
  • 4 replies
  • 2 in conversation