View previous topic :: View next topic
|
Author |
Message |
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
Charles Wolters
New User
Joined: 30 Mar 2011 Posts: 48 Location: United States
|
|
|
|
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 |
|
|
|