View previous topic :: View next topic
|
Author |
Message |
vch
New User
Joined: 01 Feb 2008 Posts: 22 Location: chennai
|
|
|
|
My requirement is, i need to get a value from a DB2 table, and fetched value i need to pass to next steps in jcl.
i.e. select A into :&DSN1 from Table1 S where S.B='2' ;
can we execute above query in JCL?
If any one knows how to execute please guide me. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You can run SPUFI in batch. . . |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you could also do an unload with the select query. |
|
Back to top |
|
|
vch
New User
Joined: 01 Feb 2008 Posts: 22 Location: chennai
|
|
|
|
i can do unload but..unloaded data is available in output file. but my doubt is can i put this data in JCL parmarameters..inorder to use that in next steps... |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
?? The output of a certain step can be the input of the next step.
Billions of time that happens in IT !! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but my doubt is can i put this data in JCL parmarameters..inorder to use that in next steps... |
Have you tried this?
Did you encounter some problem? |
|
Back to top |
|
|
Bill Dennis
Active Member
Joined: 17 Aug 2007 Posts: 562 Location: Iowa, USA
|
|
|
|
If you need the value passed as PARM= on a following EXEC card, you're out of luck.
Can you convert the pgm to read a file passed from SPUFI step? |
|
Back to top |
|
|
satyender
New User
Joined: 05 Jan 2008 Posts: 50 Location: Olympia, WA, USA
|
|
|
|
The other day i too was looking similar like this only about instering rows using jcl, herein the jcl i wrote thru which we can execute the SQL statements.
//STEPDE01 EXEC PGM=IEFBR14
//SYSPUNCH DD DSN=T0J0AJ7.ALTER.SYSPUNCH,
// DISP=(MOD,DELETE,DELETE),
// SPACE=(TRK,(1,1),RLSE)
//SYSREC00 DD DSN=T0J0AJ7.ALTER.SYSREC,
// DISP=(MOD,DELETE,DELETE),
// SPACE=(TRK,(1,1),RLSE)
//*
//*---------------------------------------------------------------*
//STEPAL01 EXEC PGM=IKJEFT01
//PRINTS INCLUDE MEMBER=CEEDUMP
//SYSPUNCH DD DSN=T0J0AJ7.ALTER.SYSPUNCH,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(5,1),RLSE)
//SYSREC00 DD DSN=T0J0AJ7.ALTER.SYSREC,
// DISP=(NEW,CATLG,DELETE),
// UNIT=(SYSDA,9),
// SPACE=(CYL,(50,10),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DSN=PROD.CNTRLIB(PDB2),DISP=SHR
// DD DSN=PROD.CNTRLIB(DSNTISQL),DISP=SHR
//*SYSTSIN DD DSN=PROD.CNTRLIB(&DB2RGN),DISP=SHR
//* DD DSN=PROD.CNTRLIB(DSNTISQL),DISP=SHR
//SYSIN DD DSN=T0J0AJ7.ALTER.INDEX.TLCS005(ALTER),DISP=SHR
In the SYSIN control card use your dataset and the member in which the SQL query should be written.
In the SYSTSIN card use the statements like this changing the subsystem parameters according to your shop.
first dataser:
DSN SYSTEM (PDB2) RETRY(120)
DD DSN=PROD.CNTRLIB(DSNTISQL),DISP=SHR
second dataset
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARMS('SQL')
END
Hope this helps you. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
Back to top |
|
|
|