View previous topic :: View next topic |
Author |
Message |
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Mon Dec 15, 2008 7:21 am Post subject: Run SPUFUI n times from a JCL with dynamic input |
|
|
I am looking to run a SPUFI with a defined number of times using an input file which has the required parameters for the SPUFI from a JCL. Is this really posssibe using a JCL? Or Can REXX be used to achieve this? Each SPUFI output need to be appended to an exisiting output file.
Thank You. |
|
Back to top |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Tue Dec 16, 2008 7:15 am Post subject: |
|
|
What do you mean with "has the required parameters for the SPUFI from a JCL"?
If you want to feed multiple SQL-statements, simply separate them with a ";" and submit them all within one DSNTEP2 run. If you want to store the results of the diffenrent SQL statements in different datasets, you could probably use REXX to slice and dice the SYSPRINT output. If you want the results in one dataset, then SYSPRINT of this step has everything you need.
regards
Christian |
|
Back to top |
|
|
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Tue Dec 16, 2008 10:27 am Post subject: |
|
|
@Christian, I have 1 SELECT SQL. The output of which needs to be stored in a DS. I need to run these SQL's with various parameters, say If we have a SELECT SQL like, SELECT * from TABLE where COLUMN1=a, I need to repeat the same SQL but the value for COLUMN1 for every SPUFUI run would be either b,d,f .....the output of every SPUFI run needs to go into 1 DS in Append mode.
Hope I have made it bit more clarified.
Thank You. |
|
Back to top |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Dec 16, 2008 10:37 pm Post subject: |
|
|
why not put sysprint in a dataset (disp=mod) and run it with different sysin everytime. |
|
Back to top |
|
|
sakreg Beginner
Joined: 28 Feb 2005 Posts: 80 Topics: 26
|
Posted: Wed Dec 17, 2008 5:09 am Post subject: |
|
|
@Dibakar, Thats sounds fine but I am looking forward to run the same with no manual intervention. In this case I would need to change the SYSIN everytime with the required value.
Thank You |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Dec 17, 2008 11:17 am Post subject: |
|
|
sakreg wrote: | @Christian, I have 1 SELECT SQL. The output of which needs to be stored in a DS. I need to run these SQL's with various parameters, say If we have a SELECT SQL like, SELECT * from TABLE where COLUMN1=a, I need to repeat the same SQL but the value for COLUMN1 for every SPUFUI run would be either b,d,f .....the output of every SPUFI run needs to go into 1 DS in Append mode.
Hope I have made it bit more clarified.
Thank You. |
sakreg,
Christian solution is still valid. Code all your sql statements delimited by a semi colon and the output is directed to 1 dataset.
Code: |
//STEP0100 EXEC PGM=IKJEFT01
//SYSTSIN DD *
DSN SYSTEM(DB2T)
RUN PROGRAM(DSNTEP2) -
PLAN(DSNTEP2) -
LIB('DB2T.RUNLIB.LOAD')
END
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD DSN=your.spufi.output,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SELECT * FROM TABLE WHERE COLUMN1 = 'A';
SELECT * FROM TABLE WHERE COLUMN2 = 'B';
SELECT * FROM TABLE WHERE COLUMN3 = 'C';
SELECT * FROM TABLE WHERE COLUMN4 = 'D';
/* |
Kolusu |
|
Back to top |
|
|
|
|