Production Ready Macros for SAS Application Developers File Reference

Creates an batch spk export command. More...

Go to the source code of this file.

Detailed Description

Creates a script that will export everything in a metadata folder to a specified location. If you have XCMD enabled, then you can use mmx_spkexport (which performs the actual export)

Note - the batch tools require a username and password. For security, these are expected to have been provided in a protected directory.


%* import the macros (or make them available some other way);
filename mc url "";
%inc mc;

%* create sample text file as input to the macro;
filename tmp temp;
data _null_;
  file tmp;
  put '%let mmxuser="sasdemo";';
  put '%let mmxpass="Mars321";';

filename myref "%sysfunc(pathname(work))/";

Alternatively, call without inputs to create a function style output

filename myref "/tmp/";

You can then navigate and execute as follows:

cd /tmp
./ "myuser" "mypass"


metaloc=the metadata folder to export
secureref=fileref containing the username / password (should point to a file in a secure location). Leave blank to substitute $bash type vars.
outref=fileref to which to write the command
cmdoutloc=the directory to which the command will write the SPK (default=WORK)
cmdoutname=the name of the spk / log files to create (will be identical just with .spk or .log extension)
Allan Bowe

Definition in file