BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
pink_poodle
Barite | Level 11

Hi,

I was trying to change an axis on proc life test KM plot, and I ran this code from another post:

proc template;

 define statgraph Stat.Lifetest.Graphics.ProductLimitSurvival; 
  begingraph;
   layout overlay /
    /*xaxisopts=(label="Incidence of DM" linearopts=(viewmin=0.5 viewmax=1 tickvaluelist=(0.5 0.6 0.7 0.8 0.9 1.0)));*/
	yaxisopts=(label="Incidence of DM" linearopts=(viewmin=0 viewmax=120 tickvaluelist=(20 40 60 80 100 120)));
   endlayout;
  endgraph;
 end;
run;
Now my proc lifetest does not work as it used to, tells me there is not enough data for this graph even though the dataset is the same and it worked before. Please advice how to reverse this/ come back to previous settings.
Many thanks!
1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

@pink_poodle Given you've got an environment where things work and to test the theory that the issue is with template Stat.Lifetest.Graphics.ProductLimitSurvival you could do the following:

 

On the environment/computer where things work:

1. Export the template definition from your working environment to a file

%let source_code=c:\temp\ProductLimitSurvival.sas;
proc template;
  source Stat.Lifetest.Graphics.ProductLimitSurvival 
    /file="&source_code"
    ;
run;

 

On the environment/computer where things don't work:

2. Store the file with the template definition to a places where it's accessible from your SAS session.

3. Create a new SAS session.

4. Add a new SAS Session specific item store at the beginning of the template search path and compile the template into there

%let source_code=c:\temp\ProductLimitSurvival.sas;

ods path reset;
ods path show;

/* add work.mystore at beginning of item store search path */
ods path (prepend) work.mystore(update);
ods path show; 

/* create item Stat.Lifetest.Graphics.ProductLimitSurvival in item store work.mystore */
proc template;
  %include "&source_code" /source2;
run;

/* list newly created item */
proc template;
   list Stat.Lifetest.Graphics / store=work.mystore;
run;

Patrick_0-1699754483411.png

5. Execute your proc life test code. If it still shows the same error then the issue you observe is not related to Stat.Lifetest.Graphics.ProductLimitSurvival

View solution in original post

8 REPLIES 8
Patrick
Opal | Level 21

I've never touched this template in my environment and though the attached file should reflect otb code.

%put &=syshostinfolong;
%put &=sysvlong;

proc template;
  source Stat.Lifetest.Graphics.ProductLimitSurvival 
    /file="c:\temp\ProductLimitSurvival.sas"
    ;
run;
28 %put &=syshostinfolong;
SYSHOSTINFOLONG=X64_10PRO WIN 10.0.19041 Workstation
29 %put &=sysvlong;
SYSVLONG=9.04.01M7P080520
30
31 proc template;
32 source Stat.Lifetest.Graphics.ProductLimitSurvival
33 /file="c:\temp\ProductLimitSurvival.sas"
34 ;
NOTE: Path 'Stat.Lifetest.Graphics.ProductLimitSurvival' is in: SASHELP.TMPLSTAT_EN (via SASHELP.TMPLMST).
35 run;
NOTE: PROCEDURE TEMPLATE used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
pink_poodle
Barite | Level 11
Could you please give more details what is otb code and what it is for?
Reeza
Super User
OTB is "Out of the Box", so you can run the code posted to recreate the original template.
pink_poodle
Barite | Level 11
I ran this otb code. However, my proc lifetest is still giving me an error which it does not give on another computer where I did not run proc template.
Patrick
Opal | Level 21

Ensure that you create a new SAS session in order to avoid any impact from "leftovers". 

If things on your two computers still work differently then extract the template from your other computer (using the code I've shared) and compare it to the one from your machine where you're encountering issues. This to ensure the two templates are really the same.

WarrenKuhfeld
Ammonite | Level 13
proc template;
delete Stat.Lifetest.Graphics.ProductLimitSurvival /
store=sasuser.templat;
delete Stat.Lifetest.Graphics.ProductLimitSurvival2 /
store=sasuser.templat;
run;

 

Assuming you modified templates in sasuser, try to delete them using the code above.

 

Everything you ever wanted to know about modifying the KM plot is here:

https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf

pink_poodle
Barite | Level 11
@WarrenKuhfeld,
This is a great idea, but gave me another error that lock is not available on sas.templat.itemstore.
Patrick
Opal | Level 21

@pink_poodle Given you've got an environment where things work and to test the theory that the issue is with template Stat.Lifetest.Graphics.ProductLimitSurvival you could do the following:

 

On the environment/computer where things work:

1. Export the template definition from your working environment to a file

%let source_code=c:\temp\ProductLimitSurvival.sas;
proc template;
  source Stat.Lifetest.Graphics.ProductLimitSurvival 
    /file="&source_code"
    ;
run;

 

On the environment/computer where things don't work:

2. Store the file with the template definition to a places where it's accessible from your SAS session.

3. Create a new SAS session.

4. Add a new SAS Session specific item store at the beginning of the template search path and compile the template into there

%let source_code=c:\temp\ProductLimitSurvival.sas;

ods path reset;
ods path show;

/* add work.mystore at beginning of item store search path */
ods path (prepend) work.mystore(update);
ods path show; 

/* create item Stat.Lifetest.Graphics.ProductLimitSurvival in item store work.mystore */
proc template;
  %include "&source_code" /source2;
run;

/* list newly created item */
proc template;
   list Stat.Lifetest.Graphics / store=work.mystore;
run;

Patrick_0-1699754483411.png

5. Execute your proc life test code. If it still shows the same error then the issue you observe is not related to Stat.Lifetest.Graphics.ProductLimitSurvival

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 8 replies
  • 1295 views
  • 5 likes
  • 4 in conversation