Data visualization with SAS programming

SurfaceplotParm - unable to find template

Reply
N/A
Posts: 1

SurfaceplotParm - unable to find template

I am trying to run "surfaceplotparm" per the SAS documentation but get this error message:

ERROR: Unable to restore 'surfaceplotparm' from template store!

Does anyone have any ideas?

I have already tried to troubleshoot this some and do not have
SASUSER.TEMPLAT
SASHELP.TMPLMST
when I navigate in the explorer. However, I do seem to have the appropriate "sas item stores" but don't know how to add them.

Thanks! Amanda
SAS Super FREQ
Posts: 8,643

Re: SurfaceplotParm - unable to find template

Hi:
Generally, you will NOT see template item stores when you look in SASHELP or SASUSER in the SAS Explorer window. You must either use the Template Browser or if you are submitting code in batch or through SAS Enterprise Guide, you must use PROC TEMPLATE code.

To open the Template Browser, you must be in an interactive SAS session, such as you have with SAS Display Manager. But the PROC TEMPLATE code method should work anywhere -- interactive mode or batch mode.

For example, if you try this code:
[pre]
ods path sasuser.templat(update)
sashelp.tmplmst(read);

proc template;
list / store=sasuser.templat;
list styles / store=sashelp.tmplmst;
run;
[/pre]

you should see the list of ALL updated templates that are stored in SASUSER.TEMPLAT and a list of all the production STYLE templates from SASHELP.TMPLMST.

When I run the surfaceplotparm example from this site:
http://support.sas.com/documentation/cdl/en/grstatgraph/63878/HTML/default/viewer.htm#/documentation...

I do get the expected results with no error messages. However, I preceded my job with the following ODS PATH statement:
[pre]
ods path sasuser.templat(update)
sashelp.tmplmst(read);
[/pre]

That ODS PATH statement instructed PROC TEMPLATE to store the "new" graph template into SASUSER.TEMPLAT (the "user's" item store for updated templates). If, however, I log off and log back on and do NOT issue the same ODS PATH statement, ODS might not find my graph template in SASUSER.TEMPLAT...depending on the ODS PATH that is active when I log on. I can duplicate your error message by explicitly removing SASUSER.TEMPLAT from the search path (as shown in the SAS Log below):
[pre]
57 ods path sashelp.tmplmst(read);
58
59
60 proc sgrender data=gridded template=mygraf;
61 run;

ERROR: Unable to restore 'mygraf' from template store!
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 10201 observations read from the data set
WORK.GRIDDED.
NOTE: PROCEDURE SGRENDER used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
[/pre]

The program at the end of this post was taken from the above web site on the use of SURFACEPLOTPARM. The code example uses ODS PATH syntax to explicitly establish a search and update path for ODS to write updated templates. At the very end of the program is the code that created the above error message. Note that all I had to do to generate the error message was to remove SASUSER.TEMPLAT from the ODS PATH search and update list.

cynthia
[pre]
** Make data using example for surfaceplotparm;
data nums;
do i=1 to 30;
X=10*ranuni(33)-5;
Y=10*ranuni(35)-5;
Z=sin(sqrt(x*x+y*y));
output;
end;
run;

proc g3grid data=nums out=gridded;
grid y*x=z / spline
axis1=-5 to 5 by .1
axis2=-5 to 5 by .1;
run;

proc sort data=gridded; by y x; run;

** Now create template MYGRAF;
** Make sure that SASUSER.TEMPLAT is in the ODS PATH search list;
ods path sasuser.templat(update)
sashelp.tmplmst(read);

proc template;
define statgraph mygraf;
begingraph;
entrytitle "Spline Interpolation";
layout overlay3d;
surfaceplotparm x=x y=y z=z /
surfacetype=fill;
endlayout;
endgraph;
end;
run;

** Now, create output from the graph template;
proc sgrender data=gridded template=mygraf;
run;

** Make error message appear by removing SASUSER.TEMPLAT from ODS PATH;
ods path sashelp.tmplmst(read);

proc sgrender data=gridded template=mygraf;
run;
[/pre]
Post a Question
Discussion Stats
  • 1 reply
  • 288 views
  • 0 likes
  • 2 in conversation