BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
acordes
Rhodochrosite | Level 12

I want the ods pdf to have gridded layout. 

In the sas studio window it appears gridded, but the pdf has only 1 column.

 

Furthermore the print includes a first title statement that shouldn't appear because the #byval1 is not resolved yet. 

 

data cars;
set sashelp.cars;
by model notsorted;
if first.model;
run;

proc transpose data=cars out=cars_long;
by model notsorted;
var _numeric_;
run;

data cars_long;
set cars_long;
label col1="value of analyzed variable" _name_="variable";
run;

proc sort data=cars_long;
by _name_;
run;


options papersize=A4 orientation=portrait leftmargin=1cm rightmargin=1cm; 

title;
ods pdf file="/caslibs/marketing/__test.pdf" style=Style.MySasWeb nogfootnote nogtitle  ;

options nobyline;                               
ods layout gridded columns=2 advance=bygroup;      
title "Histogram & kernel for #byval1";
  
ods region;             
proc sgplot data=cars_long noautolegend;
where col1 ne .;
by _NAME_ ;
  histogram col1 / dataskin=sheen    ;
  density col1 / type=kernel transparency=0.4;
run;

options byline;
ods layout end;

ods pdf close;

pic0.pngpic.png

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I don't know why your titles aren't working properly, this seems like a bug to me.

 

Your plots use the default size. If you change the plot size, then they will fit on one page.

 

ods graphics / height=3in width=3in; 

 

or you can use any other height and width that works for you.

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

I don't know why your titles aren't working properly, this seems like a bug to me.

 

Your plots use the default size. If you change the plot size, then they will fit on one page.

 

ods graphics / height=3in width=3in; 

 

or you can use any other height and width that works for you.

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 999 views
  • 0 likes
  • 2 in conversation