LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments:   To: Kunal Kelkar <mailtokunalkelkar@gmail.com>
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


Back to: Top of message | Previous page | Main SAS-L page