BookmarkSubscribeRSS Feed
DMMD
Obsidian | Level 7

Hi everyone!

 

I need assistance with a bizarre situation.

 

I have experimented with Kaplan-Meier curves before, but am attempting to learn survival analysis properly by going through the UCLA tutorial: https://stats.idre.ucla.edu/sas/seminars/sas-survival/

 

After downloading the whas500 dataset from the UCLA tutorial, I followed the instructions and reproduced each graphic correctly until section 1.2.3. For that section, I entered the following code, as specified:

 

proc lifetest data= survival.whas500 (where=(fstat=1)) plots=survival(atrisk);
    time lenfol*fstat(0);
run; quit;

 

Instead of producing the output shown in the tutorial, familiar data from back when I originally experimented with Kaplan-Meier curves (nearly one year ago) appeared. How is this data randomly showing up nearly a year later without any deliberate referencing?

 

Thank you for helping!

9 REPLIES 9
WarrenKuhfeld
Ammonite | Level 13

PNG, HTML, RTF, etc files can stick around until you delete them.  You are probably looking at an old results file.  SAS procedures do not randomly use old data.  

 

If you are interested in ways to customize the KM plot, check out this.

 

http://support.sas.com/documentation/onlinedoc/stat/142/kaplan.pdf

DMMD
Obsidian | Level 7

I am not even remotely using the same folders (for both permanent and temporary files) as before. How do I delete these PNG, HTML, RTF files you reference?

Reeza
Super User

Were you attempting to modify the templates? If so, it's possible you inadvertently permanently replaced the templates and hardcoded references in those.

 


@DMMD wrote:

Hi everyone!

 

I need assistance with a bizarre situation.

 

I have experimented with Kaplan-Meier curves before, but am attempting to learn survival analysis properly by going through the UCLA tutorial: https://stats.idre.ucla.edu/sas/seminars/sas-survival/

 

After downloading the whas500 dataset from the UCLA tutorial, I followed the instructions and reproduced each graphic correctly until section 1.2.3. For that section, I entered the following code, as specified:

 

proc lifetest data= survival.whas500 (where=(fstat=1)) plots=survival(atrisk);
    time lenfol*fstat(0);
run; quit;

 

Instead of producing the output shown in the tutorial, familiar data from back when I originally experimented with Kaplan-Meier curves (nearly one year ago) appeared. How is this data randomly showing up nearly a year later without any deliberate referencing?

 

Thank you for helping!


 

DMMD
Obsidian | Level 7

I am not sure, but I suppose that is possible as my current code does not reference the previous dataset whatsoever. The previous dataset has a completely different libname, permanent files folder location, as well as temporary files folder location.

 

Is there a way to restore the default templates for Proc Lifetest? If so, could you show me how to execute that task?

 

Thank you.

Reeza
Super User

Not that I'm aware of, unfortunately. Last time I tried, I ended up using a colleagues and replacing mine. You may want to ask SAS tech support, though they may not be operational today due to Hurricane Florence. 

 

You need to have the correct version of SAS and the know which templates to modify. Why not check a few of yours first to see if that's happening?

 

Follow the instructions here to get them to a text file and then search for the data set name if you know it. These templates would be under SAS/STAT.

https://blogs.sas.com/content/graphicallyspeaking/2017/08/30/advanced-ods-graphics-examining-process...

WarrenKuhfeld
Ammonite | Level 13

 

Assuming you never modified the actual templates provided by SAS in SASHelp (never, ever do that), then this will delete the modified templates in SASUser. 

   ods path sashelp.tmplmst(read);
   proc datasets library=sasuser nolist; delete templat(memtype=itemstor); run;
   ods path sasuser.templat(update) sashelp.tmplmst(read);

In other words, never specify an access for sashelp.tmplmst  besides READ access.

 

Now all that said, the templates know nothing about your data sets. So if the problem is really that you are seeing old data, then I think you have to be looking at old results.  Either that or you are not getting your data from where you think you are.  You could use PROC CONTENTS to verify the contents of your data set.  I can't comment much more on what you are doing, because you have not provided any details.

 

DMMD
Obsidian | Level 7

Just for my knowledge, the code you provided clears all template modifications, correct? For example, if there were too many different templates malfunctioning to use ODS trace efficiently?

DMMD
Obsidian | Level 7

Thank you! It was a template issue. I found my old code... and did ODS trace to find the problematic template.

 

I ran the command:

proc template;

delete <template name>;

run;

 

Thank you all!

WarrenKuhfeld
Ammonite | Level 13

The code I provided deletes all templates in sasuser.  You could be modifying templates in all kinds of other ways that would not be deleted by this.  If you are using the default template path, and if you never make sashelp itemstore updatable, then it will clean out all modified templates.

 

I stand by my statement though that a modified template could not account for using old data, but perhaps you associated an old data set with an old template. I hope this helps.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 1905 views
  • 6 likes
  • 3 in conversation