BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5

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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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