The SAS Output Delivery System and reporting techniques

ods pdf file fit on one page

Reply
Frequent Contributor
Frequent Contributor
Posts: 79

ods pdf file fit on one page

I need have pdf file fit all the columns on one padge.

 

The code would not working, do no tknow why, need help. which option I should use to make it fit on one page.

 

options orientation=landscape pdfpageview=FITPAGE nocenter ;

ods pdf file="/mnt/nfs/prod/Sched/OpsDeptData/Operations/Reports/TPL_Membership_Summary_05042017.pdf";

PROC REPORT DATA=TPLMEM.TPL_SUMMARY_0100;

COLUMN MONTH Category OVERALL_MEMBERSHIP TPL MEDICARE MEDICARE_SUPPLEMENTAL MEDICARE_A MEDICARE_B MEDICARE_AB MEDICARE_ADVANTAGE COMMERCIAL VISION DENTAL LIMITED_BENEFITS Casualty PHARMACY;

DEFINE MONTH/GROUP;

DEFINE MONTH/ORDER descending;

title " LOB 0100 TPL Membership" ;

footnote" Run at &sDay &stime" ;

RUN;

ods pdf close;

Super User
Super User
Posts: 7,401

Re: ods pdf file fit on one page

You need to provide the information to SAS to get information to fit on a page, e.g.

ods pdf file="...";
proc report data=yourdata;
  column month category ...;
  define month / group style(column)={cellwidth=3cm};
  ...;
run;

Note the use of style()=, you can set all kinds of things here, cellwidth shows how wide the column would be (in this case in cm).  Make sure all your columns widths add up to the width of the page and your columns will all fit on one page.  Page breaking however is a totally different question (then you need an algorithm to work out how many rows per page to be displayed).

Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

Thank you. I am goign to try

SAS Super FREQ
Posts: 8,743

Re: ods pdf file fit on one page

Hi:
Scott Huntley and I discussed wide output in our paper: https://support.sas.com/resources/papers/proceedings14/SAS038-2014.pdf and showed other STYLE= techniques.

cynthia
Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

Thank you. Trying

Super User
Posts: 9,681

Re: ods pdf file fit on one page

Add one option to make pdf as big as to hold all variables.

option papersize=(100in 100in) ;
Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

thank you

Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

This works!

 

Thank you !

 

ods listing close;

options orientation=landscape papersize=(100in 100in)

nonumber topmargin=.25in bottommargin=.25in

leftmargin=.25in rightmargin=.25in;

ods escapechar='^';

ods pdf file="/mnt/nfs/prod/Sched/OpsDeptData/Operations/Reports/TPL_Membership/Summary/TPL_Membership_Summary.pdf";

PROC REPORT DATA=TPLMEM.TPL_SUMMARY_0100;

COLUMN MONTH Category OVERALL_MEMBERSHIP TPL MEDICARE MEDICARE_SUPPLEMENTAL MEDICARE_A MEDICARE_B MEDICARE_AB MEDICARE_ADVANTAGE COMMERCIAL VISION DENTAL LIMITED_BENEFITS Casualty PHARMACY;

DEFINE MONTH/GROUP;

DEFINE MONTH/ORDER descending;

title " LOB 0100 TPL Membership" ;

footnote" Run at &sDay &stime" ;

RUN;

ods pdf close;

Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

if Need put mutiple report for same PDF file, but would be mutiple page, this would not working.

 

ods listing close;

options orientation=landscape papersize=(100in 100in)

nonumber topmargin=.25in bottommargin=.25in

leftmargin=.25in rightmargin=.25in;

ods escapechar='^';

ods pdf file="/mnt/nfs/prod/Sched/OpsDeptData/Operations/Reports/TPL_Membership/Summary/TPL_Membership_Summary.pdf";

PROC REPORT DATA=TPLMEM.TPL_SUMMARY_0100;

COLUMN MONTH Category OVERALL_MEMBERSHIP TPL MEDICARE MEDICARE_SUPPLEMENTAL MEDICARE_A MEDICARE_B MEDICARE_AB MEDICARE_ADVANTAGE COMMERCIAL VISION DENTAL LIMITED_BENEFITS Casualty PHARMACY;

DEFINE MONTH/GROUP;

DEFINE MONTH/ORDER descending;

title " LOB 0100 TPL Membership" ;

footnote" Run at &sDay &stime" ;

RUN;

options orientation=landscape papersize=(100in 100in)

nonumber topmargin=.25in bottommargin=.25in

leftmargin=.25in rightmargin=.25in;

ods escapechar='^';

PROC REPORT DATA=TPLMEM.TPL_SUMMARY_0500;

COLUMN MONTH Category OVERALL_MEMBERSHIP TPL MEDICARE MEDICARE_SUPPLEMENTAL MEDICARE_A MEDICARE_B MEDICARE_AB MEDICARE_ADVANTAGE COMMERCIAL VISION DENTAL LIMITED_BENEFITS Casualty PHARMACY;

DEFINE MONTH/GROUP;

DEFINE MONTH/ORDER descending;

title "LOB 0500 TPL Membership";

footnote" Run at &sDay &stime" ;

RUN;

ods pdf close;

SAS Super FREQ
Posts: 8,743

Re: ods pdf file fit on one page

[ Edited ]

Hi:
If you know that both reports will fit on one physical page, one after the other, then you can use the STARTPAGE=NO option, like this (using PROC FREQ and PROC MEANS because I know that both tables will fit on 1 landscape page):

 

options orientation=landscape;

ods pdf file='c:\temp\use_startpage.pdf' startpage=no;
proc freq data=sashelp.class;
  tables age;
run;

proc means data=sashelp.class n min mean median;
  var height;
  class sex;
run;
ods pdf close;

Results:

use_startpage.png


cynthia

Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

Thank  you ! it works! Wonderful.

Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

ods pdf file fit on one page. when user oopen the pdf file, by defualt the viewable size very small, they need to resize make it readable. If they want to print ,  pdf file always stay on small size, how to solve this issue, how to set uo pdf default size as the normall readable size?

 

thank yo

Super User
Posts: 9,681

Re: ods pdf file fit on one page

You can change papersize as small as you can just hold all the variables.

options orientation=landscape papersize=(100in 100in)

nonumber topmargin=.25in bottommargin=.25in

leftmargin=.25in rightmargin=.25in;

 

options orientation=landscape papersize=(20in 10in)

nonumber topmargin=.25in bottommargin=.25in

leftmargin=.25in rightmargin=.25in;

 

options orientation=landscape papersize=A4

nonumber topmargin=.25in bottommargin=.25in

leftmargin=.25in rightmargin=.25in;

Frequent Contributor
Frequent Contributor
Posts: 79

Re: ods pdf file fit on one page

Ok, I see, will try.

 

Thank you.

 

I have another question: Smiley Happy.

 

Might be easy for you.

 

data _null_;

dEnd =intnx('dtmonth', dhms(today(),0,0,0), -1,'e');

dStart =intnx('dtMonth', dhms(today(),0,0,0), -1,'b');

Call symputx('dmstart',CATS("'",PUT(dStart,DATEtime18.),"'"));

Call symputx('dmEnd',CATS("'",PUT(dEnd,DATEtime18.),"'"));

run;

%PUT &dmstart &dmEnd;

'01APR17:00:00:00' '30APR17:23:59:59'

 

What I shold do if I need this format: '01APR2017:00:00:00' '30APR2017:23:59:59'

 

Super User
Posts: 10,500

Re: ods pdf file fit on one page


JHE wrote:

Ok, I see, will try.

 

Thank you.

 

I have another question: Smiley Happy.

 

Might be easy for you.

 

data _null_;

dEnd =intnx('dtmonth', dhms(today(),0,0,0), -1,'e');

dStart =intnx('dtMonth', dhms(today(),0,0,0), -1,'b');

Call symputx('dmstart',CATS("'",PUT(dStart,DATEtime18.),"'"));

Call symputx('dmEnd',CATS("'",PUT(dEnd,DATEtime18.),"'"));

run;

%PUT &dmstart &dmEnd;

'01APR17:00:00:00' '30APR17:23:59:59'

 

What I shold do if I need this format: '01APR2017:00:00:00' '30APR2017:23:59:59'

 


Why are you asking this date format question AGAIN?

You received many answers in https://communities.sas.com/t5/Base-SAS-Programming/Month-beging-with-00-00-00-month-end-with-23-59-... including one that you say "agrere, that is the solution!" 2 hours before posting this question?

Ask a Question
Discussion stats
  • 15 replies
  • 309 views
  • 0 likes
  • 5 in conversation