Hi, I think this question may be asked before. But I was unable to find it. Basically, I have group variable say Subject (Math, English etc), and another column: Student.
Subject Sudent
Math Student1
...
Math Student100
In proc report, I want to list Math only in first row of all pages with all Students. Define Subject as group can only accomplish this in first page. In next page under same subject (here math), it shows blank.
I tried rowspans but it seemed working different from what I want here. Can you help?
Can you show an example of the desired output please?
Say page line limit is 65, in page 1, current output is
Math Student1
Student2
...
Studemt65
In page 2, it is
Student66
.
Student100
But I want Math also shows up in 2nd page and row 1 only, i.e. in page 2:
Math Sudent66
Student67
....
Student100
I created a sample data with 100 records grouped by variable "grp". Since one page can only hold say 60 records, the remaining 40 records will show up in next page. But in proc report, "grp" shows blank since it is group variable. I do want to show it in first observation in new page. Can you help?
data a;
do i=1 to 100;
grp="grp";
output;
end;
run;
ods rtf file="c:\ducoments\1.rtf";
proc report data=a ps=75;
column grp i;
define grp/group order=internal;
define i/display;
run;
ods rtf close;
Mmm that's one for tech support I reckon.
Usage Note 53783 seems to work fine for PDF but not RTF on my 9.4M2 SAS version
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.