02-01-2018 02:21 PM
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.
02-01-2018 02:27 PM
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.
02-01-2018 02:37 PM
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;
02-01-2018 04:21 PM
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.
02-01-2018 04:25 PM
02-05-2018 04:13 PM
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.
02-05-2018 04:23 PM
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.
02-05-2018 04:46 PM