01-20-2015 11:33 AM
I've got several .sas files that I want to copy from one directory on the server to another. I've got code like below that works fine, but each time it opens up the command window and I have to type 'quit' in each window to get it to go to the next one.
%let fromdir = Dev ;
%let todir = Test ;
%sysexec copy "\\my_server\&FromDir\Program 1.sas" "\\my_server\&ToDir\Program 1.sas" /y ;
%sysexec copy "\\my_server\&FromDir\Program 2.sas" " \\My_server\&ToDir\Program 2.sas " /y ;
I'd be happy to create a .bat file to do this but I'm not convinced that I could get it to work. When I type the command at the command prompt it says that it cannot find the file specified. I've tried this with quotes and without quotes and with files without spaces in their names. I guess I could map a drive letter to the path that I need and get the copy command to work in a .bat file, but if there's another way to do it using SAS so that the command window doesn't open up and have to be closed each time, I'd appreciate your telling me.
Centers for Disease Control and Prevention
Need further help from the community? Please ask a new question.