| Date: | Wed, 5 Mar 2008 18:34:06 +0530 |
| Reply-To: | Surajit Das <surajit.das@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Surajit Das <surajit.das@GMAIL.COM> |
| Subject: | Re: Shell Script to run multiple SAS codes |
|
| Content-Type: | text/plain; format=flowed; charset="iso-8859-1";
reply-type=original |
Kunal,
A single sas program with use of syscc should be able to do the job. The
following with a little tweaking here and there should work. You can search
for syscc in sas-L for more elegant solutions.
%macro allprogram();
%include test
%let status = &syscc.;
%if &status < 4 %then %do;
%include test1.sas;
%let status_1 = &syscc;
/* Can have comment or end sas here */
%end;
%if &status_1 < 4 %then %do;
%include test2.sas;
%let status_2 = &syscc;
/* Can have comment or end sas here */
%end;
%mend;
%allprogram;
----- Original Message -----
From: "Kunal Kelkar" <mailtokunalkelkar@GMAIL.COM>
To: <SAS-L@LISTSERV.UGA.EDU>
Sent: Wednesday, March 05, 2008 6:04 PM
Subject: Shell Script to run multiple SAS codes
> Hi All,
>
> Can anyone provide me some examples to run multiple SAS programs using
> script in Unix. My requirement is like
>
> Run code1.sas if output is fine => run code2 if output is fine => run
> Code3
> and so on.
>
> I tried to search on the SAS site but was not able to find suitable
> example.
> I have written a small script like below but its not giving me the correct
> results.
>
> #!/bin/sh
> #execute the following codes on e after the other
>
> (sas test.sas && touch test.OK || touch test.FAIL) &
> (sas test1.sas && touch test1.OK || touch test1.FAIL) &
> #WAIT FOR THE DATA
> wait
> #TEST JOB STATUS
> echo "DONE"
>
> Thanks,
> Kunal Kelkar
|