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

Hello,

 

I am trying to create a report using the following code:

 

/*--------------Final Report--------------*/
ods html file="MONTHLY_SNAPSHOT.htm" style=festival ;
options label ;
title1 'MONTHLY EXECUTIVE SNAPSHOT';
footnote1 ' ';

/*----Total Balance by Program----*/

proc report data=bal missing nowd headskip split="~" spanrows 

	style(report)=[background=white cellspacing=1  borderwidth=2 bordercolor=blue   ]

	style(header)=[color=Black
	fontsize=2]

	style(column)=[color=Black fontfamily=helvetica fontsize=1.8];
	
	title2 'Total Balance by Program';
	column Product Balance,RECORD_DATE;
	define product / group "Product"    style(header)=[textalign=r] style(column)=[fontsize = 2 textalign=r cellwidth=0.75in] ;
	define RECORD_DATE / across order=data 'Month';
	define balance / analysis '' style=[fontsize = 2];
	rbreak after /summarize style=[fontweight=bold fontsize = 2];

	compute after;
		product='Total';
	endcomp;

	
run;

/*----Total No. of Loans by Program----*/

proc report data=LOANS missing nowd headskip split="~" spanrows

	style(report)=[background=white cellspacing=1  borderwidth=2 bordercolor=blue   ]

	style(header)=[color=Black
	fontsize=2]

	style(column)=[color=Black
	fontfamily=helvetica fontsize=1.8];
	title1 'Total # Loans by Program';
	column Product '#'n,RECORD_DATE;
	define product / group "Product"    style(header)=[textalign=r] style(column)=[fontsize = 2 textalign=r cellwidth=0.75in];
	define RECORD_DATE / across order=data 'Month';
	define '#'n / analysis '' style=[fontsize = 2];
	rbreak after /summarize style=[fontweight=bold fontsize = 2];

	compute after;
		product='Total';
	endcomp;

	footnote1 ' ';
run;

/*----Monthly Originations by Program----*/

proc report data=Originations missing nowd headskip split="~" spanrows

	style(report)=[background=white cellspacing=1  borderwidth=2 bordercolor=blue   ]

	style(header)=[color=Black
	fontsize=2]

	style(column)=[color=Black
	fontfamily=helvetica fontsize=1.8];
	title1 'Monthly Originations by Program';
	column Product Originations,RECORD_DATE;
	define product / group "Product"    style(header)=[textalign=r] style(column)=[fontsize = 2 textalign=r cellwidth=0.75in] ;
	define RECORD_DATE / across order=data 'Month';
	define originations / analysis '' style=[fontsize = 2];
	rbreak after /summarize style=[fontweight=bold fontsize = 2];

	compute after;
		product='Total';
	endcomp;

	footnote1 ' ';
run;

/*----Monthly # Loan by Program----*/

proc report data=NumOriginations missing nowd headskip split="~" spanrows

	style(report)=[background=white cellspacing=1  borderwidth=2 bordercolor=blue   ]

	style(header)=[color=Black
	fontsize=2]

	style(column)=[color=Black
	fontfamily=helvetica fontsize=1.8];
	title1 'Monthly # Loan Originations by Program';
	column Product '#'n,RECORD_DATE;
	define product / group "Product"    style(header)=[textalign=r] style(column)=[fontsize = 2 textalign=r cellwidth=0.75in] ;
	define RECORD_DATE / across order=data 'Month';
	define '#'n / analysis '' style=[fontsize = 2];
	rbreak after /summarize style=[fontweight=bold fontsize = 2];

	compute after;
		product='Total';
	endcomp;

	footnote1 'COMPANY NAME';
	FOOTNOTE2 "Generated by SAS on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
run;

ods pdf close;
ods listing;

Some issues I am unable to tackle:

 

1. As can be seen, i have 4 different proct reports and those get combined into a single htm. How can I do it more efficiently because there is too much space between the 4 tables in the final output

 

2. The titles & footnotes - Trying to get a single global title and 4 individual titles before each table AND only *one* global footnote (no individual footnotes). Hance the footnote1'   ' ;   after every proc report (*sigh*).

 

Any help is appreciated.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Proc report will not use two or more datasets.

 

I'm pretty sure you are leaving something out as I see and ODS HTML destination opened but the ODS PDF Close.

 

If you need text that doesn't work with Titles you might try either ODS TEXT, which with ESCAPECHAR can modify style elements such as font, font size, font weight, font color and a host other things with enough work. Similar with footnotes. I believe that footnotes work a bit differently with other destinations. Since HTML doesn't really have a concept of page you may get more footnotes than wanted. Would RTF or PDF work instead of HTML?

 

Or you may be able to use Style Pretext and PostText elements.

 

Space between procedure output depends on a number of things, active style, font and some other stuff depending on destination.

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

Proc report will not use two or more datasets.

 

I'm pretty sure you are leaving something out as I see and ODS HTML destination opened but the ODS PDF Close.

 

If you need text that doesn't work with Titles you might try either ODS TEXT, which with ESCAPECHAR can modify style elements such as font, font size, font weight, font color and a host other things with enough work. Similar with footnotes. I believe that footnotes work a bit differently with other destinations. Since HTML doesn't really have a concept of page you may get more footnotes than wanted. Would RTF or PDF work instead of HTML?

 

Or you may be able to use Style Pretext and PostText elements.

 

Space between procedure output depends on a number of things, active style, font and some other stuff depending on destination.

 

 

karush
Calcite | Level 5

@ballardw - Thanks!

 

I'm using ODS TEXT and changed it to PDF. 

 

Much better now.

 

 

 

 

 

 

 

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 2 replies
  • 5894 views
  • 0 likes
  • 2 in conversation