Data visualization with SAS programming

escapechar conflicting with chart titles

Reply
Contributor
Posts: 47

escapechar conflicting with chart titles

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;
SAS Super FREQ
Posts: 864

Re: escapechar conflicting with chart titles

Hey Sachin,

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

Thanks!
Dan
Contributor
Posts: 47

Re: escapechar conflicting with chart titles

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
SAS Super FREQ
Posts: 8,645

Re: escapechar conflicting with chart titles

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
SAS Employee
Posts: 963

Re: escapechar conflicting with chart titles

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" :-)
SAS Super FREQ
Posts: 8,645

Re: escapechar conflicting with chart titles

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
Post a Question
Discussion Stats
  • 5 replies
  • 145 views
  • 0 likes
  • 4 in conversation