BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AVO339
Obsidian | Level 7

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"

1 ACCEPTED SOLUTION

Accepted Solutions
RichardDeVen
Barite | Level 11

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

RichardADeVenezia_0-1599158128037.png

LISTING

RichardADeVenezia_1-1599158150780.png

 

View solution in original post

4 REPLIES 4
pink_poodle
Barite | Level 11

It could be something about the NOPRINT option.

AVO339
Obsidian | Level 7

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...

RichardDeVen
Barite | Level 11
Yes, I would report this as a bug. Apparently the LISTING destination is 'optimizing' it's output and deciding that break after rendering is not needed if all the columns are NOPRINT.
RichardDeVen
Barite | Level 11

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

RichardADeVenezia_0-1599158128037.png

LISTING

RichardADeVenezia_1-1599158150780.png

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

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
  • 699 views
  • 1 like
  • 3 in conversation