A Model CICS Application Preparatory work Create the following PDS userid.COBOL.SOURCE recsize=80,blksize=800,recfm=fb,PDS userid.COBOL....
Preparatory work
Create the following PDS
userid.COBOL.SOURCE recsize=80,blksize=800,recfm=fb,PDS
userid.COBOL.COPYBOOK recsize=80,blksize=800,recfm=fb,PDS
userid.PROCLIB recsize=80,blksize=800,recfm=fb,PDS
userid.JCL recsize=80,blksize=800,recfm=fb,PDS
userid.MAPSET.SOURCE recsize=80,blksize=800,recfm=fb,PDS
userid.DBRMLIB recsize=80,blksize=800,recfm=fb,PDS
userid.LOADLIB blksize=32760,recfm=vb,PDS
Copy the following procedure into your userid.PROCLIB as CICSCOB1
//TRN EXEC PGM=DFHECP1$,
// PARM='COBOL2,SP',
// REGION=2M
//STEPLIB DD DSN=CICSTS13.CICS.SDFHLOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSPUNCH DD DSN=&&SYSCIN,
// DISP=(,PASS),UNIT=SYSDA,
// DCB=BLKSIZE=400,
// SPACE=(400,(400,100))
//*
//COB EXEC PGM=IGYCRCTL,REGION=2M,
// PARM='NODYNAM,LIB,OBJECT,RENT,RES,APOST,XREF'
//STEPLIB DD DSN=IGY.V2R1M0.SIGYCOMP,DISP=SHR
//SYSLIB DD DSN=CICSTS13.CICS.SDFHCOB,DISP=SHR
// DD DSN=CICSTS13.CICS.SDFHMAC,DISP=SHR
// DD DSN=CICSTS13.CICS.SDFHSAMP,DISP=SHR
// DD DSN=userid.COBOL.COPYBOOK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD DSN=&&SYSCIN,DISP=(OLD,DELETE)
//SYSLIN DD DSN=&&LOADSET,DISP=(MOD,PASS),
// UNIT=SYSDA,SPACE=(80,(250,100))
//SYSUT1 DD UNIT=SYSDA,SPACE=(460,(350,100))
//SYSUT2 DD UNIT=SYSDA,SPACE=(460,(350,100))
//SYSUT3 DD UNIT=SYSDA,SPACE=(460,(350,100))
//SYSUT4 DD UNIT=SYSDA,SPACE=(460,(350,100))
//SYSUT5 DD UNIT=SYSDA,SPACE=(460,(350,100))
//SYSUT6 DD UNIT=SYSDA,SPACE=(460,(350,100))
//SYSUT7 DD UNIT=SYSDA,SPACE=(460,(350,100))
//*
//COPYLINK EXEC PGM=IEBGENER,COND=(7,LT,COB)
//SYSUT1 DD DSN=CICSTS13.CICS.SDFHCOB(DFHEILIC),DISP=SHR
//SYSUT2 DD DSN=&©LINK,DISP=(NEW,PASS),
// DCB=(LRECL=80,BLKSIZE=400,RECFM=FB),
// UNIT=SYSDA,SPACE=(400,(20,20))
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//*
//LKED EXEC PGM=IEWL,REGION=2M,
// PARM='LIST,XREF',COND=(5,LT,COB)
//SYSLIB DD DSN=CICSTS13.CICS.SDFHLOAD,DISP=SHR
// DD DSN=DSN510.SDSNLOAD,DISP=SHR
// DD DSN=CEE.SCEELKED,DISP=SHR
// DD DSN=CEE.SCEERUN,DISP=SHR
// DD DSN=userid.COBOL.OBJECT,DISP=SHR
//SYSUT1 DD UNIT=SYSDA,DCB=BLKSIZE=1024,
// SPACE=(1024,(200,20))
//SYSPRINT DD SYSOUT=*
//SYSLIN DD DSN=&©LINK,DISP=(OLD,DELETE)
// DD DSN=&&LOADSET,DISP=(OLD,DELETE)
// DD DDNAME=SYSIN
Notes:-
- The shaded green text may change on your system depending on the versions of CICS and COBOL.
- The blue shaded portions are your TSO userid.
Copy this into your JCL PDS. This is for compiling a COBOL CICS program that does not use DB2.
//userid1 JOB NOTIFY=&SYSUID
// JCLLIB ORDER=(userid.PROCLIB)
//COMPILE EXEC CICSCOB1
//TRN.SYSIN DD DSN=userid.COBOL.SOURCE(memname),DISP=SHR
//LKED.SYSIN DD *
NAME memname(R)
/*
//* THIS IS THE USER LOADLIB FOR CICS
//LKED.SYSLMOD DD DSN=<-loadlib->,DISP=SHR
//
Copy this map preparation procedure into userid.PROCLIB
PROC DFHMAPT
//DFHMAPT PROC INDEX='CICSTS13.CICS', FOR SDFHMAC
// DSCTLIB='userid.COBOL.COPY', TARGET FOR DSECT
// MAPNAME=, NAME OF MAPSET - REQUIRED
// RMODE=24, 24/ANY
// ASMBLR=ASMA90, ASSEMBLER PROGRAM NAME
// REG=2048K, REGION FOR ASSEMBLY
// OUTC=A, PRINT SYSOUT CLASS
// WORK=SYSDA WORK FILE UNIT
//ASMMAP EXEC PGM=&ASMBLR,REGION=®,
// PARM='SYSPARM(MAP),DECK,NOOBJECT'
//SYSPRINT DD SYSOUT=&OUTC
//SYSLIB DD DSN=&INDEX..SDFHMAC,DISP=SHR
// DD DSN=SYS1.MACLIB,DISP=SHR
//SYSUT1 DD UNIT=&WORK,SPACE=(CYL,(5,5))
//SYSUT2 DD UNIT=&WORK,SPACE=(CYL,(5,5))
//SYSUT3 DD UNIT=&WORK,SPACE=(CYL,(5,5))
//SYSPUNCH DD DSN=&&MAP,DISP=(,PASS),UNIT=&WORK,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=400),
// SPACE=(400,(50,50))
//SYSIN DD DSN=userid.MAPSET.SOURCE(&MAPNAME),DISP=SHR
//LINKMAP EXEC PGM=IEWL,PARM='LIST,LET,XREF,RMODE(&RMODE)'
//SYSPRINT DD SYSOUT=&OUTC
//SYSLMOD DD DSN=<- your CICS map set load library ->(&MAPNAME),DISP=SHR
//SYSUT1 DD UNIT=&WORK,SPACE=(1024,(20,20))
//SYSLIN DD DSN=&&MAP,DISP=(OLD,DELETE)
//ASMDSECT EXEC PGM=&ASMBLR,REGION=®,
// PARM='SYSPARM(DSECT),DECK,NOOBJECT'
//SYSPRINT DD SYSOUT=&OUTC
//SYSLIB DD DSN=&INDEX..SDFHMAC,DISP=SHR
// DD DSN=SYS1.MACLIB,DISP=SHR
//SYSUT1 DD UNIT=&WORK,SPACE=(CYL,(5,5))
//SYSUT2 DD UNIT=&WORK,SPACE=(CYL,(5,5))
//SYSUT3 DD UNIT=&WORK,SPACE=(CYL,(5,5))
//SYSPUNCH DD DSN=&DSCTLIB(&MAPNAME),DISP=OLD
//SYSIN DD DSN=user01.MAPSET.SOURCE(&MAPNAME),DISP=SHR
Copy this into userid.JCL
//USER011 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
// JCLLIB ORDER=(userid.PROCLIB)
//STEP1 EXEC DFHMAPT,MAPNAME=member-name
//
- Two students will each form a group and the n will vary from 3 to 9 for the groups. 1 and 2 are reserved for the instructor!!.
- Each groups resources will be in a group TRNG0n
- The instructor will define the resources on request.
- All programs MUST be tested using CEDF before allowing them to run. This is to guard against programs going in a loop and disturbing other users of the system.
- The subprograms SYSERR,GETINV,INTEDIT and NUMEDIT will be defined in group TRNGCOMN and can be shared by all.
- Don’t forget to change the COBOL and BMS source to reflect the naming conventions above!.
Data Sets and Sample Data
CUSTMAS 01 CUSTOMER-MASTER-RECORD.
*
05 CM-CUSTOMER-NUMBER PIC X(6).
05 CM-FIRST-NAME PIC X(20).
05 CM-LAST-NAME PIC X(30).
05 CM-ADDRESS PIC X(30).
05 CM-CITY PIC X(20).
05 CM-STATE PIC X(2).
05 CM-ZIP-CODE PIC X(10).Sample data
112233ANNE PRINCE 1122 ELM ST FRESNO CA93711-0000
123455COLUMBUS CHRISTOPHER 1122 NEW WORLD LN COLUMBUS OH92939
123456RAUL MENENDEZ 888 CICS WAY FRESNO CA93711-2765
Since the application has the facility to add a customer record, you can get that part of the application (CUSTMN1n, transid MN1n) to work and add these records.
Defining the data set
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE userid.CUSTMAS CLUSTER
DEFINE CLUSTER (NAME(userid.CUSTMAS) INDEXED KEYS(6,0) -
RECORDSIZE(118,118) TRACKS(2,2)) DATA(CONTROLINTERVALSIZE(1024))
//
PRODUCT
01 PRODUCT-MASTER-RECORD.
*
05 PRM-PRODUCT-CODE PIC X(10). 10
05 PRM-PRODUCT-DESCRIPTION PIC X(20). 20
05 PRM-UNIT-PRICE PIC S9(7)V99 COMP-3. 5
05 PRM-QUANTITY-ON-HAND PIC S9(7) COMP-3. 4
*
Sample Data
See PRODUCT file. Cut paste it into a data set userid.PRODUCT.DATA. A load using REPRO is suggested. It is also a good idea to print the data set using PRINT with HEX output. Note that the ORDRENT2 program wont work without this data set and data.Optionally you can use the program SAMP18 earlier in this document to generate the data for this file automatically.
Defining the data set
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE userid.PRODUCT CLUSTER
DEFINE CLUSTER (NAME(userid.PRODUCT) INDEXED KEYS(10,0) -
RECORDSIZE(39,39) TRACKS(1,1)) DATA(CONTROLINTERVALSIZE(1024))
//
Loading the data set
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO INDATASET(userid.PRODUCT.DATA) -
OUTDATASET(userid.PRODUCT)
//
Printing the data set
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INDATASET(userid.PRODUCT) HEX
//
INVOICE
01 INVOICE-RECORD.
*
05 INV-INVOICE-NUMBER PIC 9(6). 6
05 INV-INVOICE-NUMBER-R REDEFINES
INV-INVOICE-NUMBER PIC X(06). 0
05 INV-INVOICE-DATE PIC X(8). 8
05 INV-CUSTOMER-NUMBER PIC X(6). 6
05 INV-PO-NUMBER PIC X(10). 10
05 INV-LINE-ITEM OCCURS 10. 240
10 INV-PRODUCT-CODE PIC X(10). 10
10 INV-QUANTITY PIC S9(7) COMP-3. 4
10 INV-UNIT-PRICE PIC S9(7)V99 COMP-3. 5
10 INV-AMOUNT PIC S9(7)V99 COMP-3. 5
05 INV-INVOICE-TOTAL PIC S9(7)V99 COMP-3. 5
*
Defining the data set
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE userid.INVOICE CLUSTER
DEFINE CLUSTER (NAME(userid.INVOICE) INDEXED KEYS(6,0) LOG(NONE) -
RECORDSIZE(275,275) TRACKS(2,2)) DATA(CONTROLINTERVALSIZE(1024))
//
Three Access Method Services commands are used as below:
- DEFINE ALTERNATEINDEX :-defines the alternate index as a data set to VSAM.
- BLDINDEX :-places the pointers to the relevant records in the alternate index.
- DEFINE PATH:-defines an entity that can be associated with a PL/I file in a DD statement.
DEFINING A ALTERNATE INDEX FOR A VSAM KSDS FILE
//userid1 JOB MSGCLASS=A,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS,REGION=512K
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE userid.INVOICE.ALTINDEX ALTERNATEINDEX
DEFINE ALTERNATEINDEX -
(NAME(userid.INVOICE.ALTINDEX)-
NONUNIQUEKEY -
KEYS(6 14) -
RECORDSIZE(40 400) -
TRACKS(2 2) -
RELATE(userid.INVOICE))
/*
//
EXAMPLE OF THE ALTERNATE INDEX AND DEFINING THE PATH
//userid1 JOB MSGCLASS=A,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS,REGION=512K
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=userid.INVOICE,DISP=OLD
//DD2 DD DSN=userid.INVOICE.ALTINDEX,DISP=OLD
//SYSIN DD *
DEFINE PATH-
(NAME(userid.INVOICE.PATH)-
PATHENTRY(userid.INVOICE.ALTINDEX))
/*
//
EXAMPLE OF RUNNING BLDINDEX
//userid1 JOB MSGCLASS=A,NOTIFY=&SYSUID
//STEP1 EXEC PGM=IDCAMS,REGION=512K
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=userid.INVOICE,DISP=OLD
//DD2 DD DSN=userid.INVOICE.ALTINDEX,DISP=OLD
//SYSIN DD *
BLDINDEX INFILE(DD1) OUTFILE(DD2)
/*
//
INVCTL
- INVCTL-RECORD.
05 INVCTL-RECORD-KEY PIC X.
- INVCTL-NEXT-RECORD-NUMBER PIC 9(6).
Defining the data set
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE userid.INVCTL CLUSTER
DEFINE CLUSTER (NAME(userid.INVCTL) INDEXED KEYS(1,0) -
RECORDSIZE(7,7) TRACKS(1,1)) DATA(CONTROLINTERVALSIZE(1024))
//DB2 Setup.
Some preliminary permissions and definitions need to be done. Some of these will be by the SYSADM group. Rest will be by you. The definitions and grants are done using SPUFI.SYSADM
--CREATE STOGROUP TRGSG02 VOLUMES(H6SDB2) VCAT TRGD1;
--CREATE DATABASE KAMATH STOGROUP TRGSG02;
--GRANT DBADM ON DATABASE KAMATH TO KAMATH;
--GRANT USE OF STOGROUP TRGSG02 TO KAMATH;
--GRANT CREATETS ON DATABASE KAMATH TO KAMATH;
--GRANT CREATETAB ON DATABASE KAMATH TO KAMATH;
--GRANT CREATE ON COLLECTION MURACH TO KAMATH;
--GRANT BINDADD TO KAMATH;
--GRANT ALL ON PACKAGE MURACH.* TO PUBLIC
--GRANT BIND,EXECUTE ON PLAN MURACHP TO KAMATH WITH GRANT OPTION;
KAMATH (User)
--CREATE TABLESPACE SPACE1 IN KAMATH USING STOGROUP TRGSG02
--PRIQTY 5 SECQTY 5 FREEPAGE 0 PCTFREE 0 LOCKSIZE ANY;
--CREATE TABLE KAMATH.CUSTMAS
-- (
-- CUSTNO CHAR (6),
-- FNAME CHAR (20),
-- LNAME CHAR (30),
-- ADDR CHAR (30),
-- CITY CHAR (20),
-- STATE CHAR (2),
-- ZIPCODE CHAR (10)
-- ) IN KAMATH.SPACE1;
--CREATE TABLE KAMATH.INVOICE
-- (
-- INVCUST CHAR (6) NOT NULL,
-- INVNO CHAR (6) NOT NULL,
-- INVDATE DATE NOT NULL,
-- INVSUBT DEC (9, 2) NOT NULL,
-- INVSHIP DEC (7, 2) NOT NULL,
-- INVTAX DEC (7, 2) NOT NULL,
-- INVTOTAL DEC (9, 2) NOT NULL,
-- INVPO CHAR (10) NOT NULL
-- ) IN KAMATH.SPACE1;
--GRANT ALL ON TABLE KAMATH.CUSTMAS TO PUBLIC;
--GRANT ALL ON TABLE KAMATH.INVOICE TO PUBLIC;
--GRANT BIND,EXECUTE ON PLAN MURACHP TO PUBLIC;
DML for testing
--SELECT * FROM KAMATH.INVOICE
--SELECT * FROM KAMATH.CUSTMAS
Use DCLGEN to create INVDCL and CUSTDCL members.
JCL for compilation and creation of a PLAN
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
// JCLLIB ORDER=(userid.PROCLIB)
//*********************************************************
//* DB2 PRECOMPILE THE COBOL PROGRAM
//*********************************************************
//PC EXEC PGM=DSNHPC,
// PARM='HOST(COB2),XREF,SOURCE,FLAG(I),APOST'
//STEPLIB DD DISP=SHR,DSN=DSN510.SDSNLOAD
//DBRMLIB DD DISP=OLD,DSN=userid.DBRMLIB(member)
//SYSCIN DD DSN=&&DSNHOUT,DISP=(MOD,PASS),UNIT=SYSDA,
// SPACE=(800,(500,500))
//SYSLIB DD DSN=userid.DCLGEN.COBOL,DISP=SHR
// DD DSN=userid.COBOL.COPYBOOK,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT1 DD SPACE=(800,(500,500),,,ROUND),UNIT=SYSDA
//SYSUT2 DD SPACE=(800,(500,500),,,ROUND),UNIT=SYSDA
//SYSIN DD DISP=SHR,DSN=userid.COBOL.SOURCE(member)
//********************************************************************
//* COMPILE THE COBOL PROGRAM
//********************************************************************
//CICS EXEC CICSCOB1
//TRN.SYSIN DD DSN=&&DSNHOUT,DISP=(OLD,DELETE)
//LKED.SYSLMOD DD DSN=cics.loadlib(member),DISP=SHR
//LKED.DB2LOAD DD DISP=SHR,DSN=DSN510.SDSNLOAD
//LKED.SYSIN DD *
INCLUDE DB2LOAD(DSNCLI)
NAME DB2INQ2(R)
/*
//
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
// JCLLIB ORDER=(userid.PROCLIB)
//BIND EXEC PGM=IKJEFT01
//STEPLIB DD DISP=SHR,DSN=DSN510.SDSNLOAD
//DBRMLIB DD DISP=OLD,DSN=userid.DBRMLIB
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN S(DSNA)
BIND PACKAGE(MURACH) MEMBER(ORDRENT2)
BIND PACKAGE(MURACH) MEMBER(CUSTMNT2)
BIND PACKAGE(MURACH) MEMBER(DB2INQ2)
END
/*
//
//userid1 JOB NOTIFY=&SYSUID,CLASS=A,MSGLEVEL=(1,1)
// JCLLIB ORDER=(userid.PROCLIB)
//BIND EXEC PGM=IKJEFT01
//STEPLIB DD DISP=SHR,DSN=DSN510.SDSNLOAD
//DBRMLIB DD DISP=OLD,DSN=userid.DBRMLIB
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN S(DSNA)
BIND PLAN(MURACHP) PKLIST(MURACH.*) ACTION(REP) RETAIN ISOLATION(CS)
END
/*
//
Notes:-
- You create DBRM’s with the same name as the program being compiled.
- You first bind each of the DBRM’s into a package list called MURACH.
- You then bind the package list into a plan called MURACHP
- The one single plan will cater for all the programs involved in the transaction.
Programs Mapset Transactions
- INVMENU2 MENSET1 MEN2
- CUSTMNT2 MNTSET1 MNT2
- ORDRENT2 ORDSET1 ORD2
- CUSTINQ2 INQSET1 INQ2
- DB2INQ2 DB2SET1 DIN2
- PUTINV ------- PUTI
- SETCWA ------- SCWA
- SAMP18 ------- SM18
- SYSERR ------- ----
- GETINV ------- ----
- INTEDIT ------- ----
- NUMEDIT ------- ----
Data Sets File-names
- Userid.CUSTMAS CUSTMAS
- Userid.INVOICE INVOICE
- Userid.INVCTL INVCTL
- Userid.PRODUCT PRODUCT
- Userid.INVOICE.PATH INVPATH
DB2ENTRY
DB2Entry ==> MURENT2
Group ==> KAMATH
TRansid ==> MNT2
PLAN ==> MURACHP
DB2TRAN
DB2Tran ==> MURTRN21 Group ==> KAMATH
Entry ==> MURENT2
Transid ==> ORD2
DB2TRAN
DB2Tran ==> MURTRN22 Group ==> KAMATH
Entry ==> MURENT2
Transid ==> INQ2
DB2TRAN
DB2Tran ==> MURTRN23 Group ==> KAMATH
Entry ==> MURENT2
Transid ==> DIN2
No comments
Post a Comment