Data visualization with SAS programming

PROC DOCUMENT not replaying graphs from SGRENDER correctly

Reply
Occasional Contributor
Posts: 9

PROC DOCUMENT not replaying graphs from SGRENDER correctly

I've found a nice macro from Meyers at Mayo Clinic that generates KM plots.  I used the BMT dataset to generate KM plots, artificially creating 3 paramcd's.

 

The SGRENDERs generate just fine, but when replayed in proc document in the pdf file, the curves are correct, but the atrisk numbers and other annotated text are the same for each graph.   The code is in the sas file attached, with the macro call and ods creation at line 6023.   the 3 sgrenders.png, one for each parameter, are also attached, which are generated correctly, but the pdf file, only the last page is correct.  The other pages have text equal to the last page. 

 

I searched through this board and found no other similar issues.

 

Thanks

Attachment
Attachment
SAS Super FREQ
Posts: 470

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

This question is in an area that I know, but I do not have time to look at it now.  I do see a section of code entitled "Move things around". My first guess is to investigate that.

SAS/STAT, SAS/ETS, SAS/QC, SAS/OR, SAS/IML, and many other products use our internal documentation system that relies heavily on the ODS document to display results. I have never seen the problem you describe.

Occasional Contributor
Posts: 9

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

Posted in reply to WarrenKuhfeld

Thanks.  that's only to move all the graphs into the same directory for replay later.  Had always done this in the past without issue, at least with proc reports or prints.

 

by the way, i sent up the wrong sas program.  There was a missing semi colon:

 

 

*==========================================================================
*  Master list of parmcds
*==========================================================================;

proc freq data=dummy noprint;
	tables paramcd	/ out=parms;
run;
Attachment
SAS Super FREQ
Posts: 470

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

I am back, and I looked at it.  There is just too much here for me to digest in the time that I can spend on this.  Perhaps the best thing to do is ask Jeff directly.  Or maybe someone else can help. Sorry that I can't be more help.

Occasional Contributor
Posts: 9

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

Posted in reply to WarrenKuhfeld

Thanks Warren - don't know who Jeff is, but anybody who might see this on the web, feel free to post.

 

Best wishes,

Dan

SAS Super FREQ
Posts: 470

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

Jeff is the guy you got the code from.  

Occasional Contributor
Posts: 9

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

Posted in reply to WarrenKuhfeld
gotcha. Actually, I don't think the problem is the macro newsurv. the pngs are generated just fine after each macro call. I think the offending issue is the PROC DOCUMENT call.
Occasional Contributor
Posts: 9

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

Warren, all,

I think I have an answer - don't know if this is covered in your documentation.

 

Below I have 2 programs, warrengood and warrenbad.   In the warrengood program, each time the program cycles through the macro, the template is redefined, based on the data.   It's a quite simple code based on the sashelp.class dataset.

 

In warrenbad, I have the same template.

 

Run this yourself - you'll see warrenbad creates the png files correctly, but when proc document runs, the text in layout gridded stays the same between the two graphs.  In warrengood, the png files are correct, and the pdf file correctly shows the text in layout gridded on each page.

 

I think there's something amiss in the document run.

 

Thanks again; if you've got something to which you can point me to tell me I'm going wrong, please advise.

 

Dan.

Attachment
Attachment
SAS Super FREQ
Posts: 470

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

The ODS document does not store the template.  It uses the template.  So if you are making custom templates with macro variables, then you do need to ensure that the names are different or that you are somehow ensuring that the right template is available when the replay occurs.


We have seen that in our advanced analytics documentation system.  I have written macros that create a template on the fly then delete it (seemed like good housekeeping).  That approach does not work in our documentation system when the output is replayed via PROC DOCUMENT, because the template is gone when it is needed later.


Glad you were able to solve it yourself!  I am a bit swamped right now.

 

 

Occasional Contributor
Posts: 9

Re: PROC DOCUMENT not replaying graphs from SGRENDER correctly

Posted in reply to WarrenKuhfeld
Thanks again. BTW - if the template was written as a stored template, and we tried to use a dynamic template, then the whole thing would've failed. But it's not costly to run as is.

Best wishes,

Dan.
Ask a Question
Discussion stats
  • 9 replies
  • 135 views
  • 4 likes
  • 2 in conversation