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

SAS 9.4 TS1M2, Windows 7 64 bit

 

Something has changed in the behavior of my SAS/Graph output to ODS HTML and I can't figure out what has changed. Perhaps you can point me in the right direction.

 

Previously, before this change in behavior, every graph I created would be sent (by default) to a catalog WORK.GSEG, or if I changed the default using the GOUT= option, for example, I could have the graphics written to catalog WORK.PAIGE. Now, the SAS/Graph output does not appear in any catalog, in fact WORK.GSEG is not created, nor is WORK.PAIGE created when I specifically request it to be created with the GOUT= option.

 

In addition, when I use the name= option on the plot statement, the previous behavior named the graphics output files (these are .png files) with whatever the name= option specified. Now, the graphics output files (the .png files) are created with the default names regardless of what I specify under name=, so if I use PROC GCHART, the output files are gchart.png, gchart1.png, etc.

 

Both before and after this change, the .html file, and the associated .png files, are created and can be viewed properly.

 

What's going on?

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

The SAS/GRAPH product (GPLOT, GCHART, etc.) uses device-based graphics that are written to a catalog and then replayed. The ODS GRAPHIC system (which is part of BASE SAS) uses template-based graphics, which do not use any catalogs for graphics. For procedures such as CAPABILITY, which can produce both kind of graphics, the graphics type it produces depends on whether the ODS GRAPHICS system is ON or not. By default, it is ON. If you want to see the device-based graphic from CAPABILITY, you need to turn off ODS GRAPHICS:

 

ods graphics off;

 

PROC SGPLOT will produce ODS GRAPHICS output regardless of this setting, since that is the only type of output it can produce.

 

Hope this helps!

Dan

 

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

As an example, take a look at this SAS code:

 

ods html file="report.html" path="&cdu\compare_chargeoffs" gpath="&cdu\compare_chargeoffs" style=sasweb;
proc gplot data=sashelp.class gout=paige;
    plot weight*height/name='oink';
run;
quit;

proc capability data=c.chargeoffs2 gout=paige;
    comphistogram originationyear/class=tapeyear name='spedc';
run;

proc sgplot data=c.chargeoffs2 ;
    scatter x=originationyear y=ltv/name='sss';
run;
ods html close;

The first PROC GPLOT on SASHELP.CLASS works exactly as it should, the plot is written to catalog PAIGE, and is named oink.

 

 

Next, PROC CAPABILITY is run on real data, and nothing is written to catalog PAIGE, and the .png file created is not named spedc.png, it is named histogram.png.

 

Next, PROC SGPLOT is run on real data, and nothing is written to catalog PAIGE, and the .png file created is not named sss.png, it is named sgplot.png.

 

You can see I haven't changed any options along the way.


Also, the SASLOG after PROC GPLOT contains

 

NOTE: 16217 bytes written to c:\users\eccrpm0\documents\compare_chargeoffs\oink.png.

as it should. The SASLOG after PROC CAPABILITY and PROC SGPLOT do not contain a similar line.

 

--
Paige Miller
DanH_sas
SAS Super FREQ

The SAS/GRAPH product (GPLOT, GCHART, etc.) uses device-based graphics that are written to a catalog and then replayed. The ODS GRAPHIC system (which is part of BASE SAS) uses template-based graphics, which do not use any catalogs for graphics. For procedures such as CAPABILITY, which can produce both kind of graphics, the graphics type it produces depends on whether the ODS GRAPHICS system is ON or not. By default, it is ON. If you want to see the device-based graphic from CAPABILITY, you need to turn off ODS GRAPHICS:

 

ods graphics off;

 

PROC SGPLOT will produce ODS GRAPHICS output regardless of this setting, since that is the only type of output it can produce.

 

Hope this helps!

Dan

 

PaigeMiller
Diamond | Level 26

Yes, thanks @DanH_sas, I came to same conclusion a few days after I posted this.

--
Paige Miller

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