Sunteți pe pagina 1din 16

DB2 Case Study

Version 1.0

Prepared By

Madhavi Kadari

38736952.doc Page 1 of 16
Version History

S.No Description Date Pages Ver Prepared/Upd


ated By
1 First Version 16-Jan-08 15 1.0 Madhavi
Kadari

38736952.doc Page 2 of 16
TABLE OF CONTENT
1. INTRODUCTION................................................................................4
2. REQUIREMENTS...............................................................................4
3. BROAD SYSTEM SPECIFICATION...............................................4
4. INPUT AND OUTPUT FILES............................................................5
5. TABLE LAYOUTS..............................................................................6
6. RECORD STRUCTURE OF THE DB2 TABLES..........................10
7. GUIDELINES.....................................................................................10
8. MODULES..........................................................................................12
9. TEST PREPARATION.....................................................................13

38736952.doc Page 3 of 16
1. INTRODUCTION
Purpose of this case study is to provide hands on experience for trainees by covering most of the programming
concepts in COBOL with DB2. This case study is designed in Bank application domain.

2. REQUIREMENTS
XYZ Bank Ltd maintains the current and personal accounts of the customers. To open an account, the customer
needs to provide valid personal information and deposit Rs500 if it is a savings account. For a current account, no
deposit is required. A third party captures the data and generates the customer id and the account number. All the
transactions will be maintained on these with these 2 ids. The captured data will be loaded into the DB2 database.

The data that is captured and being passed to the XYZ Bank Ltd can be grouped into 3 main functional areas
• Personal Data
• Account Data
• Transaction data
Develop a system incorporating the above features with COBOL/DB2 programs

3. BROAD SYSTEM SPECIFICATION


Development will be done in Batch mode. There will be an input file which contains the personal data, account data and
the transaction Data.

The requirements will be coded in following three functions:

• Main Program : Reads the input file and calls the appropriate module to insert or modify based on the
request type.
• Insert Program: Handles the records insertion for Personal and Account data.
• Update Program: Handles the updates/deletes made on the Personal information and account information. It
also handles the Transaction records insertion.
• Report Program: Generates the report to list the customers with less than the required minimum balance.

There will be four programs to be written.

<Program 1> to read input file and call the insert or update program.

<Program 2> to handle the functions of New customer insert process. This program validates the data and insert the
record into the corresponding db2 table based on the table type given in the file. If the record insert fails, then the
program will attach the error code, customer id and writes it into error file or spool.

<Program 3> to handle record updates/deletes based on transaction type. If the record update fails the program will
attach the error code, customer id and writes it into error file or spool.

<Program 4> to handle the functions of Enquiry Report.

38736952.doc Page 4 of 16
4. Input and Output Files
File Name Open Type Record Access Remarks
Mode length
Customer Master Input Sequential 100 Sequential Read First 4 char will be the trans
File type ISRT. Remaining 96 char
is the table data.
Transaction File Input Sequential 100 Sequential Read First 4 char will be the trans
type REPL/DLET. Remaining
96 char is the table data.
Error File Output Sequential 80 Sequential Write
Report File Output Sequential 80 Sequential Write

4.1. File Layouts


• File to have multiple record layouts
• Each layout specifies details of a table Record
The different record layouts are described below

4.1.1. Customer Record

Field Name Field Type Field Length Remarks


Customer id Alphanumeric 10 Primary Key
Table-type Alphanumeric 02 Value “CU”
Customer name Alphanumeric 14
SSN number Alphanumeric 10
Address1 Alphanumeric 10
Address2 Alphanumeric 10
Mail Id Alphanumeric 20
Phone number Alphanumeric 10
Filler spaces 10

4.1.2. Current Account Record

Field Name Field Type Field Length Remarks


Customer id Alphanumeric 10
Table-type Alphanumeric 02 Value “CA”
Account number Alphanumeric 10 Primary Key
Balance Alphanumeric 10
Branch Name Alphanumeric 10
Branch City Alphanumeric 10
Filler spaces 44

4.1.3. Savings Account Record

Field Name Field Type Field Length Remarks


Customer id Alphanumeric 10
Table-type Alphanumeric 02 Value “SA”
Account number Alphanumeric 10 Primary Key
Balance Alphanumeric 10
Branch Name Alphanumeric 10
Branch City Alphanumeric 10
Filler spaces 44

38736952.doc Page 5 of 16
4.1.4. Transaction Record

Field Name Field Type Field Length Remarks


Customer id Alphanumeric 10
Table-type Alphanumeric 02 Value “ST” or ”CT”
Account-number Alphanumeric 10
Account-Type Alphanumeric 02 Value “CA” or “SA”
Transaction Date Alphanumeric 10 Primary Key
Transaction Type Alphanumeric 02 Value “DB” or “CR”
Transaction Amount Integer 10
Closing balance Integer 10
Filler spaces 40

4.1.5. Layout of Error File

Field Name Field Type Field Length Remarks


Program Name Alphanumeric 10
Request type Alphanumeric 04 ISRT, REPL, DLET
Table Name Alphanumeric 10
DB2 Return code Alphanumeric 03
Error Message Alphanumeric 62

4.1.6. Layout of Report File

Field Name Field Type Field Length Remarks


Report-Record Alphanumeric 80

5. Table Layouts

5.1. Customer Table Layout

Logical Name Physical Name Remarks


Customer Information CUST_TB Maintains details of all customers and personal
Table information. Customer id is the primary key.

Logical column name Physical column Name Field Type Length Remarks
Customer Identifier CUST_ID CHAR 10 Primary Key
Customer name CUST_NAME CHAR 14 NOT NULL
Social security number SSN_NO CHAR 10 UNIQUE NOT NULL
Address1 CUST_ADDR1 CHAR 10 NOT NULL
Address2 CUST_ADDR2 CHAR 10 NOT NULL
Mail ID MAIL_ID CHAR 20 NOT NULL
Phone Number PHONE_NO CHAR 10 NOT NULL

5.1.1. DDL for Customer Table


CREATE TABLESPACE BANKnnn

38736952.doc Page 6 of 16
IN TRNG
USING STOGROUP TRNG
PRIQTY 10000
SECQTY 5000
ERASE NO
BUFFERPOOL BP0
LOCKSIZE ANY
CLOSE YES;

CREATE TABLE userid.CUST_TB


(CUST_ID CHAR(10) NOT NULL,
CUST_NAME CHAR(14) NOT NULL,
SSN_NO CHAR(10) NOT NULL,
CURR_ADDR1 CHAR(10) NOT NULL WITH DEFAULT,
CURR_ADDR2 CHAR(10) NOT NULL WITH DEFAULT,
MAIL_ID CHAR(20) NOT NULL WITH DEFAULT,
PHONE_NO CHAR(10) NOT NULL WITH DEFAULT,
CONSTRAINT UNQ_SSN UNIQUE(SSN_NO),
PRIMARY KEY(CUST_ID))
IN TRNG.BANKnnn;

CREATE UNIQUE INDEX userid.CUST_TBIDX1


ON userid.CUST_TB
(CUST_ID ASC)
USING STOGROUP TRNG
PRIQTY 1000
SECQTY 500
ERASE NO
BUFFERPOOL BP0
CLOSE YES
FREEPAGE 0
PCTFREE 5;

CREATE UNIQUE INDEX IDCC56.CUST_TBIDX2


ON userid.CUST_TB
(SSN_NO ASC)
USING STOGROUP TRNG
PRIQTY 1000
SECQTY 500
ERASE NO
BUFFERPOOL BP0
CLOSE YES
FREEPAGE 0
PCTFREE 5;

5.2. Current Account Table Layout


Logical Name Physical Name Remarks
Current Account CURR_ACCT_TB Maintains current account details of all
information Database customers. Current Account Number is the
primary key and CUST_ID is the foreign key.

Logical column name Physical column Name Field Type Length Remarks
Customer Identifier CUST_ID CHAR 10 Foreign Key
Current Account CURR_ACCT_NO CHAR 10 Primary Key

38736952.doc Page 7 of 16
Logical column name Physical column Name Field Type Length Remarks
Number
Current Balance amount CURR_BAL INTEGER 10
Branch name BRANCH_NAME CHAR 10 NOT NULL
Routing Number BRANCH_CITY CHAR 10 NOT NULL

5.2.1. DDL for Current Account Table


CREATE TABLE userid.CURR_ACCT_TB
(CUST_ID CHAR(10) NOT NULL,
CURR_ACCT_NO CHAR(10) NOT NULL,
CURR_BAL INTEGER NOT NULL,
BRANCH_NAME CHAR(10) NOT NULL,
BRANCH_CITY CHAR(10) NOT NULL,
PRIMARY KEY(CURR_ACCT_NO),
CONSTRAINT FK_CUST FOREIGN KEY(CUST_ID) REFERENCES
userid.CUST_TB ON DELETE CASCADE )
IN TRNG.BANKnnn;

CREATE UNIQUE INDEX userid.CURR_ACCT_TBIDX1


ON userid.CURR_ACCT_TB
(CUST_ID ASC)
USING STOGROUP TRNG
PRIQTY 1000
SECQTY 500
ERASE NO
BUFFERPOOL BP0
CLOSE YES
FREEPAGE 0
PCTFREE 5;

5.3. Savings Account Table Layout


Logical Name Physical Name Remarks
Savings Account SAVE_ACCT_TB Maintains savings account details of all
information Database customers. Savings Account Number is the
primary key and CUST_ID is the foreign key.

Logical column name Physical column Name Field Type Length Remarks
Customer Identifier CUST_ID CHAR 10 Foreign Key
Savings Account SAVE_ACCT_NO CHAR 10 Primary Key
Number
Savings Balance amount SAVE_BAL INTEGER 10
Branch name BRANCH_NAME CHAR 10 NOT NULL
Branch City BRANCH_CITY CHAR 10 NOT NULL

5.3.1. DDL for Savings Account Table


CREATE TABLE userid.SAVE_ACCT_TB
(CUST_ID CHAR(10) NOT NULL,
SAVE_ACCT_NO CHAR(10) NOT NULL,
SAVE_BAL INTEGER NOT NULL,
BRANCH_NAME CHAR(10) NOT NULL,

38736952.doc Page 8 of 16
BRANCH_CITY CHAR(10) NOT NULL,
PRIMARY KEY(SAVE_ACCT_NO),
CONSTRAINT FK_CUST FOREIGN KEY(CUST_ID) REFERENCES
userid.CUST_TB ON DELETE CASCADE )
IN TRNG.BANKnnn;

CREATE UNIQUE INDEX userid.SAVE_ACCT_TBIDX1


ON userid.SAVE_ACCT_TB
(CUST_ID ASC)
USING STOGROUP TRNG
PRIQTY 1000
SECQTY 500
ERASE NO
BUFFERPOOL BP0
CLOSE YES
FREEPAGE 0
PCTFREE 5;

5.4. Transactions Table Layout


Logical Name Physical Name Remarks
Transactions information TRANS_TB Maintains Current account/Savings account
database transaction history of all customers

Logical column name Physical column Name Field Type Length Remarks
Customer Identifier CUST_ID CHAR 10 Foreign Key
Account Number ACCT_NO CHAR 10 Foreign Key
Account Type ACCT _TYPE CHAR 2 NOT NULL
Transaction Type TRANS_TYPE CHAR 2 NOT NULL
Date of transaction TRANS_DATE DATE 10 NOT NULL WITH
DEFAULT VALUE
CURRENTDATE
Amount TRANS_AMT INTEGER 10 NOT NULL
Balance CLOSING_BAL INTEGER 10 NOT NULL

5.4.1. DDL for Transactions Table


CREATE TABLE userid.TRANS_TB
(CUST_ID CHAR(10) NOT NULL,
ACCT_NO CHAR(10) NOT NULL,
ACCT_TYPE CHAR(2) NOT NULL,
TRANS_TYPE CHAR(2) NOT NULL,
TRANS_DATE DATE NOT NULL,
TRANS_AMT INTEGER NOT NULL,
CLOSING_BAL INTEGER NOT NULL,
CONSTRAINT FK_CUST2 FOREIGN KEY(CUST_ID) REFERENCES
userid.CUST_TB ON DELETE CASCADE)
IN TRNG.BANKnnn;

CREATE INDEX userid.TRANS_TBIDX1


ON userid.TRANS_TB
(CUST_ID ASC)
USING STOGROUP TRNG
PRIQTY 1000

38736952.doc Page 9 of 16
SECQTY 500
ERASE NO
BUFFERPOOL BP0
CLOSE YES
FREEPAGE 0
PCTFREE 5;

6. Record structure of the DB2 Tables


01 WS-DB2-REC.
05 WS-CUSTOMER-RECORD.
10 WS-CU-CUST-ID PIC X(10).
10 WS-CU-TABLE-TYPE PIC X(02).
10 WS-CU-CUST-NAME PIC X(14).
10 WS-CU-SSN-NO PIC X(10).
10 WS-CU-ADDRS PIC X(20).
10 WS-CU-MAIL-ID PIC X(20).
10 WS-CU-PHONE-NO PIC X(10).
10 FILLER PIC X(10).
05 WS-CURRENT-ACCOUNT-RECORD REDEFINES WS-CUSTOMER-RECORD.
10 WS-CA-CUST-ID PIC X(10).
10 WS-CA-TABLE-TYPE PIC X(02).
10 WS-CA-ACCT-NO PIC X(10).
10 WS-CA-BALANCE PIC X(10).
10 WS-BRANCH-NAME PIC X(10).
10 WS-BRANCH-CITY PIC X(10).
10 FILLER PIC X(44).
05 WS-SAVINGS-ACCOUNT-RECORD REDEFINES WS-CUSTOMER-RECORD.
10 WS-SA-CUST-ID PIC X(10).
10 WS-SA-TABLE-TYPE PIC X(02).
10 WS-SA-ACCT-NO PIC X(10).
10 WS-SA-BALANCE PIC X(10).
10 WS-BRANCH-NAME PIC X(10).
10 WS-BRANCH-CITY PIC X(10).
10 FILLER PIC X(44).
05 WS-TRANS-RECORD REDEFINES WS-CUSTOMER-RECORD.
10 WS-TR-CUST-ID PIC X(10).
10 WS-TR-TABLE-TYPE PIC X(02).
10 WS-TR-ACCT-NO PIC X(10).
10 WS-TR-ACCT-TYPE PIC X(02).
10 WS-TR-TRANS-TYPE PIC X(02).
10 WS-TR-DATE PIC X(10).
10 WS-TR-TRANS-AMOUNT PIC X(10).
10 WS-TR-CLOSING-AMOUNT PIC X(10).
10 FILLER PIC X(40).

7. Guidelines

7.1. Programming Guidelines


• Maintain consistency in coding standards
• Check SQLCODE after each SQL Statement.
• Handle the error conditions to ensure smooth exit

The following SQLCODES that may be encountered during execution. For other SQL codes check
literature.

38736952.doc Page 10 of 16
• +000 – The SQL call was successful
• +100 – No record found or End of database was reached
• -803 – The record already exists in database

7.2. Validation Process


• Check all other mandatory fields to contain values
• Verify amounts to be numeric
• Verify Date is not blank

7.3. DB2 Environment Details

• DB2I main panel can be accessed through option M.13 or D2 from TSO main panel.
• In DB2I menu, the SSID should be DB8G. It can be verified at top right corner of DB2I main panel.
• SSID can be modified through DB2I Defaults panel. The panel can be accessed through option D on
the DB2I main panel.
• Database to be used is TRNG.
• Each user to create and work in separate Tablespace. Creators of tablespace will be the owners of
the Tablespace and the objects created in it.
• Tablespace to be named as BANKnnn where nnn is the last four digits of the users TSO login ID.
• Each user to bind packages under their respective collection ID’s. Collection ID’s to be named as
COLLBANKnnn where nnn is the last three digits of the users TSO login ID
• Model JCL’s for Compile, Bind Package/plan and execution are provided
• Sample SQL statements to create and drop Tablespaces and Tables are provided.
• Modify the SQLs accordingly and run in SPUFI

7.4. Pre-required datasets

• Create ‘userid.BANK.DDL’ to store the DDLs of the tables to be created. The attributes are
Record Format = FB, Record Length = 80

• Create ‘userid.BANK.COBOL’ to store programs. The attributes are Record Format = FB, Record
Length = 80

• Create ‘userid..BANK.CPY’ to store Copybooks if any. The attributes are Record Format = FB,
Record Length = 80

• Create ‘userid..BANK.JCL’ to store JCLs. The attributes are Record Format = FB, Record Length
= 80

• Create ‘userid..BANK.DBRMLIB’ to store pre-compiled DBRM of the modules. The attributes


are Record Format =FB, Record Length = 80

• Create ‘userid..BANK.PROCLIB’ to store procedure DSNHCOB. The attributes are Record


Format = FB, Record Length = 80

• Create ‘userid..BANK.LOAD’ to store load modules. The attributes are Record Format = U,
Record Length = 80

38736952.doc Page 11 of 16
8. Modules

8.1. Main module


• In this program read the master/transaction file. Check if the transaction request type is ISRT, REPL or
DLET.
• If the request type is ISRT , calls the insert program.
• If the request type is REPL, DLET calls the update program

8.2. Customer Insert Module

• In this program check the table type to insert the records into the corresponding tables.
• Before inserting the Transaction record, the remaining amount needs be calculated based on the
transaction type (CR or DB) to update the closing balance.

Master file setup for insert


ISRT1111111111CUDALE COPE 1111111117ILLINOIS USA DALE@YAHOO.COM 9999911111
ISRT1111111111CA11111111180000001000CREEK RD TOWANDA
ISRT1111111111SA11111111190000002000CREEK RD TOWANDA
ISRT1111111111TR1111111118CACR2008-05-016000
Note : space the fields according the layout

8.3. Customer Update Module

• In this program check the table type to do the necessary action on the corresponding table
• No Updates will be made to the transaction records as they are history. Only deletes and inserts can be
done on the transaction table.
• Before inserting the Transaction record, the remaining amount needs be calculated based on the
transaction type (CR or DB) to update the closing balance.

Format of the Transactions file


REPL1111111111CUDALE MOHN 1111111117MISSOURI USA DALEM@YAHOO.COM
ISRT1111111111TR1111111118CACR2008-05-016000
DLET1111111111CU

8.4. Report Module

• In this program read the required tables to get the data and check if the closing balance of the customer is
above the required minimum balance. If not write the customer information into the report

Report Layout :

XYZ Bank Ltd

Date: dd/mm/yyyy Page : xx

MINIMUM BALANCE REPORT

CUST ID CUST NAME ACCT NO ACCT BAL

XXXXXXXXXX XXXXXXXXXXXX 9999999999 $9999999999


XXXXXXXXXX XXXXXXXXXXXX 9999999999 $9999999999
XXXXXXXXXX XXXXXXXXXXXX 9999999999 $9999999999

38736952.doc Page 12 of 16
XXXXXXXXXX XXXXXXXXXXXX 9999999999 $9999999999
XXXXXXXXXX XXXXXXXXXXXX 9999999999 $9999999999

Total Number of Customers below minimum balance : xxxxxx

9. Test Preparation

9.1. Compile DB2 module


//xxxxxxx JOB NOTIFY=&SYSUID
//******************************************************
//*** REMEMBER TO CHANGE JOB CARD AS WELL ****
//*** INSTRUCTION FOR EACH STEP IS GIVEN BELOW ****
//*** STUDY THE JCL COMPLETELY BEFORE CHANGING ****
//******************************************************
//LIBS JCLLIB ORDER=(userid.bank.proclib)
//COMP EXEC DSNHCOB,
// LOADLIB=userid.bank.load,
// MEMBER=membername,
// SRCELIB=userid.bank.cobol,
// DBRMLIB=userid.bank.dbrmlib,
// INCLLIB=userid.bank.cpy

Copy the below statements into a member by name DSNHCOB in PROCLIB library. No changes are
required to the below jcl

//**********************************************************************
//* DSNHCOB - COMPILE AND LINKEDIT A COBOL PROGRAM
//*
//DSNHCOB PROC WSPC=500,MEMBER=TEMPNAME
//*
//* PRECOMPILE THE COBOL PROGRAM
//**********************************************************************
//PC EXEC PGM=DSNHPC,PARM='HOST(COBOL)',REGION=4096K
//DBRMLIB DD DSN=&DBRMLIB(&MEMBER),
// DISP=SHR
//STEPLIB DD DISP=SHR,DSN=DSN810.SDSNEXIT
// DD DISP=SHR,DSN=DSN810.SDSNLOAD
//SYSCIN DD DSN=&&DSNHOUT,DISP=(MOD,PASS),UNIT=SYSDA,
// SPACE=(800,(&WSPC,&WSPC))
//SYSIN DD DSN=&SRCELIB(&MEMBER),DISP=SHR
//SYSLIB DD DSN=&INCLLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT1 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//SYSUT2 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//*
//* COMPILE THE COBOL PROGRAM IF THE PRECOMPILE
//* RETURN CODE IS 4 OR LESS
//*
//COB EXEC PGM=IGYCRCTL,PARM='LIB',COND=(4,LT,PC)
//STEPLIB DD DSN=IGY320.SIGYCOMP,DISP=SHR
//SYSIN DD DSN=&&DSNHOUT,DISP=(OLD,DELETE)
//SYSLIB DD DSN=GDDM.SADMSAM,DISP=SHR
//* DD DSN=&COPYLIB,DISP=SHR
// DD DSN=&INCLLIB,DISP=SHR

38736952.doc Page 13 of 16
//SYSLIN DD DSN=&&LOADSET,DISP=(MOD,PASS),UNIT=SYSDA,
// SPACE=(800,(&WSPC,&WSPC))
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT1 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//SYSUT2 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//SYSUT3 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//SYSUT4 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//SYSUT5 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//SYSUT6 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//SYSUT7 DD SPACE=(800,(&WSPC,&WSPC),,,ROUND),UNIT=SYSDA
//*
//* LINKEDIT IF THE PRECOMPILE AND COMPILE
//* RETURN CODES ARE 4 OR LESS
//*
//LKED EXEC PGM=IEWL,PARM='XREF',
// COND=((4,LT,COB),(4,LT,PC))
//SYSLIB DD DSN=CEE.SCEELKED,DISP=SHR
// DD DISP=SHR,
// DSN=DSN810.SDSNLOAD
// DD DISP=SHR,DSN=ISP.SISPLOAD
// DD DISP=SHR,DSN=GDDM.SADMMOD
//SYSLIN DD DSN=&&LOADSET,DISP=(OLD,DELETE)
// DD DDNAME=SYSIN
//SYSLMOD DD DSN=&LOADLIB(&MEMBER),DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT1 DD SPACE=(1024,(50,50)),UNIT=SYSDA

9.2. Compile main module


This job needs to be executed for each db2 module

//xxxxxxx JOB (ACCT#,&SYSUID),,


// MSGCLASS=R,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//******************************************************
//COBOL EXEC PGM=IGYCRCTL,REGION=2048K,PARM=LIB
//STEPLIB DD DSNAME=IGY320.SIGYCOMP,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSNAME=&&LOADSET,UNIT=SYSDA,
// DISP=(MOD,PASS),SPACE=(TRK,(3,3)),
// DCB=(BLKSIZE=3200)
//SYSLIB DD DSN=userid.bank.cpy,DISP=SHR
//SYSIN DD DSN=userid.bank.cpy(membername),DISP=SHR
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT3 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT4 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT5 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT6 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//*************************************************************
//NCALLIB EXEC PGM=IEWL,PARM='LIST,XREF,NCAL,MAP,LET,REUS',
// COND=(8,LT,COBOL),REGION=0M
//SYSLIB DD DSN=CEE.SCEELKED,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSN=&&LOADSET,DISP=(MOD,PASS)
// DD DDNAME=SYSIN
//SYSLMOD DD DSN=userid.bank.cpy(membername),DISP=SHR
//SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(10,10))
//SYSIN DD DUMMY

38736952.doc Page 14 of 16
//*************************************************************
//LKED EXEC PGM=HEWL,COND=(8,LT,NCALLIB),REGION=1024K
//SYSLIB DD DSNAME=CEE.SCEELKED,DISP=SHR
// DD DSNAME=userid.bank.load,
// DISP=SHR
//RESLIB DD DSN=IMS910.SDFSRESL,DISP=SHR
//SYSPRINT DD SYSOUT=*
//*SYSLIN DD DSNAME=&&LOADSET,DISP=(OLD,DELETE)
//* DD DDNAME=SYSIN
//SYSLMOD DD DSNAME=userid.bank.load(membername),
// SPACE=(TRK,(10,10,1)),
// UNIT=SYSDA,DISP=(MOD,PASS)
//SYSUT1 DD UNIT=SYSDA,SPACE=(TRK,(10,10))
//SYSIN DD DUMMY
//SYSLIN DD *
INCLUDE SYSLIB(membername)
NAME membername (R)
/*

9.3. Bind Plan JCL


//xxxxxxx JOB ,,NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
//JOBLIB DD DISP=SHR,DSN=DSN810.SDSNLOAD
//BIND EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB8G)
BIND PLAN (planname) -
PKLIST (COLLBANKnnn.*) -
QUALIFIER (userid) -
ACTION (REPLACE) -
EXPLAIN (NO) -
RELEASE (COMMIT) -
OWNER (userid)
END

9.4. Bind Package JCL


This job needs to be executed for each db2 module

//xxxxxxx JOB ,,NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)


//JOBLIB DD DISP=SHR,DSN=DSN810.SDSNLOAD
//BIND EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DB8G)
BIND PACKAGE (COLLBANKnnn) -
MEMBER (membername) -
ACTION (REPLACE) -
ISOLATION (CS) -
VALIDATE (BIND) -
RELEASE (COMMIT) -
SQLERROR (NOPACKAGE) -
FLAG (I) -
LIBRARY (userid.BANK.DBRMLIB')
END

38736952.doc Page 15 of 16
9.5. Run JCL
//xxxxxxx JOB (ACCT#,&SYSUID),,
// MSGCLASS=A,CLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//JOBLIB DD DISP=SHR,DSN=DSN810.SDSNLOAD
// DD DISP=SHR,DSN=userid.bank.load
//DB2EXEC EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//DBRMLIB DD DSN=userid.bank.dbrmlib,DISP=SHR
//ddname1 DD DSN=userid.bank.master/transfile,DISP=SHR
//ddname2 DD DSN=userid.bank.errorfile,DISP=SHR
//SYSTSIN DD *
DSN SYSTEM(DB8G)
RUN PROGRAM(mainmodule)
PLAN(planname) -
LIB('userid.bank.load')
END
/*

9.6. Report job


//xxxxxxx JOB (ACCT#,&SYSUID),,
// MSGCLASS=A,CLASS=A,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//JOBLIB DD DISP=SHR,DSN=DSN810.SDSNLOAD
//DB2EXEC EXEC PGM=IKJEFT01,DYNAMNBR=20
//SYSTSPRT DD SYSOUT=*
//OUTFL DD DSN=userid.bank.report,DISP=SHR
//SYSTSIN DD *
DSN SYSTEM(DB8G)
RUN PROGRAM(reportmodule) -
PLAN(planname) -
LIB('userid.bank.load')
END
/*

38736952.doc Page 16 of 16

S-ar putea să vă placă și