Macros for SAS Application Developers
No Matches File Reference

Returns the appLoc from the _program variable. More...

Go to the source code of this file.

Detailed Description

When working with SASjs apps, web services / tests / jobs are always deployed to a root (app) location in the SAS logical folder tree.

When building apps for use in other environments, you do not necessarily know where the backend services will be deployed. Therefore a function like this is handy in order to dynamically figure out the appLoc, and enable other services to be connected by a relative reference.

SASjs apps always have the same immediate substructure (one or more of the following):

  • /data
  • /jobs
  • /services
  • /tests
  • /tests/jobs
  • /tests/services
  • /tests/macros

This function works by testing for the existence of any of the above in the automatic _program variable, and returning the part to the left of it.


%put %mf_getapploc(&_program)

%put %mf_getapploc(/some/location/services/admin/myservice);
%put %mf_getapploc(/some/location/jobs/extract/somejob/);
%put %mf_getapploc(/some/location/tests/jobs/somejob/);
[in]pgmThe _program value from which to extract the appLoc
Allan Bowe

Definition in file