View previous topic :: View next topic |
Author |
Message |
erasani_p Beginner
Joined: 28 Jun 2004 Posts: 14 Topics: 10
|
Posted: Mon Jun 28, 2004 11:57 am Post subject: Passing Data into COBOL-DB2 Program |
|
|
If we want to pass data into standalone COBOL program, we can use PARM on the exec statement. Fof a COBOL-DB2 program, how can we pass data. Because we use Terminal Monitor Program (IKJEFT01) in the exec statement of the run JCL.
Any help is appreciated.
Thanks
Prashanth |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Jun 28, 2004 12:20 pm Post subject: |
|
|
Prashanth,
You can use Sysin to pass the data to a COBOL-DB2 program.
Code: |
01 W-PARM-REC.
05 W-RUN-DATE PIC X(10).
05 FILLER PIC X(72).
PROCEDURE DIVISION.
ACCEPT W-PARM-REC
DISPLAY 'THE RUN DATE IS :' W-RUN-DATE
|
The run JCL is
Code: |
//STEP0100 EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(XXX)
RUN PROGRAM(COB-DB2-PGM) PLAN(COB-DB2-PLAN) -
LIB('PGM.TEST.LOADLIB')
//SYSIN DD *
2004-06-24
//*
|
Once your program ran , the variable W-RUN-DATE will have 2004-06-24
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
erasani_p Beginner
Joined: 28 Jun 2004 Posts: 14 Topics: 10
|
Posted: Mon Jun 28, 2004 12:50 pm Post subject: |
|
|
Thanks for ur fast reply. I really appreciate it. I got what u said.
Thanks
Prashanth |
|
Back to top |
|
|
Bithead Advanced
Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Mon Jun 28, 2004 1:25 pm Post subject: |
|
|
You can also use:
Code: |
DSN SYSTEM(XXX)
RUN PROGRAM(COB-DB2-PGM) PLAN(COB-DB2-PLAN) -
LIB('PGM.TEST.LOADLIB') PARM('2004-06-24')
|
Define the parameter in the linkage section in the same manner as your non-DB2 COBOL program. |
|
Back to top |
|
|
|
|