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

Version 9.4 (TS1M3)

Windows 10 64os

 

Hello: 

The output from prg. gives me 2 graphs .

One is sgplot.png and the 2nd is ods html file.png.

I am thinking that I should be just getting one graph.

Not sure why 2 graphs are being produces.

I would like to keep only the html file and I would like not to have to 

use the delete key for the other.

 

Thanks for you help.

 

 

ods listing close ;
ods graphics on /
width = 6.4 in
height = 4.8 in
imagefmt = png
imagemap = on
border = no
;
ods html file = "ChgDIABPvsbaseDia-base.png"
style = journal
path = 'C:\ProjectName\sasout\png\' 
image_dpi = 96 ;

Title1 font = 'Arial' H = 1.5 j=c "Figure 2.4 " ;
Title2 font = 'Arial' H = 1.5 j=c "Test 1" ;
Title3 font='Arial' H = 1.5 j=c "Change vs. Base" ;


proc sgplot data = ad2A noautolegend ;
where avisitn = -1 ;
scatter y = chgdia x = basedia /
markerattrs=(symbol=circlefilled size = 4 pt color = blue) ;
yaxis label = "Chg. Diastolic BP (mmHg) " values = (-20 to 20 by 10 ) ;
xaxis label = "Baseline Diastolic BP (mmHg)" values = (60 to 100 by 10) ;

run ;
ods graphics off ;

ods listing ;

 

Log output:

4120 ods graphics off ;
4121
4122 
4123 ods listing close ;
4124 ods graphics on /
4125 width = 6.4 in
4126 height = 4.8 in
4127 imagefmt = png
4128 imagemap = on
4129 border = no
4130 ;
4131 ods html file = "ChgDiaBPvsbasedia-wk12.png"
The SAS System

4132 style = journal
4133 path = 'C:\Projects\sasout\png\'
4134 image_dpi = 96 ;
NOTE: Writing HTML Body file: ChgDiaBPvsbasedia-wk12.png
4135
4136 Title1 font = 'Arial' H = 1.5 j=c "Figure 2.6 " ;
4137 Title2 font = 'Arial' H = 1.5 j=c " Test1" ;
4138 Title3 font='Arial' H = 1.5 j=c "Change Diastolic Mean BP vs. Base BP at Week 12" ;
4139 proc sgplot data = ad2A noautolegend ;
4140 where avisitn = 16 ;
4141 scatter y = chgdia x = basedia /
4142 markerattrs=(symbol=circlefilled size = 4 pt color = blue) ;
4143 yaxis label = "Chg. Diastolic BP (mmHg) " values = (-20 to 20 by 10 ) ;
4144 xaxis label = "Baseline Dialstolic BP (mmHg)" values = (60 to 100 by 10) ;
4145
4146 run ;

NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.26 seconds
cpu time 0.06 seconds

NOTE: There were 109 observations read from the data set WORK.ADZA2A.
WHERE avisitn=16;

4147 ods graphics off ;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

This:

 

ods html file = "ChgDIABPvsbaseDia-base.png"

 

Creates an HTML file with a .png extension, not a PNG file. Change the extension to ".html". The sgplot.png is the real image file. If you want to change the image file name, use the following:

 

ods graphics / imagename="whatever";  /* Do NOT put an extension on "whatever". The correct extension will be added */

 

You can also add RESET=INDEX to reset the filename indexing and allow image files to be overwritten:

 

ods graphics / reset=index imagename="whatever"; 

 

Hope this helps!

Dan

 

View solution in original post

1 REPLY 1
DanH_sas
SAS Super FREQ

This:

 

ods html file = "ChgDIABPvsbaseDia-base.png"

 

Creates an HTML file with a .png extension, not a PNG file. Change the extension to ".html". The sgplot.png is the real image file. If you want to change the image file name, use the following:

 

ods graphics / imagename="whatever";  /* Do NOT put an extension on "whatever". The correct extension will be added */

 

You can also add RESET=INDEX to reset the filename indexing and allow image files to be overwritten:

 

ods graphics / reset=index imagename="whatever"; 

 

Hope this helps!

Dan

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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