Following is my base code in PROC Report.
Paramord is a formatted integer, statord is an unformatted integer.
Two questions:
1. I tried using CALL DEFINE to set the justification of STATTEXT based on the value of PARAMORD but all it did was justify the first row in each block and did nothing with the others. Thoughts?
2. What is the best way to break reports across columns? I have too many columns to fit on a page.
3. I used SPANROWS to keep groups together across pages. Are there better methods?
proc report data = combinecount out = test split = "*" SPANROWS;
column ("Parameter" paramord ) statord ("Stat or Category" stattext) colvar,text dummy;
define paramord / ' ' group order = internal style = {just = l};
define statord / ' ' group noprint order = internal;
define stattext/ ' ' group ;
define colvar/ ' ' across order = internal;
define text / ' ' style = {just = c};
define dummy / noprint;
compute stattext;
if paramord in (1,5,6,7,8,9,10) then call define('stattext','style','style={just = l}');
if paramord in (2,3,4,11,12,13,14) then call define('stattext','style','style={just = r}');
endcomp;
compute before;
line " ";
endcomp;
compute after paramord;
line ' ';
endcomp;
%_bottomborder;
run;
The bottomborder macro is not needed and can be ignored. The across variable is a formatted numeric categorical variable (8 distinct values). The remaining variables except for the ordering variables are text. For example STATEXT is the type of statistic, and text contains the result values.
The ODS destination is RTF but PDF is also a possibility.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.