As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Tips:Almost automatic PROC REPORT code generator

From sasCommunity
Jump to: navigation, search

Some little known PROC REPORT options can be used to automatically generate the column and define statements for an easily customizable PROC REPORT.

PROC REPORT data=sashelp.class nowd list;
run;

will produce something like the following in the log:

PROC REPORT DATA=SASHELP.CLASS LS=171 PS=58 SPLIT="/" CENTER ;
COLUMN Name Sex Age Height Weight ;
DEFINE Name / DISPLAY FORMAT= $8. WIDTH=8 SPACING=2 LEFT "Name" ;
DEFINE Sex / DISPLAY FORMAT= $1. WIDTH=1 SPACING=2 LEFT "Sex" ;
DEFINE Age / SUM FORMAT= BEST9. WIDTH=9 SPACING=2 RIGHT "Age" ;
DEFINE Height / SUM FORMAT= BEST9. WIDTH=9 SPACING=2 RIGHT "Height" ;
DEFINE Weight / SUM FORMAT= BEST9. WIDTH=9 SPACING=2 RIGHT "Weight" ;
RUN;

Note: This tip was provided by Roger DeAngelis in a SAS-L post:

...read more

Submitted By Art T