BookmarkSubscribeRSS Feed
deleted_user
Not applicable
The proc report code below does what I want except when there are too many lines for an entire set with the same value of month_of to fit on one page. If month_of takes more than one page the detail of a run_date sub group prints on one page and the summary prints on the next. I have not had a case where detail is split between pages but I don't know if that is blind luck or an artifact of how proc report works. Is there some way to force the detail and summary values for a value of run_date to be on the same page?


proc report data=typesummary nowindows;
by month_of;
column report_month run_date reporting_type count FAF SLF Total_Cost Expended_Amount;
define run_date / GROUP;
define reporting_type / GROUP;
define count / analysis sum;
define FAFunds / analysis sum;
define SLFunds / analysis sum;
define Total_Cost / analysis sum;
define Expended_Amount / analysis sum;
break after run_date / skip summarize dol dul;
run;
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
I'm confused. You show a BY statement for the variable MONTH_OF, but then you have REPORT_MONTH in the COLUMN statement with no usage or DEFINE statement. Are MONTH_OF and REPORT_MONTH the same variable???

cynthia
deleted_user
Not applicable
Sorry I should have explained. month_of and report_month are not the same. There are multiple runs in a month and sometimes the final run is made a few days after the month ends.

Report_month just identifies which run is the one with final figures for the month. It is missing for all other runs for that month.

Month_of is the month and year from run_date for observations that are not the final run. Month_of is the month and year from report_month for final runs.

report_month without a define or other usage statement appears to be treated like an ID statement. It is incorporated into the report but only to label the final run of the month as such.
leo_36
Calcite | Level 5
Since your report is dependent on when the update is occurring, it might be simpler to generate 2 reports or use PROC SQL to create summary and detailed reports.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 3 replies
  • 698 views
  • 0 likes
  • 3 in conversation