BookmarkSubscribeRSS Feed
pasvorto
Calcite | Level 5

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'

;

  RUN;

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

Intervention

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?

4 REPLIES 4
Reeza
Super User

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.

http://www.lexjansen.com/pharmasug/2006/technicaltechniques/tt01.pdf

pasvorto
Calcite | Level 5

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

Reeza
Super User

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

pasvorto
Calcite | Level 5

True enough

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1044 views
  • 0 likes
  • 2 in conversation