| Date: | Sat, 11 Nov 2006 19:04:41 -0800 |
| Reply-To: | reader <readerweb@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | reader <readerweb@GMAIL.COM> |
| Subject: | Re: batch job submit |
|
| In-Reply-To: | <941871A13165C2418EC144ACB212BDB0078C9E@dshsmxoly1504g.dshs.wa.lcl> |
| Content-Type: | text/plain; charset="utf-8" |
Dan,
I only use windows sas and this is my approach:
I would create 2 batch programs:
One to call up sas.exe
The other to collect the sas programs to run
After you get used to this, you can get fancy by having date and time in the log filenames. By this way you will be able to compare output from different runs.
I also put the do_sas.cmd in the sendto so that I can just right click on any sas program and have it run in batch mode my way.
=======================
c:\batch\do_sas.cmd:
rem run one sas program in batch mode
set saspgm=%1
set saslog=c:\proj1\log\%~n1.log
set sasprint=c:\proj1\print\%~n1.txt
call "C:\Program Files\SAS Institute\SAS\V8\sas.exe" -nologo -sysin "%1" -log "%saslog%" -print "%sasprint%"
=======================
"c:\proj1\pgm\daily_datapull.cmd"
rem run sas programs sequentially in batch mode
call c:\batch\do_sas.cmd c:\proj1\pgm\test1.sas
call c:\batch\do_sas.cmd c:\proj1\pgm\test2.sas
call c:\batch\do_sas.cmd c:\proj1\pgm\test3.sas
rem Or in parallel:
start c:\batch\do_sas.cmd c:\proj1\pgm\test1.sas
start c:\batch\do_sas.cmd c:\proj1\pgm\test2.sas
start c:\batch\do_sas.cmd c:\proj1\pgm\test3.sas
=======================
Alan T Tang
Business Analyst
Actuary Pricing
United Healthcare Services
Cypress, CA 90630
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Nordlund, Dan (DSHS/RDA)
Sent: Saturday, November 11, 2006 6:21 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: batch job submit
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> hba2pd
> Sent: Saturday, November 11, 2006 9:53 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: batch job submit
>
> Thank you. Sequentially.
>
> "Nordlund, Dan DSHS/RDA $B$N%a%C%;!<%8 (B:
>
> > > -----Original Message-----
> > > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> > > hba2pd
> > > Sent: Friday, November 10, 2006 5:25 PM
> > > To: SAS-L@LISTSERV.UGA.EDU
> > > Subject: batch job submit
> > >
> > > Hello,
> > >
> > > I woud like to submit multiple sas jobs in the batch mode in PC SAS.
> > > For examples, test1.sas, test2.sas. What will be a SAS command?
> > >
> > > Best regards,
> >
> > Do you want the jobs to run sequentially or simultaneously, or does it
> not matter?
> >
> > Dan
> >
I don't have a much in the way of details about your particular setup, but here is at least one option. Since you specified PC SAS, I am assuming you are running under some version of MS Windows. Are these programs (test1.sas, test2.sas, ...) written to run in batch mode? I.e., all the necessary libnames, options, etc., are specified in each program? If so, you could set up a "driver" file that would run your programs sequentially. For example, create a file with the name driver.sas (or name of your choice with .sas extension) and %INCLUDE the various programs in the order that you wish them to run.
%include test1.sas
%include test2.sas
.
.
.
%include testn.sas
Then in most windows installations, you can right-click the driver file in windows explorer and batch submit the file.
Other options include writing a windows command (batch) file to submit the programs. This is a little more complicated, but might allow you to test whether each program executed without error. There are probably other scripting solutions that others will suggest. If this doesn't get you to where you want to go, write back to SAS-L with more details about what you want to do, and what your particular setup is (hardware, OS, etc) and I'm sure someone can provide a solution.
Hope this is helpful,
Dan
Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204
|