IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

Passing a value from JCL to a step that executes DB2 program

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DB2
View previous topic :: View next topic  
Author Message
chinnielr



Joined: 11 Jul 2005
Posts: 54

Posted: Mon Jul 07, 2008 5:46 pm    Post subject: Passing a value from JCL to a step that executes DB2 program  

Hi All,

I need to pass a value from JCL to a step in a PROC that executes a DB2 program. My DB2 program should take in this PARM value and execute it.

Can you please let me know how to achieve this?

Here is my sample JCL and PROC looks like

//TSTPRM EXEC TSTPRM,
// EFFDATE='20080707'


Below is my sample PROC looks like

//TEMP EXEC PGM=IKJEFT01,PARM='&EFFDATE'

I need to capture the date in TEMP program and process it.
But when I tried to execute it, I am getting as BLANK for the date.

I know that we can pass the PARM in DB2 CONTROL cards. But I need to this like above.

Can we do this without passing the PARM in the control card? Is there any way to do this?

Please suggest!!
Back to top  
dbzTHEdinosauer



Joined: 20 Oct 2006
Posts: 1639
Location: germany

Posted: Mon Jul 07, 2008 6:41 pm    Post subject:  

for IJKFldld modules (TMP) that are used to invoked db2 modules (CAF), the parm parm in the exec statement is for the TMP program. The control cards that you don't want to use are the only way to get it there, without defining a file in your db2 program.

remember, you can create control cards by concatenating several files.
dsn could be in one file
sysid could be in another
the run can be in another
the parm=' ' can be in yet another.


or, change your db2 from CAF to RRS and write a cobol module that can be called from any db2 module to effect the RRS attach and you don't need to use the TMP to execute db2 modules.

nope, don't even bother asking about RRSAF. If you don't have it, i am not going to explain it. If you have it at your shop, you already have the cobol module (could be assembler) to call for the attach - which means again, I am not going to explain.

If you are interested in RRSAF, go to the IBM Redbooks website and check for RRSAF. Big book with lots of pictures.
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DB2
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM