BookmarkSubscribeRSS Feed
dandip
Fluorite | Level 6

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

9 REPLIES 9
WarrenKuhfeld
Ammonite | Level 13

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.

dandip
Fluorite | Level 6

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;
WarrenKuhfeld
Ammonite | Level 13

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.

dandip
Fluorite | Level 6

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

 

Best wishes,

Dan

WarrenKuhfeld
Ammonite | Level 13

Jeff is the guy you got the code from.  

dandip
Fluorite | Level 6
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.
dandip
Fluorite | Level 6

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.

WarrenKuhfeld
Ammonite | Level 13

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.

 

 

dandip
Fluorite | Level 6
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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 2144 views
  • 4 likes
  • 2 in conversation