BookmarkSubscribeRSS Feed
AndrewOS
Fluorite | Level 6

HI

 

I have a directory set up that contains user macros. I set this directory in my apperver_autoexe_usermods.sas file so it should be initialised at start up. However when I am working in Enterprise Guide I cannot call the marocs as the don't seem to have been loaded.

If I manually execute a macro I can then use it in my programs so it does not seem to be an issue with the code more a configuration issue.

Is there anything else that I need to set before I can use my macros.

6 REPLIES 6
Doc_Duke
Rhodochrosite | Level 12

That file name appears to be custom to your system; it does not show up on a Google search of SAS.  You may need to talk to your local admins.

As a workaround, you could include an options statement in your autoexec process flow in EGuide that includes the location in the SASAUTOS parameter (you can probably lift the code directly from apperver_autoexe_usermods.sas).

Doc Muhlbaier

Duke

Quentin
Super User

Hi,

Angela Hall has a nice summary of BI server autoexecs:

  http://blogs.sas.com/content/bi/2012/10/29/choosing_an_autoexec/

Maybe you want

  appserver_autoexec_usermods.sas

?  (note 'S' and 'C' are missing from your file name)

I haven't done much BI server admin.  Typically would think you would want to put this in a config file (defining an autocall library), rather than an autoexec that compiled the macro every time you start a session.

HTH,

--Q.


BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
SASKiwi
PROC Star

So what is the code you are using in your autoexec? Are you using the AUTOCALL approach to reading your macros? If so your AUTOEXEC should look something like this:

filename myautos 'c:\myautos directory';

options sasautos = (myautos, sasautos);

The other issue as already discussed is are you modifying the right AUTOEXEC? If you are running a 'standard' BI Server setup then it is the SASApp autoexec_usermods that means to be changed. See the link to Angela's blog above for more details. Also confirm that EG is using SASApp - see in server list.

We successfully use this approach ourselves and it works fine for EG, batch jobs, WRS - in fact all SAS jobs.

AndrewOS
Fluorite | Level 6

 

Hi

I am not using BI. I have a program that is run through a batch process and which I edit in Enterprise Guide. Neither are using my macros.

My E:\SAS\Config\Lev1\SASApp\appserver_autoexec_usermods.sas has the following code.

filename SLmacros "F:\Prod\SASAUTOS";
options sasautos=( SLmacros, SASMACRO);

And my E:\SAS\Config\Lev1\SASApp\appserver_autoexec.sas

Has

%include "E:\SAS\Config\Lev1\SASApp\appserver_autoexec_usermods.sas";.

I have also tried using the code below within the program itself but this still does not work.
 
%INCLUDE 'E:\SAS\Config\Lev1\SASApp\appserver_autoexec.sas'; run;

Log entries are below

 
119 %LET mmm = %SetMMYY;
WARNING: No logical assign for filename SASMACRO.
WARNING: Source level autocall is not found or cannot be opened. Autocall has been suspended and
OPTION NOMAUTOSOURCE has been set. To use the autocall facility again, set OPTION
MAUTOSOURCE.
WARNING: Apparent invocation of macro SETMMYY not resolved.
120 %PUT &mmm;
WARNING: Apparent invocation of macro SETMMYY not resolved

Quentin
Super User

Hi,

Can you describe a little bit more of your setup?

You're using EG.

When you run EG, you could be connecting to a local server (i.e. SAS installed on your PC), or an SAS application server (installed on a unix/linux/windows/etc server).

If you have a unix/linux server, you need to point to the autocall directory using the unix/linux path, not a windows path.

Looks like maybe the problem is that you specified a fileref named "SASMACRO", which doesn't exist.

Assuming you are on a Windows server, then I think below should work (note I removed the comma, and changed SASMACRO to sasautos).

filename SLmacros "F:\Prod\SASAUTOS";
options sasautos=( SLmacros sasautos);  /*removed comma!*/

To check whether the SASAUTOS is set appropriately, you can start a new EG session, and try:

  %put %sysfunc(getoption(sasautos));


And another check would be to try to load the macro by:

  %inc "F:\Prod\SASAUTOS\setmmyy.sas" ;

If that %include won't work, it means SAS is not seeing the file with the macro definition.

HTH,

--Q.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
AndrewOS
Fluorite | Level 6


Hi

Used your code provided changing SASMACRO to sasautos and it worked.

Thank you .

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 2525 views
  • 1 like
  • 4 in conversation