BookmarkSubscribeRSS Feed
egwilliamson
Obsidian | Level 7

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?

 

Regards,

2 REPLIES 2
AllanBowe
Barite | Level 11

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;
options noquotelenmax;
/* 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.

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
Anand_V
Ammonite | Level 13
Hi @egwilliamson,

You can use the Batch Import tool from command line of server as well. Just that it can be very long depending upon the Number of objects you have for export.

You can find more details about the syntax and procedure on the SAS Intelligence Platform system admin guide chapter "Using the Batch Export and Import tools".

Hope this helps.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1038 views
  • 3 likes
  • 3 in conversation