IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Running multiple SAS programs in one batch submission


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Fri Apr 15, 2011 2:32 am
Reply with quote

Here is my problem – I have three SAS programs where the first program has two input data sets and produces two output data sets and both of the output data sets will serve as input to the second SAS program. Let’s call those output files RMTPRD.EES.S688DDD. DATFILE1.DATA and RMTPRD.EES.S688DDD.DATFILE2.DATA and we can assume they are SAS data sets. Let’s say the first SAS program has a DSN of RMTPRD.EES.S688DDD.SASPRG1.SAS and the second has a DSN of RMTPRD.EES.S688DDD. SASPRG2.SAS.

Now the second program produces two output data sets and one is needed as input for the third SAS program which has a DSN of RMTPRD.EES.S688DDD.SASPRG3.SAS and for illustration purposes we can call the data set needed by the third program RMTPRD.EES.S688DDD.OUTDAT3.DATA.

Even though I am running three SAS programs I think I still just need one EXEC card. When I execute a single SAS program the job is set up by first including JCL statements with the SAS program after the //SYSIN DD * statement. I don’t see how that approach will work with multiple SAS programs with the input of one program dependent on the output of a previous SAS program. I did a bit of reading in the SAS MVS manual and the second way to reference your SAS program in a JCL stream is to place the DSN of the SAS program on the SYSIN statement. Is that is what is needed here?

Charles Wolters
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 15, 2011 3:15 am
Reply with quote

Code:
// EXEC SAS
//DD01  DD DISP=OLD,DSN=RMTPRD.EES.S688DDD.DATFILE1.DATA
//DD02  DD DISP=OLD,DSN=RMTPRD.EES.S688DDD.DATFILE2.DATA
//DD03  DD DISP=OLD,DSN=RMTPRD.EES.S688DDD.OUTDAT3.DATA
//SYSIN DD DISP=SHR,DSN=RMTPRD.EES.S688DDD.SASPRG1.SAS
//      DD DISP=SHR,DSN=RMTPRD.EES.S688DDD.SASPRG2.SAS
//      DD DISP=SHR,DSN=RMTPRD.EES.S688DDD.SASPRG3.SAS
will do it, but you'll have to change DD01, DD02, DD03 to your DD names.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Apr 15, 2011 11:37 am
Reply with quote

You only need one SAS library dataset, that wil contain all input/output
SAS datasets for all your SAS programs (concatenated datasets or in stream)
Back to top
View user's profile Send private message
Charles Wolters

New User


Joined: 30 Mar 2011
Posts: 48
Location: United States

PostPosted: Fri Apr 15, 2011 7:19 pm
Reply with quote

Thank you all for your quick responses. Our job setups have always been to use //SYSIN DD * followed by the SAS program but you are using
SYSIN DD DSN= ..... to execute the SAS programs. I will give this method a go. It really gives you a thrill when you realize you can increase your efficiency.

Charles Wolters
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top