Monday, November 12, 2012

DB2 Program Checklist (batch & on-line)

The following is the checklist  to complete a DB2 batch or on-line program....

Batch DB2 COBOL program....

1. If the program is main program it should have both DBB and DPK components.

2. If the program is linked (called) program it should have only DPK component. But the package generated should be binded in Calling program DBB component.

For example the DBB component looks like ....

  BIND PLAN(????????)   -        **********>>>    ENTER PLAN NAME
  PKLIST(SEALAND.????????, -    **********>>>    ENTER MEMBER NAME
         SEALAND.????????, -    **********>>>     (MULTIPLE MEMBERS
         SEALAND.????????) -    **********>>>      FOR EACH PLAN)
   QUALIFIER(TEST)    -         **********>>>    MUST ALWAYS BE TEST
   OWNER(????)        -         **********>>>    ENTER YOUR TSO ID
   ACTION(REPLACE)    -
   RETAIN             -
   VALIDATE(BIND)     -
   ISOLATION(CS)      -
   FLAG(I)            -
   ACQUIRE(USE)       -
   RELEASE(COMMIT)    -
   EXPLAIN(YES)

   *********************************************************************
   *         THIS IS A SAMPLE DBB CARD FOR DB2 PACKAGING               *
   *                                                                   *
   *            IF MULTIPLE MEMBERS ARE ENTERED IN PKLIST,             *
   *            THERE MUST BE A DPK CARD FOR EACH ONE.                 *
   *********************************************************************

The following is the format of the DPK card....


 BIND PACKAGE(SEALAND) -
 MEMBER(????????)     -        ***********>>>    ENTER MEMBER NAME
 VALIDATE(BIND)       -
 OWNER(????)          -        ***********>>>    ENTER YOUR TSO ID
 EXPLAIN(NO)          -
 QUALIFIER(TEST)               ***********>>>    MUST ALWAYS BE TEST

 ***********************************************************************
 *                                                                     *
 *            THIS IS A SAMPLE DPK CARD FOR DB2 PACKAGING              *
 *                                                                     *
 *                                                                     *
 ***********************************************************************
3. As we are all aware that RCT is a concept of CICS. So batch DB2 program will not have any RCT entry.
4. To run this DB2 program the following the is the model JCL...
//TESTXXX  JOB  (AAAA),'ACCOUNTS PAYABLE',CLASS=A,
//   USER=XXXX,MSGCLASS=H,REGION=4096K
/*JOBPARM SYSAFF=B158
//JOBLIB    DD DSN=TEST.JOBLIB,DISP=SHR
/*
//STEP010   EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB   DD DSN=DB2T.DSNEXIT,DISP=SHR
//          DD DSN=DB2T.DSNLOAD,DISP=SHR
//          DD DSN=TEST.JOBLIB,DISP=SHR
//INPUT1    DD DSN=XYZ.ABC.DBF,DISP=SHR
//OUTPUT1   DD DSN=XYZ.BCD.LEY,
//             DISP=(NEW,CATLG,DELETE),
//             DCB=(RECFM=FB,LRECL=122,BLKSIZE=2440),UNIT=SYSDA,
//             SPACE=(CYL,(10,2),RLSE)
//SYSPRINT  DD SYSOUT=*
//SYSTSPRT  DD SYSOUT=*
//SYSOUT    DD SYSOUT=*
//SYSERR    DD SYSOUT=*
//SYSDUMP   DD SYSOUT=*
//TESTDUMP  DD SYSOUT=*
//SYSMSG    DD SYSOUT=*
//SYSTSIN   DD *
DSN SYSTEM(DB2T)
RUN PROG(TESTPROG) PLAN(TESTPLAN)
END
//*

As shown in above JCL program IKJEFT01 is used to run DB2 program (TESTPROG in our example).
In the above JCL program name and plan names are specified in SYSTSIN dataset as in-stream data.

The following is the check list to complete CICS(on-line) DB2 program...

1. If the program is main program it should have both DBB and DPK components.
2. If the program is LINKed, XCTLed program it should have only DPK component. But the package generated
should be binded in Calling program DBB component.
3. RCT entry has to be created if the program is main program(which consists of TRANSID). If the program is
LINKed or XCTLed it need not have a RCT entry. RCT entry basically used to attach CICS system to DB2
system.
4. No JCL business here because it is on-line.
5.   The DBB and DPK s shown for batch program are also applicable to this.

1.   What does SQLCODE +100 means                                         
2.   What does the SQLCODE +818 means                                    
3.   What are the pars of a SELECT statement                             
4.   What is DB2 etc....,

No comments:

Post a Comment

BID Toolbar

BID Bottom