![]() |
Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
|
Creates an batch spk export command. More...
Go to the source code of this file.
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.
Usage:
%* import the macros (or make them available some other way); filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas"; %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";'; run; filename myref "%sysfunc(pathname(work))/mmxexport.sh"; %mm_spkexport(metaloc=%str(/my/meta/loc) ,outref=myref ,secureref=tmp ,cmdoutloc=%str(/tmp) )
Alternatively, call without inputs to create a function style output
filename myref "/tmp/mmscript.sh"; %mm_spkexport(metaloc=%str(/my/meta/loc) outref=myref ,cmdoutloc=%str(/tmp) ,cmdoutname=mmx )
You can then navigate and execute as follows:
cd /tmp ./mmscript.sh "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) |
Definition in file mm_spkexport.sas.