Issue:
I have multiple SAS code file which I have to run sequentially. How to do that?Solution:
Create a shell script file to invoke the sasbatch.sh.
myprogram.sh:
#!/bin/bash
nohup /opt/sas/config/Lev1/SASApp/BatchServer/sasbatch.sh /home/sas/$1 -xcmd -nodms -log /home/sas/logs/$1.log -print /home/sas/listing/$1.lst &
In above command you need to change the path depending on your environment. For example: in your organization the sasbatch.sh file may be in different location.
Create SAS file to call your SAS program:
myprogram.sas:
filename src '/sas//programs';
filename src1 '/home/sas/';
%include src(autoexec.sas);
%include src1(first.sas);
%include src1(second.sas);
%include src1(third.sas);
In the above code, I have pointed filename statement to where my autoexec.sas and SAS programs are located. I have mentioned src as /sas/programs, it is the location where my autoexec.sas file present. I have mentioned src1 as /home/sas, it is the location where my three SAS files first.sas, second.sas and third.sas is present.
Now after this two files are created place them in same directory. Consider the directory we placed the two code is /tmp, in terminal (Putty) write following command.
cd /tmp
./myprogram.sh myprogram.sas
You will get a message saying nohup: appending output to `nohup.out'
Comments
Post a Comment