I'm getting an error when I run my code where I'm attempting to combine charts by creating images:
options printerpath=png nodate papersize=('30cm','20cm');
ods _all_ close;
ods printer file="X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display\nes_tdsp.png";
proc freq data=active; table nes_tdsp; run;
ods printer close;
ods listing;
***************************************************************************************
Combine charts
************************************************************************************;
%let png_dest=X:\!!-MarketingAnalytics\Ad Hoc\Keegan\Graphic Display;
libname png_dest "&png_dest.";
ods _all_ close;
/*Use ODS LISTING to create graphic output files*/
ods listing gpath="&png_dest." style=Pearl dpi=300;
ods graphics on / reset=index width=20cm
outputfmt=png imagename='img1';
data combine;
length c1 c2 $500;
c1='^S={width=20cm just=center preimage="&png_dest\cong_zone.png"}';
c2='^S={width=20cm just=center preimage="&png_dest\enroll_type.png"}';
output;
c1='^S={width=20cm just=center preimage="&png_dest\tdsp.png"}';
c2='^S={width=20cm just=center preimage="&png_dest\nes_tdsp.png"}';
output;
run;
proc report data=combine nowindows
style=[rules=none frame=void cellpadding=0];
columns c1 c2;
define c1-c2 / display ' ';;
run;
I've only included one chart to shorten the code I display. But here is the error I get:
526 proc report data=combine nowindows 527 style=[rules=none frame=void cellpadding=0]; 528 columns c1 c2; 529 define c1-c2 / display ' ';; 530 run; ERROR: The width of c1 is not between 1 and 77. Adjust the column width or line size. NOTE: This affects LISTING output. NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 2 observations read from the data set WORK.COMBINE. NOTE: PROCEDURE REPORT used (Total process time): real time 02 seconds cpu time 0.03 seconds
How about this, does it fix the problem?
options linesize=200;
Of course, if you really need 200 columns for the output, and you really need graphics, perhaps LISTING is not the best output destination.
Hi Paige, where do you insert this option?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.