Hi There,
I have a SAS program that is generating a csv report file and writing it to one of the work directory on server. I want the created file to be copied or moved over to another directory on server. For this I added following lines of code to my existing code but it errors out with error message saying "Shell escape is not valid in this SAS session".
%let dir1="%sysfunc(pathname(work))/FileName..csv";
%let dir2="//FileServerName/Dir1/XYZ/Reports/";
%sysexec move "&dir1" "&dir2";
Any other work around/ suggestions are most welcome.
Thanks in advance.
FCOPY and/or PROC DOWNLOAD.
Yes, it's common for server side installations to restrict access to the OS, and using OS commands, which is your current approach.
FCOPY uses SAS built in tools.
But if your SAS has access to the directory, you should be able to export directly to there in the first place?
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.