01-14-2013 06:47 AM
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.
01-14-2013 10:37 AM
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).
01-14-2013 12:59 PM
Angela Hall has a nice summary of BI server autoexecs:
Maybe you want
? (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.
01-14-2013 02:10 PM
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.
01-15-2013 09:14 AM
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
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
WARNING: Apparent invocation of macro SETMMYY not resolved.
120 %PUT &mmm;
WARNING: Apparent invocation of macro SETMMYY not resolved
01-15-2013 09:51 AM
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:
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.