At a minimum, consider reducing the amount of SAS code, by converting your series of CALL EXECUTE commands to a DATA step with a DO / END loop, and having DATALINES; coded with your series of commands imbedded instream ; read up the input with an INPUT statement in your DATA step. And to substitute your "variable information", use a special character string like $mydir$ which you would reference in a SAS assignment statement, as shown below:
%let _mydir_ = /yada/yada/yada;
DATA _NULL_;
INFILE DATALINES TRUNCOVER;
LENGTH COMMAND $200;
INPUT COMMAND $CHAR200. ;
COMMAND = TRANWRD(COMMAND,'_mydir_',"&_mydir_");
* UNCOMMENT LINE BELOW WHEN READY TO GO. ;
* CALL SYSTEM(COMMAND);
PUTLOG '>ECHO_COMMAND> ' COMMAND;
DATALINES;
rm _mydir_
mkdir _mydir_
...whatever other commands needed...
RUN;
Scott Barry
SBBWorks, Inc.