But first lets talk a bit about a sample folder hierarchy for storing project code. I like to have a parent directory for projects/applications. As a consultant, typically I deal with projects and so I will have a structure like:
- /Projects/ProjectA
- /Projects/ProjectB
- . . .
- /Projects/Tools
One simple way of pointing to the macro library is to include a statement like:
options sasautos=("/Projects/&Project/Macros"
"/Projects/Tools/Macros"
sasautos);
where the macro variable Project is defined as a parameter to the runMacro Stored Process. This code concatenates my Project specific autocall macro library, with my generic Tools macro and then the SAS supplied autocall macros.
So the complete Stored Process source is:
options sasautos=("/Projects/&Project/Macros"
"/Projects/Tools/Macros"
sasautos);
*ProcessBody;
%stpBegin;
%put NOTE: Execute macro ¯oToRun..;
%¯oToRun
%stpEnd;
In my next post, I will address some packaging options so that I can reuse this same source for multiple projects.
And, BTW, did you notice I used the forward slash (/) in my file paths? That is because it works on both Unix and Windows, thus allowing the code to be migrated across environments more easily.
No comments:
Post a Comment