Hi everybody.
With SAS 9.4M6 and EG 8.1 (or EG 7.15) PROC REPORT has a different behaviour for some ODS destinations.
The SAS code below will give output for theses ODS destinations: PDF, HTML, RTF, POWERPOINT, EXCEL but not for ODS LISTING and the SAS standard report output. Why?
DATA ASSETS;
INPUT CLIENT $5. +1 PROV $2. +1 RRSP RRIF;
DATALINES;
A-506 QC 74500 0
10977 ON 98200 0
BA-90 QC 650 92450
20123 ON 0 42700
29856 ON 21540 0
;
RUN;
TITLE "SUMMARY REPORT";
PROC REPORT DATA=ASSETS NOCENTER;
COLUMNS PROV RRSP RRIF;
DEFINE PROV / GROUP "PROVINCE" NOPRINT;
DEFINE RRSP / ANALYSIS SUM NOPRINT;
DEFINE RRIF / ANALYSIS SUM NOPRINT;
BREAK AFTER PROV / SUMMARIZE PAGE;
COMPUTE AFTER PROV;
LINE "PROVINCE: " PROV $2.;
LINE "=============";
LINE " Registered Retirement Savings Plan " RRSP.SUM NLNUM10.;
LINE " Registered Retirement Income Funds " RRIF.SUM NLNUM10.;
ENDCOMP;
RUN;
I think this is a bug... And you?
Alain "AVO339"
If you NEED the listing output to occur, you can 'hack' it with an additional variable, '00'x label and a custom format. There will be some blank lines.
Example:
options formdlim = '-';
DATA ASSETS;
INPUT CLIENT $5. +1 PROV $2. +1 RRSP RRIF;
fix=1;
DATALINES;
A-506 QC 74500 0
10977 ON 98200 0
BA-90 QC 650 92450
20123 ON 0 42700
29856 ON 21540 0
;
RUN;
ods html file='report.html';
ods listing;
dm 'clear listing';
proc format;
value fix low-high = ' ';
TITLE "SUMMARY REPORT";
PROC REPORT DATA=ASSETS NOCENTER
style(summary)=[cellheight=.1in fontsize=1px]
;
COLUMNS fix PROV RRSP RRIF;
define fix / group format=fix. style=[cellheight=.1in fontsize=1px];
label fix = '00'x;
DEFINE PROV / GROUP "PROVINCE" NOPRINT;
DEFINE RRSP / ANALYSIS SUM NOPRINT;
DEFINE RRIF / ANALYSIS SUM NOPRINT;
BREAK AFTER PROV / SUMMARIZE PAGE;
COMPUTE AFTER PROV;
LINE "PROVINCE: " PROV $2.;
LINE "=============";
LINE " Registered Retirement Savings Plan " RRSP.SUM NLNUM10.;
LINE " Registered Retirement Income Funds " RRIF.SUM NLNUM10.;
ENDCOMP;
RUN;
ods _all_ close;
dm 'output' output;
HTML
LISTING
It could be something about the NOPRINT option.
The point here is the fact that an output report is produced for the following ODS destinations: RTF, Excel, PowerPoint, HTML, PDF but not for ODS LISTING and SAS standard Report output. You can copy and paste the code to try.
This is why I don't believe that the NOPRINT option has something to do with this strange behaviour.
Maybe I have to submit this case to the technical support...
If you NEED the listing output to occur, you can 'hack' it with an additional variable, '00'x label and a custom format. There will be some blank lines.
Example:
options formdlim = '-';
DATA ASSETS;
INPUT CLIENT $5. +1 PROV $2. +1 RRSP RRIF;
fix=1;
DATALINES;
A-506 QC 74500 0
10977 ON 98200 0
BA-90 QC 650 92450
20123 ON 0 42700
29856 ON 21540 0
;
RUN;
ods html file='report.html';
ods listing;
dm 'clear listing';
proc format;
value fix low-high = ' ';
TITLE "SUMMARY REPORT";
PROC REPORT DATA=ASSETS NOCENTER
style(summary)=[cellheight=.1in fontsize=1px]
;
COLUMNS fix PROV RRSP RRIF;
define fix / group format=fix. style=[cellheight=.1in fontsize=1px];
label fix = '00'x;
DEFINE PROV / GROUP "PROVINCE" NOPRINT;
DEFINE RRSP / ANALYSIS SUM NOPRINT;
DEFINE RRIF / ANALYSIS SUM NOPRINT;
BREAK AFTER PROV / SUMMARIZE PAGE;
COMPUTE AFTER PROV;
LINE "PROVINCE: " PROV $2.;
LINE "=============";
LINE " Registered Retirement Savings Plan " RRSP.SUM NLNUM10.;
LINE " Registered Retirement Income Funds " RRIF.SUM NLNUM10.;
ENDCOMP;
RUN;
ods _all_ close;
dm 'output' output;
HTML
LISTING
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.