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

Hello,

 

I have the following code working. I am able to get only the last plot in the pdf.

 

My Problem is: I want to get all 3 charts on a single pdf on a unix server.

Please advise.

 

data plot;
input _yyyymm yymmn6. var1 var2 var3 group $;
datalines;
200903 1 2 3 grp1
200906 4 5 6 grp1
200909 7 8 9 grp1
200912 10 11 12 grp1
200903 1 2 3 grp2
200906 4 5 6 grp2
200909 7 8 9 grp2
200912 10 11 12 grp2
200903 1 2 3 grp3
200906 4 5 6 grp3
200909 7 8 9 grp3
200912 10 11 12 grp3
;
run;

%macro plot_percentagezero(_varStart=,_varStop=);
/*ods pdf file="/path/on/unix/server/ReportForSAS.pdf" startpage=never;*/
goptions reset=all cback=white border htext=10pt htitle=12pt;

axis1 label=none;
axis2 label=(angle=90 "Percentage");

symbol1 interpol=join color=vibg  height=14pt font='Arial' value='80'x;  /* GRP1 */
symbol2 interpol=join color=mob   height=14pt font='Arial' value='A3'x;  /* GRP2 */
symbol3 interpol=join color=depk  height=14pt font='Arial' value='A5'x;  /* GRP3 */

legend1 repeat=1 shape=symbol(5,2.5) label=none frame;

%do i = &_varStart. %to &_varStop. ;
proc gplot data=PLOT;
   plot (var1 var2 var3 )*_YYYYMM / overlay legend=legend1
                                       haxis=axis1 vaxis=axis2;
WHERE lowcase(group)=lowcase("grp&i.");
title "Plot on :: grp&i.";
run;
quit;
%end;

/*ods pdf close;*/
%mend plot_percentagezero;

%plot_percentagezero(_varStart=1,_varStop=3);
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

See if removing the STARTPAGE=NEVER fixes it.

 

From the documentation for ODS PDF:

 

NEVER

specifies not to insert page breaks, even before graphics procedures.

CAUTION:
Each graph normally requires an entire page. The default behavior forces a new page after a graphics procedure. STARTPAGE=NEVER turns off that behavior, so specifying STARTPAGE= NEVER might cause graphics to overprint.

View solution in original post

2 REPLIES 2
ballardw
Super User

See if removing the STARTPAGE=NEVER fixes it.

 

From the documentation for ODS PDF:

 

NEVER

specifies not to insert page breaks, even before graphics procedures.

CAUTION:
Each graph normally requires an entire page. The default behavior forces a new page after a graphics procedure. STARTPAGE=NEVER turns off that behavior, so specifying STARTPAGE= NEVER might cause graphics to overprint.
zahir
Fluorite | Level 6

I'd like to notice one thing, your topic title mentioned for SGPLOT whereas given SAS code is for GPLOT. SGPLOT and GPLOT are different SAS procedures, aren't it?

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