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 

Passing Data into COBOL-DB2 Program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
erasani_p
Beginner


Joined: 28 Jun 2004
Posts: 14
Topics: 10

PostPosted: Mon Jun 28, 2004 11:57 am    Post subject: Passing Data into COBOL-DB2 Program Reply with quote

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


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

PostPosted: Mon Jun 28, 2004 12:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
erasani_p
Beginner


Joined: 28 Jun 2004
Posts: 14
Topics: 10

PostPosted: Mon Jun 28, 2004 12:50 pm    Post subject: Reply with quote

Thanks for ur fast reply. I really appreciate it. I got what u said.

Thanks
Prashanth
Back to top
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Mon Jun 28, 2004 1:25 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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