01-12-2018 10:55 AM
I am currently looking for a way to automate the capturing of a SAS Package (at the SASFolders level), to perform regularly schedule backups/exports of the SAS VA materials that we have generated. I have done little research that points to using the SAS Batch Export & Import tool...is this where I am needing to start? Does anyone have any experience using this?
01-12-2018 11:38 AM - edited 01-12-2018 11:49 AM
Yes, the batch export tools are what you need. So long as you have X command enabled, you can export from SAS. I previously made a stackoverflow post for exporting items individually (rather than at folder level), I've just quickly modified it to suit your needs.. Please note - this code is untested!
%let connx_string= -host YOURHOST -port 8561 -user YOURUSER -password YOURPASS;
/* get location of BatchExport metadata tool */ /*http://support.sas.com/documentation/cdl/en/bisag/64088 /HTML/default/viewer.htm#a003261084.htm*/ data _null_; h="%sysget(SASROOT)"; h2=substr(h,1,index(h,"SASFoundation")-2); call symputx("platform_object_path" ,cats(h2,"/SASPlatformObjectFramework/&sysver")); run; %put Batch tool located at: &platform_object_path; data _null_; infile "C: & cd ""&platform_object_path"" %trim( ) & ExportPackage &connx_string %trim( )-package ""/location/to/save/your.spk"" %trim( )-objects ""/your/sas/meta/path"" %trim( )-log ""/location/to/save/your.log"" 2>&1" pipe lrecl=1000; input; list; run;
Here is the link to the documentation. Be aware that if you are on windows, and you are going to use this approach to build a very long command, there is a weird bug (not a SAS bug) that will somehow remove one of your characters! See here.
01-16-2018 01:36 AM