BookmarkSubscribeRSS Feed
Natalie
Calcite | Level 5

I should have specified my question precisely. Can I write out a Catalogue Entry (GRSEG) with a SG procedure?

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

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:

proc template;

  define statgraph <title>;

    begingraph;

...

    endgraph;

  end;

run;

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;

run;

Rick_SAS
SAS Super FREQ

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.

Natalie
Calcite | Level 5

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>;

QUIT;RUN;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Natalie
Calcite | Level 5

Good question. It's currently the default setting for the figure output in our reporting system.

ballardw
Super User

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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1857 views
  • 0 likes
  • 4 in conversation