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


Hi ,

I was trying to print the report with about 20 columns in PDF.

my options  for ods pdf were,

options nocenter  papersize=a4 orientation=landscape rightmargin=0.25cm;

Right margin seems to be not working when the papersize=A4 or letter and I see a lot of space on right sid eof each page.

It seems to be working fine when papersize=a3.

Any help is appreciated.

Thanks,

Dharmendra

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  Without getting into papersize issues, I ran the code below and see that the margins are behaving as I expect. I have posted a picture of the 3rd report, with the left margin set at .25in and the right margin set at .5 in and I don't see a lot of space on the right side of the page. However, when you look at report 1 and 2, you will see relatively more space on the right than the left, which is a function of having NOCENTER turned on. With Report 1a and 2a, you can see the impact of changing OUTPUTWIDTH=100% for the report -- it forces the report to stretch from margin to margin.

  Since I'm not entirely sure what you're seeing and since I don't have A3 or A4 paper to test with, I'd recommend opening a track with Tech Support if you continue to have issues with margins.

cynthia

options  leftmargin=.5in rightmargin=2in orientation=landscape nocenter;
ods listing close;
   
ods pdf file='c:\temp\trymargins1.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type;
  title '1) Nocenter, Left=.5in right=2in default width';
run;

proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type;
  title '1a) Nocenter, Left=.5in right=2in change width 100%';
run;
ods pdf close;  
    
options  leftmargin=1in rightmargin=2in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins2.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2) Nocenter, Left=1in right=2in default width';
run;
  
proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2a) Nocenter, Left=1in right=2in change width 100%';
run;
  
ods pdf close;
     
options  leftmargin=.25in rightmargin=.5in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins3.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders horsepower
         mpg_city mpg_highway weight wheelbase length;
  title '3) Nocenter, Left=.25in right=.5in';
  title2 'With different (wider) data';
run;
ods pdf close;
title;


margin_3_pdf.png

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:

  Without getting into papersize issues, I ran the code below and see that the margins are behaving as I expect. I have posted a picture of the 3rd report, with the left margin set at .25in and the right margin set at .5 in and I don't see a lot of space on the right side of the page. However, when you look at report 1 and 2, you will see relatively more space on the right than the left, which is a function of having NOCENTER turned on. With Report 1a and 2a, you can see the impact of changing OUTPUTWIDTH=100% for the report -- it forces the report to stretch from margin to margin.

  Since I'm not entirely sure what you're seeing and since I don't have A3 or A4 paper to test with, I'd recommend opening a track with Tech Support if you continue to have issues with margins.

cynthia

options  leftmargin=.5in rightmargin=2in orientation=landscape nocenter;
ods listing close;
   
ods pdf file='c:\temp\trymargins1.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type;
  title '1) Nocenter, Left=.5in right=2in default width';
run;

proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type;
  title '1a) Nocenter, Left=.5in right=2in change width 100%';
run;
ods pdf close;  
    
options  leftmargin=1in rightmargin=2in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins2.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2) Nocenter, Left=1in right=2in default width';
run;
  
proc report data=sashelp.cars(obs=5) nowd
     style(report)={outputwidth=100%};
  column make model type origin drivetrain msrp invoice enginesize cylinders
         horsepower mpg_city mpg_highway;
  title '2a) Nocenter, Left=1in right=2in change width 100%';
run;
  
ods pdf close;
     
options  leftmargin=.25in rightmargin=.5in orientation=landscape nocenter;
ods pdf file='c:\temp\trymargins3.pdf' notoc;
proc report data=sashelp.cars(obs=5) nowd;
  column make model type origin drivetrain msrp invoice enginesize cylinders horsepower
         mpg_city mpg_highway weight wheelbase length;
  title '3) Nocenter, Left=.25in right=.5in';
  title2 'With different (wider) data';
run;
ods pdf close;
title;


margin_3_pdf.png
dtirumalasetti
Fluorite | Level 6

Thank you so much Cynthia. It worked when tried with the options you mentioned above on one other example dataset, but still I got the same output with lot of space on right side with my data I have until I changed the escapechar from '^' to '~'.

Thanks for your help.

Cynthia_sas
SAS Super FREQ

Ah, interesting! Did I miss your earlier posting about ESCAPECHAR? I didn't see that.

cynthia

dtirumalasetti
Fluorite | Level 6

Cynthia..

I didn't think that was a problem initially with Escapechar until I tried that option. So, I didn't have any post about escapechar.

It was just pure luck that I tried changing the escapechar and it worked out . Very strange, but true.!

-Dharmendra

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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