BookmarkSubscribeRSS Feed
Elliott
Obsidian | Level 7

I am getting am getting this error when I execute my code from unix command line,  It runs fine when executing in SAS Enterprise Guide.  How can I resolve this.  Our report all execute from the command line.  Thanks, Cindy

74        proc template;

475        define style styles.XLsansPrinter;

476 parent = styles.sansPrinter;

477 style header from header /

478 font_face = "Arial, Helvetica"

479 font_size = 10pt

480 font_weight = bold

481 font_style = roman

482 foreground = cx000000

483 background = #99ccff

484 just = center

485 vjust = bottom;

486 end;

ERROR: Template 'Styles.XLsansPrinter' was unable to write to template store!

487 run;

NOTE: PROCEDURE TEMPLATE used (Total process time):

real time           0.02 seconds

cpu time            0.02 seconds

    

WARNING: Errors were produced.

NOTE: The SAS System stopped processing this step because of errors.

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi, Generally, in Enterprise Guide, you have write access to SASUSER.TEMPLAT, which is automatically available for writing templates. However, in a server configuration, it is possible that the way you invoke SAS from the command line is routing you to a configuration where the SASUSER library is not available for WRITE access. The ODS PATH statement allows you to declare a location for the changed template and then you can also use STORE= to direct the template to a specific location where you know you have write access (if for example, you have more than one template store with write access). For example:

libname main '/user/bin/main/stuff';

libname bkup '/user/bin/bkup/morestuff';

ods path main.templat(update) bkup.templat(update) sashelp.tmplmst(read);

*** proc template code;

*** other code;

In this instance, without STORE=, the changed template would get written to the MAIN.TEMPLAT item store because it is listed first in the list. But with STORE= and 2 write-able item stores in the path, then you could direct your changed template to BKUP.TEMPLAT, if you wanted. Most people only have the default to start with, which usually is:

sasuser.templat(update) sashelp.tmplmst(read) -- but if your server SAS doesn't allow you write access to SASUSER (which might happen because in batch mode, you really don't need SASUSER), then taking control with an ODS PATH statement might be required.

And, of course, you will probably have to work with someone to get a location with write access and get the folder name correct for the LIBNAME statement.

BTW, never, ever, ever, ever, ever, ever, ever, ever define SASHELP.TMPLMST with any access other than READ -- you do not want to clobber the SAS-defined templates.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1 reply
  • 1204 views
  • 0 likes
  • 2 in conversation