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

Hi,

 

I have one question.

 

 

 

I using ods pdf for save my data set.

 

But, It has problem.

 

My data has many columns, so pdf file show two pages. Not one pages.

 

Then, I want to fix my first column for second page.

 

like this

 

pdf view

 

<Now pdf file>

ID Age Weight Height ......         <- 1st page

1  15     157     58    ..........

.

.

 

BMI .....                                      <- 2nd page

23

 

 

<I want this pdf file>

ID Age Weight Height ......         <- 1st page

1  15     157     58    ..........

.

.

 

ID BMI .....                                      <- 2nd page

23

 

 

How do I solve this problem? please Help Me!

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
ods pdf file='c:\temp\x.pdf';
proc report data=sashelp.class nowd;
column name sex age weight height;
define name/display id;
define weight/display page;
run;
ods pdf close;

View solution in original post

4 REPLIES 4
Norman21
Lapis Lazuli | Level 10

You can do this with PROC REPORT. Cynthia has written a useful tutorial:

 

Norman.
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

RW9
Diamond | Level 26 RW9
Diamond | Level 26

You can also adjust the orientation of the page:

options orientation=landscape;

Before your pdf call will set page to wider rather than longer so you can fit more or.  You can also adjust cell widths:

proc report...
  ...
  define id / style={cellwidth=1cm};
...
run;

So the cell fits the data.  You can add wrapping within cell with split characters, or adjust the font size, or put ID on a by line, or combine columns etc.  There are hundreds of ways of achieving a certain output.

andreas_lds
Jade | Level 19

@J_hoon wrote:

Hi,

 

I have one question.

 

 

 

I using ods pdf for save my data set.

 


 

Why do you "save" your dataset as pdf? For re-using the data it would be better to copy the dataset to a permanent library.

Ksharp
Super User
ods pdf file='c:\temp\x.pdf';
proc report data=sashelp.class nowd;
column name sex age weight height;
define name/display id;
define weight/display page;
run;
ods pdf close;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 911 views
  • 1 like
  • 5 in conversation