Old PROC REPORT code? Let's clean it up!

2

Did you inherit code that was written eons ago?  Do you find old programs to copy the PROC REPORT code and then simply change the variable names for your new program?  Have you wondered what all of those options do?  Do you ever send output to the Listing destination (the Output Window) anymore?

If you said yes to any of the questions above -- clean it up!  PROC REPORT has been around forever, but it has changed and evolved over the years to facilitate the creation of nicer looking output, specifically in non-Listing ODS destinations.

There are a number of options that are only valid in the Listing destination. Do you really need them? If you aren’t using that destination, then remove any outdated options from your SAS programs. Here’s a list by statement in the REPORT procedure:

PROC REPORT statement: outdated options

BOX NOWD/NOFS *
COLWIDTH= PANELS=
FORMCHAR= PS=
HEADLINE PSPACE=
HEADSKIP SPACING=
LS= WRAP

Nonwindowing mode became default in 9.4.

DEFINE statement: outdated options

CENTER * RIGHT *
FLOW SPACING=
LEFT * WIDTH= **

* In the Listing destination the LEFT, RIGHT, and CENTER options change the justification of both the headers and the data.  In other ODS destinations these options change only the justification for the data.  Instead of these options, it is highly recommended that you use the JUST= attribute within STYLE(COLUMN)= and STYLE(HEADER)= to change the justification.

** The standalone WIDTH= option is for Listing.  WIDTH= within a style specification, like STYLE(COLUMN)=[WIDTH=1IN], is for other ODS destinations.

BREAK statement: outdated options

DOL SKIP
DUL UL
OL

RBREAK statement: outdated options

DOL SKIP
DUL UL
OL

You can leave these options in, but why?  Make your PROC REPORT code more readable for yourself and anyone else who picks it up.  

 

Share

About Author

Jane Eslinger

SAS Technical Support Analyst

Jane is a Technical Support Analyst at SAS Institute Inc., in Cary, NC. She supports the REPORT procedure, ODS, and other Base SAS procedures. Before she joined SAS, Jane worked as a statistical programmer in the social science and clinical research fields. She is a graduate of NC State University with a Bachelor of Science in Statistics.

2 Comments

  1. Jane Eslinger
    Jane Eslinger on

    Alice,
    I do not recommend removing these options from old programs because the task might be time consuming and unnecessary because the programs have already created the needed output. My advice is to not include the options that only effect Listing output in any program you write going forward.
    Jane

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top