BookmarkSubscribeRSS Feed
jsbyxws
Obsidian | Level 7

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? 

6 REPLIES 6
ChrisNZ
Tourmaline | Level 20

Can you show an example of the desired output please?

jsbyxws
Obsidian | Level 7

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

jsbyxws
Obsidian | Level 7
Thanks for help! Yes, I checked all three "this". The 2nd "this" wanted different result. The first case using "spanrows" actually moved page-broken section to next page - which is a bit different from what I want. The 3rd "this" is what I wanted to show but don't know how to modify its code to fit mine.
jsbyxws
Obsidian | Level 7

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;

ChrisNZ
Tourmaline | Level 20

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

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 5287 views
  • 0 likes
  • 2 in conversation