BookmarkSubscribeRSS Feed
SachinRuk
Calcite | Level 5
Hi All,

Is it possible to tell me where im going wrong in this code? the chart plots fine except that the title of the plot is ^S=preimage.... as opposed to what I want (blob2).

Also the picture is shown AFTER the plot, even though I've specified it before the plot in my code.

Any thoughts?
Thanks,
Sachin

ODS LISTING CLOSE;
ODS HTML;
ods escapechar='^';
title j=l '^S={preimage="C:/Documents and Settings/nsya/Desktop/flower.jpg"}';


symbol i=join v=dot;
proc gplot data=test_mydata2;
format gross_combined_ratio percent.;
plot gross_combined_ratio*sasdate=measure;
title2 'blob2';
run;
quit;
proc print data=table noobs;
title3 'blob3';
run;

ODS HTML CLOSE;
5 REPLIES 5
DanH_sas
SAS Super FREQ
Hey Sachin,

You may need to add the NOGTITLE option to the ODS HTML statement to get the picture to display properly.

Thanks!
Dan
SachinRuk
Calcite | Level 5
sweet, that worked. it doesnt explain why it doesn't erase output from my previous runs of code though.

Hoping this is a quick fix like before. Fingers crossed.

Thanks,
Sachin
Cynthia_sas
SAS Super FREQ
Hi:
SAS will not "erase" any previously created external IMAGE files (such as those pointed to with an <IMG> tag). It may overwrite a previously created HTML file -- but if your SAS job created GCHART.PNG the first time you ran the code, and then you did a tweak or two and then ran the code again, the second time, SAS would create GCHART1.PNG; and if you did more tweaks, and resubmitted your code, then SAS would create GCHART2.PNG, etc, etc.

The -final- HTML file will contain an <IMG> tag that points to the name of the most recent file created by SAS/GRAPH. So if you are finally happy with your last run, (and that job created GCHART2.PNG), then you should find an <IMG> tag that points to GCHART2.PNG in your HTML file. However, the "older" images from your previous runs will still be out on disk -- they are external image files created for ODS HTML. If you want to have your storage "cleaned up" or these older files deleted, you will have to do the housekeeping yourself. (probably using an X command or a SYSTASK command -- since you have to delete operating system files.)

cynthia
GraphGuy
Meteorite | Level 14
One addition/clarification to what Cynthia is saying ...

This applies to all the graphs created during a single SAS invocation. If you exit out of SAS, and start a new SAS session, then the same png names are over-written, rather than getting a number appended to them.

I typically always run my SAS/Graph jobs in batch (ie, from the command line, such as using "sas foo.sas") rather than using the DMS or EG interface to SAS, and I find it convenient that it over-writes the files (rather than appending a number to the filename). Of course, "your mileage may vary" 🙂
Cynthia_sas
SAS Super FREQ
Thanks, Rob! I did mean to include that disclaimer/clarification.

I do use your batch technique and it is a handy way to run programs. My other approach is to make a dedicated output folder for graph images and ODS output files. Then, anything I want to save permanently, email or use in a paper I roll out of that folder to another location and then I delete everything in the folder and start fresh with a new SAS session.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 857 views
  • 0 likes
  • 4 in conversation