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.
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.
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;
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.
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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.