BookmarkSubscribeRSS Feed
Hungry2Learn
Calcite | Level 5

For reference, I'm using Studio 3.5.

 

I'm creating my graph using this code

ods graphics / imagefmt=png imagename='DemoPNG';
proc sgplot data=work.dummytable (where=(yvar_name > 0));
	scatter x=xvar_name y=yvar_name / group=category_name markerattrs=(size=5);
	xaxis grid;
	yaxis grid type=log;
run;
ods graphics on / reset=all;

Which provides me with this graph in the results tab

DemoStudioResults.PNG

 

And this graph in the DemoPNG.png file

DemoPNG.png

 

Then I send the email using the following code

filename send email to=('first.last@company.com')
    subject='Graph Report'
    attach=('DemoPNG.png' NAME='GraphImage' INLINED='inserter')
    content_type='text/html';

data _null_;
    file send;
    put '<IMG src="cid:inserter" height="500" width="800">';
run;

I'd like to have the DemoPNG graph look like what's displayed in results but I'm having trouble figuring out how to do so. Thanks in advance for the help!

5 REPLIES 5
Ksharp
Super User
Try this option :

ods graphics / attrpriority=color ;
Hungry2Learn
Calcite | Level 5
I gave this a shot, but sadly there was no change to the session png file or the embedded image.
Ksharp
Super User

Do you used this code to save your PGN image ?

 

ods listing /gpath='c:\temp' ;

Or @GraphGuy  Robert.A know the solution .

Hungry2Learn
Calcite | Level 5
So far I've just let the files go to my working directory. I added a gpath statement though and the saved files are no different.
GraphGuy
Meteorite | Level 14

Perhaps try hard-coding an ods style (such as style=htmlblue).

Unfortunately, I think SAS defaults to different ods styles in different situations, rather than having the same default everywhere.

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