Changes in COBOL-db2 to run JCL

What are the changes to be done in JCL for Cobol-db2 program to execute?

Questions by vardhan.frd   answers by vardhan.frd

Showing Answers 1 - 4 of 4 Answers

rasheeed17

  • Jan 19th, 2012
 

To run an DB2 program,.

1) in Job card changes (to specify which db2 environment to be connected)

--> Add SCHENV=DB2 keyword, DB21-> db2 env , your db2 admin/ PM will provide this


Code
  1. //RASHEED JOB (RAC0000),TEST,CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),  

  2. //             COND=(4,LT),SCHENV=DB21

  3.  

  4.  




2) we don't run db2 program directly , instead we execute IKJEFT01 and call our DB2 program in it. for this we have to pass our DB2 program details as sysin parameter


Code
  1.  //BINDYSS2 EXEC PGM=IKJEFT01,DYNAMNBR=20

  2.  //SYSTSPRT DD SYSOUT=*              

  3.  //SYSPRINT DD SYSOUT=*              

  4.  //SYSUDUMP DD SYSOUT=*              

  5.  //SYSTSIN  DD *                    

  6.    DSN SYSTEM(DB21)                  

  7.    RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2)

  8.    LIB(DSNDB21.DSN.RUNLIB.LOAD)    

  9. //*

  10.  

  11.  

  12.    DSN SYSTEM(DB21)                   --> your DB2 environment(same as SCHENV value in job card)

  13.    RUN PROGRAM(DSNTEP2)          -->  your program name in braces

  14.    PLAN(DSNTEP2)                       --> plan of your program... always same as your program name

  15.    LIB(DSNDB21.DSN.RUNLIB.LOAD)  --> your load library name

  16.  

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions