MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Run SPUFUI n times from a JCL with dynamic input

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
sakreg
Beginner


Joined: 28 Feb 2005
Posts: 80
Topics: 26

PostPosted: Mon Dec 15, 2008 7:21 am    Post subject: Run SPUFUI n times from a JCL with dynamic input Reply with quote

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
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Tue Dec 16, 2008 7:15 am    Post subject: Reply with quote

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
View user's profile Send private message
sakreg
Beginner


Joined: 28 Feb 2005
Posts: 80
Topics: 26

PostPosted: Tue Dec 16, 2008 10:27 am    Post subject: Reply with quote

@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
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Dec 16, 2008 10:37 pm    Post subject: Reply with quote

why not put sysprint in a dataset (disp=mod) and run it with different sysin everytime.
Back to top
View user's profile Send private message Send e-mail
sakreg
Beginner


Joined: 28 Feb 2005
Posts: 80
Topics: 26

PostPosted: Wed Dec 17, 2008 5:09 am    Post subject: Reply with quote

@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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Dec 17, 2008 11:17 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group