BookmarkSubscribeRSS Feed
thanikondharish
Fluorite | Level 6

ods rtf file='D:\harish_resume\testing.rtf' ;
proc report data=sashelp.cars nowd;
column origin make type msrp ;
define origin/id order ;
run;
ods rtf close ;

 

after generating rtf file first page has origin value but next page hasn't origin value .

id : should print every page

 

 

 

2 REPLIES 2
ballardw
Super User

The ID option comes into play when you have more columns than will normally fit on a page. The ID variables are then duplicated for the extended rows so you can identify which row is extended into a another "block" of table output.

 

Consider the output of from this:

ods rtf file='D:\harish_resume\testing.rtf' ;

proc report data=sashelp.cars nowd
  colwidth =15 ;
define origin/id order ;
run;
ods rtf close;

Which will have the output for all of the variables and the width will exceed the width of a page. So the all of the tables with the first variables will be displayed and then the extended output will appear afterwards with continued variables.

Since the ID variable is Origin and the default order of the data without a columns statement has Make, Model and Type appear to the left of the ID variable all of those are repeated. From the documentation for ID:

  An ID variable and all columns to its left appear at the left of every page of a report. ID ensures that you can identify each row of the report when the report contains more columns than fits on one page.

 

You likely don't want an ID variable as an order variable due to the way order variables are used.

 

I am not sure what you are attempting to accomplish. Maybe you want a PAGE variable??

Ksharp
Super User

Generally , ID option is company with PAGE option .

 

proc report data=sashelp.cars(obs=10) nowd;
column origin make type msrp ;
define origin/id order ;
define msrp/display page;
run;

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
  • 2 replies
  • 3488 views
  • 0 likes
  • 3 in conversation