BookmarkSubscribeRSS Feed
DanielQuay
Quartz | Level 8

I have a dataset with 57 observations.  Each observation has over 100 variables. 

When I use proc print to write the data to a PDF I get a 660 page document.

I need to reduce my page count if humanly possible.  Right now each page contains one row of data.

Basically I need it to not start a new page until it gets to a new observation or runs out of space.

 

Here is the code I have, truncated of course (nobody wants to see all my variable names and formats).

 

ods pdf file="C:\PAMR Program\SAS Codes\Data\BC_Data_&sysdate..pdf" ;
proc print data = P_BC noobs ;
var <variables list> ;
by MNAME;
where MNAME ne ' ';
run;
ods pdf close;

 

I thought I was onto something with the startpage optionbut I'm coming up with the same thing.

5 REPLIES 5
ballardw
Super User

Reduce font size is one option. You don't mention which ODS Style you are using. Changing the ODS style, customizing one to use a smaller font might help a little but likely not much.

 

Using Proc Print with a largish number of variables is typically going to be too wide to fit on your default Papersize setting.

You can try setting a larger/wider Papersize before running the ODS PDF.

 

OPTIONS Papersize =( 22in 10in);

would set the size to a width of 22 inches and 10 inches high for each "page" of output. You can experiment with what works for your desired appearance. This is very likely to require horizontal scrolling to read.

If you have individual variables with very long values, say 10000 characters you likely are going to spend a lot time to get this "right" as individual cells and word wrapping may still occur.

andreas_lds
Jade | Level 19

Each observation has over 100 variables.

So all variables will hardly fit on a page even after reducing font-size to be hardly readable at all and using landscape-layout. So the question is: Are the clients aware that they want something as useful as a bottle of Tabasco sauce in the desert?

DanielQuay
Quartz | Level 8

I kind of love this response actually and am going to remember that analogy.  

The clients are aware, the management that is making this have to happen says it has to happen though.

So I get to keep trying to find a way to make this more useable for the clients.

ballardw
Super User

@DanielQuay wrote:

I kind of love this response actually and am going to remember that analogy.  

The clients are aware, the management that is making this have to happen says it has to happen though.

So I get to keep trying to find a way to make this more useable for the clients.


Have you tried the PAPERSIZE option?

If they expect this to fit on paper they will just have to settle for 600 page documents or find a printer that uses much larger sheets for output.

ghosh
Barite | Level 11

I would suggest design an ods layout absolute page where each obs will print in its own pdf file by cycling through the dataset.  You could then combine all the files into one document with Adobe Acrobat  or a free utility.

Alternatively an ods layout gridded design will produce just one file, but you may have less control in triggering a new page.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 5 replies
  • 1463 views
  • 2 likes
  • 4 in conversation