Data visualization with SAS programming

Boxplot Statement in SAS GTL and the output data set

Accepted Solution Solved
Reply
Contributor
Posts: 39
Accepted Solution

Boxplot Statement in SAS GTL and the output data set

Hi, so I am producing a box plot in SAS 9.4 using the GTL method. The output works perfectly and all is fine, other than I need a permanent data set. I can see each time the plot runs 3 data sets get produced, one of which contains the summary statistics, such as the mean, median, etc. I need this data sets stored permenantly, however it seems the name of this data set are very random, is there a way to determine or define the datasets name, so i can store the summary data set. Currenlty it is called

 

_DOCTMP000000000000000000000000000564

 

Which isnt much use.

 

Thanks in advance.


Accepted Solutions
Solution
‎11-13-2015 10:29 AM
SAS Super FREQ
Posts: 890

Re: Boxplot Statement in SAS GTL and the output data set

I'm assuming you are writing the GTL and using PROC SGRENDER to render the template with your data. The best way to get the computed data is to use the ODS OUTPUT statement right before the PROC SGRENDER invocation. Assuming you want a data set called "boxdata.sas7bdat":

 

ods output sgrender=boxdata;

proc sgrender data=whatever template=boxtmpl; run;

proc print data=boxdata; run; /* in case you want to see it in table output */

 

You can use a libname other than the default "work" to store it permanently.

 

Hope this helps!

Dan

View solution in original post


All Replies
Solution
‎11-13-2015 10:29 AM
SAS Super FREQ
Posts: 890

Re: Boxplot Statement in SAS GTL and the output data set

I'm assuming you are writing the GTL and using PROC SGRENDER to render the template with your data. The best way to get the computed data is to use the ODS OUTPUT statement right before the PROC SGRENDER invocation. Assuming you want a data set called "boxdata.sas7bdat":

 

ods output sgrender=boxdata;

proc sgrender data=whatever template=boxtmpl; run;

proc print data=boxdata; run; /* in case you want to see it in table output */

 

You can use a libname other than the default "work" to store it permanently.

 

Hope this helps!

Dan

Contributor
Posts: 39

Re: Boxplot Statement in SAS GTL and the output data set

[ Edited ]
ods listing close; 
ods rtf file = "&figure.\&outname..rtf" style = tfl headery=800 footery=345 author="&sysuserid"; ods graphics / reset imagefmt = png; ods output sgrender = boxdata;

proc sgrender
data = adlb (where = (paramn = &i.))
template = layoutoverlay;
** Define the dynamic labels;
dynamic xlabel = "Visit"
ylabel = "&param.";
run;


ods rtf close;
ods listing;

Hi Dan, thanks for your suggestion, yes am using GTL and PROC SGRENDER. It looks like what you are trying to say is what I want, above is my new code, when I run it I am met with a warining:

 

WARNING: Output 'sgrender' was not created. Make sure that the output object name, label, or path is spelled
correctly. Also, verify that the appropriate procedure options are used to produce the requested
output object. For example, verify that the NOPRINT option is not used.

 

 

I am running SAS EG

Contributor
Posts: 39

Re: Boxplot Statement in SAS GTL and the output data set

Oh wait I got it, you clearlly said "right before the SGRENDER". I had a bit of code between the two.

 

Thanks Dan

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 429 views
  • 1 like
  • 2 in conversation