08-20-2015 05:30 AM
Thankfully I only had minimal contact with pre-template graphs. There is a big difference in what is generated. Behind the scens of an sgplot call is the definition of a Template. This is in the form of a graph template. Data is then fed into the template. You can write these yourself and store them in catalogs if needed:
define statgraph <title>;
You can get the template code from the sgplot by using the tmplout="..." option to store the text to a file.
As a side note, please use consistent casing and indentation in code, makes it so much easier to read (and also I am not sure your code would run without proper spacing):
proc sgplot data=sashelp.class;
scatter x=height y=weight;
08-20-2015 07:41 AM
I don't think so. The SG procedures use ODS graphics. You can save the output to a bunch of destinations such as PNG, PDF, RTF, etc, but I don't think you can create an old-style graphics catalog entry.
08-20-2015 08:13 AM
I assume that is the case.
I learned however, that it's possible to create an old-style catalog entry out of a PNG-figure with the GSLIDE procedure and IBACK= and GOUT= option.
GOPTIONS IBACK="path\graph.png" IMAGESTYLE=FIT;
PROC GSLIDE GOUT = <catalog entry name>;
08-20-2015 08:24 AM
May I ask, why do you need this "catalog" entry? Personally I would avoid anything "catalog" orientated as historical. You can have the template as a plain text file, your code as a plain text file, and your data as a dataset (or plain csv if you want to go completely non-prop). No hidden things, no trying to track down catlogs, or working out how to get information out of them etc.
08-20-2015 12:11 PM
Unless you are creating the graphics for specific output to a specialized printer, code like Target= and interesting GDEVICE settings, it may be time to talk to the users of the output. There are enough additional features available in the SG procedures as well as having output to RTF, PDF and other easier to read and manipulate formats that it could be worth changing over completely.