I know how to do that for footnote and header with "compute after" and "compute before". But
May I know how I can specify the unique value for "xxx" in red below per page in the description of column "b" when using proc report?
for example, it would be N=10 in page one and N=11 in page 2... Thank you.
proc report data=final nowd nocenter headline headskip missing split='^' spacing=1;
column ('_' a b c);
define a /order noprint;
define b /center "Subjects Evaluable for TE*a^(N=xxx)^n (%)" width=30 spacing=1 id group order=data;
define c /center "abc" width=30 spacing=1 id group order=data;
break after a/ page;
compute before _page_;
...
compute after _page_;
...
run;
Hi:
I'm still now clear on what XXX represents? If you mean page number, I think that can only be used in the TITLE and FOOTNOTE statements. Your output is using LISTING only options like HEADLINE, HEADSKIP, WIDTH= and SPACING= that are only used by the LISTING or OUTPUT destination. What is confusing is that the N=XXX doesn't make sense to me because if page 1 will have N=10 and page 2 will have N=11 how do you know that page 2 will be 11? Will page 3 be 12 and page 4 have a value of 14 for XXX?
Can you clarify exactly what your data looks like by providing a sample dataset. Can you also clarify what the output destination should be? Are you only creating output for the LISTING window or do you envision creating RTF, PDF, HTML or Excel output? If you are trying to create any ODS output then some of your options will not work.
The other issue I see is that the column header typically doesn't change from page to page. So once you have your N=XXX on page 1, the usual behavior of PROC REPORT would be to repeat the SAME value for the header on every page. in a compute before or compute after block, you could use a macro variable to change text that you would write with a LINE statement. However, the column headers for each variable would typically NOT change because they can't be touched by the COMPUTE BEFORE or COMPUTE AFTER code.
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.