BookmarkSubscribeRSS Feed
Keegan
Obsidian | Level 7

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

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Keegan
Obsidian | Level 7

Hi Paige, where do you insert this option?

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