BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NJGIRL
Obsidian | Level 7

PATIENT

SKREAD

CURRENT VISIT REMOVED

PRIOR VISIT APPLIED

OOW

0101

16

16APR2017:09:00

15APR2017:10:30:00

22

0101

20

20APR2017:09:00

19APR2017:10:30:00

22

 

 HELLO, I am trying to expand the above output across the page. I would like it to 'spread out' more. here is my code:  (thank you)

 

 

ODS RTF FILE="&OUTFILE" STYLE=STYLES.TEST HEADERY=720 FOOTERY=720;

ODS LISTING CLOSE;

options linesize = 200 pagesize = 200;

TITLE1 "&CLIENT";

TITLE2 "&PROJECT";

TITLE3 "Generated on &sysdate. for OOW Listing";

PROC PRINT DATA=OOW_1 NOOBS label;

var pat skread removed lagapplied hours ;

format lagapplied datetime20.;

label pat = "PATIENT"

skread = "SKREAD"

lagapplied = "PRIOR VISIT APPLIED"

removed = "CURRENT VISIT REMOVED"

hours = "OOW" ;

RUN;

ODS RTF CLOSE;

ODS LISTING;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi:
For completeness an alternate solution would be to let ODS do the spread by doing something like this:
PROC PRINT DATA=OOW_1 NOOBS label
     style(table)={width=6.5in};
var pat skread removed lagapplied hours ;

... more code...

You can apply the width= option to the whole table and then ODS does the "stretching".

cynthia

View solution in original post

4 REPLIES 4
Reeza
Super User

Linesize only affects the ODS LISTING output as far as I know. 

You can use PROC REPORT and the width option to specify how wide the columns are, I'm not sure there's an easy way in PROC PRINT.

ballardw
Super User

You can set the desired width for each variable, here is an example:

PROC PRINT DATA=OOW_1 NOOBS label;

var pat          /Style=[cellwidth= 1.2in] ;
var skread       /Style=[cellwidth= 1.2in] ;
var removed      /Style=[cellwidth= 1.2in] ;
var lagapplied   /Style=[cellwidth= 1.2in] ;
var hours        /Style=[cellwidth= 1.2in] ;

format lagapplied datetime20.;
run;

replace the value following cellwidth= with the value you would like. You can us cm as well for easy understanding of the desired widths. There are other measures allowed but printer points are familiar to most of us and pixels really aren't a good idea for document files.

 

 

I left out the labels and such to emphasize the part that answers your question.

Cynthia_sas
Diamond | Level 26

Hi:
For completeness an alternate solution would be to let ODS do the spread by doing something like this:
PROC PRINT DATA=OOW_1 NOOBS label
     style(table)={width=6.5in};
var pat skread removed lagapplied hours ;

... more code...

You can apply the width= option to the whole table and then ODS does the "stretching".

cynthia

NJGIRL
Obsidian | Level 7
thank you!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1991 views
  • 3 likes
  • 4 in conversation