BookmarkSubscribeRSS Feed
_Hopper
Obsidian | Level 7

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;

3 REPLIES 3
Ksharp
Super User
@Cynthia_sas could give you more info.
Here is what I want say:

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?

Check dataset " test " and see if "paramord " has right value for your CALL DEFINE()?
Or try to remove option "SPANROWS" .


2. What is the best way to break reports across columns? I have too many columns to fit on a page.

Use ID and PAGE option LIke :
proc report.........
define a/group;
define b/grouo id ;
.......
define m/display page;
..........
NOTE: "a" and "b" would appear in very page . and report would start a new page from variable "m" .


3. I used SPANROWS to keep groups together across pages. Are there better methods?

Make a variable to mark obs which belong to the same page and using BY statement for this variable .
Cynthia_sas
SAS Super FREQ
Hi: you have not shown all of your code. For example, what is your data, what do your variables look like, what is the size of variable/the length? What is the macro call to %_bottomborder doing in the context of the PROC REPORT. What is your ODS destination, what are your style options for ODS? Without data, and complete code, it is nearly impossible to make any constructive suggestions. SPANROWS is designed to allow multiple group or order variable cells to span multiple rows and appear as one cell, not as multiple cells with divider lines. But honestly, the first thing I do with output that is too wide for a paged destination like RTF or PDF is to alter the font to be smaller and change the cellpadding to be smaller. Scott Huntley and I had a joint paper where we discussed differences in dealing with wide output in differing destinations. That paper is here: https://support.sas.com/resources/papers/proceedings14/SAS038-2014.pdf and it might help you figure out what's happening, especially if you are using PDF as the ODS destination.
Cynthia
_Hopper
Obsidian | Level 7

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. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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