You are on page 1of 24

//MAT001BD JOB OZA,OZA,MSGLEVEL=(1,1

),
00000100
//
CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID,REGION=4M
00000200
//JOBLIB DD DISP=SHR,DSN=DSN710.SDSNEXIT
00000300
//
DD DISP=SHR,DSN=DSN710.SDSNLOAD
00000400
//
DD DISP=SHR,DSN=CEE.SCEERUN
00000500
//BINDPLAN EXEC PGM=IKJEFT01,DYNAMNBR=20
00000600
//DBRMLIB DD DSN=MAT010.IGYCRCTL.DBRMLIB,DISP=SHR
00000700
//SYSTSPRT DD SYSOUT=*
00000800
//SYSTSPRT DD SYSOUT=*
00000900
//SYSPRINT DD SYSOUT=*
00001000
//SYSUDUMP DD SYSOUT=*
00001100
//SYSOUT DD SYSOUT=*
00001200
//SYSTSIN DD * PLAN,DBRM AND PROGRAM NAMES SHOULD BE SAME
00001300
DSN SYSTEM(DSN)
00001400
BIND PLAN(MAT001BD) MEMBER(VIP1APP) ACT(REP) ISOLATION(CS) 00001500
QUALIFIER(MAT001) OWNER(MAT001)
00001600
END
00001700
//
00001800
//
00001900
//MAT001CL JOB OZA,OZA,MSGLEVEL=(1,1),
00002000
//
CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID
00002100
//JOBPROC JCLLIB ORDER=OZASUP.SUP.PROCLIB
00002200
//CICSMAP EXEC CICSMAP,
00002300
//
OUTC=*,
00002400
//
COPYLIB=MAT010.IGYCRCTL.COPYLIB,
00002500
//
LOADLIB=OZASUP.CICS.LOADLIB,
00002600
//
MAPNAME=EMP01
*NAME OF MAPSET
00002700
//COPY.SYSUT1 DD DSN=MAT010.IGYCRCTL.CICS2(NM),DISP=SHR
00002800
//
00002900
//MAT040EX JOB OZA,OZA,MSGLEVEL=(1,1),
00003000
//
CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID,REGION=6M
00003100
//JOBPROC JCLLIB ORDER=OZASUP.SUP.PROCLIB
00003200
//CICSCOB EXEC CICSCOB,
00003300
//
COPYLIB=MAT010.IGYCRCTL.COPYLIB,
00003400
//
LOADLIB=OZASUP.CICS.LOADLIB
00003500
//TRN.SYSIN DD DSN=MAT010.IGYCRCTL.CICS2(KMTDQWT1),DISP=SHR
00003600
//LKED.SYSIN DD *
00003700
NAME KMTDQWT1(R)
00003800
//
00003900
//MAT026CL JOB PRTY=15,
00004000
//
NOTIFY=&SYSUID
00004100
//JOBPROC JCLLIB ORDER=OZASUP.SUP.PROCLIB
00004200
//DB2CICS EXEC DB2CICS,
00004300
//
DBRMLIB='MAT010.IGYCRCTL.DBRMLIB',
00004400
//
DB2COPY='MAT010.IGYCRCTL.COPYLIB',
00004500
//
COPYLIB='MAT010.IGYCRCTL.COPYLIB',
00004600
//
LOADLIB='OZASUP.CICS.LOADLIB',
00004700
//
MEM=VIP1APP
* SHOULD BE SAME AS PROGRAM NAME 00004800
//SYSIN
DD DSN=MAT010.IGYCRCTL.CICS2(VIP1APP),DISP=SHR
00004900
//LKED.SYSIN
DD *
00005000
INCLUDE SYSLIB(DSNCLI)
00005100
NAME VIP1APP(R)
00005200
//
00005300
ID DIVISION.
00005400
PROGRAM-ID. STD.
00005500
DATA DIVISION.
00005600
WORKING-STORAGE SECTION.
00005700
COPY DFHAID.
00005800
COPY TDQMS1.
00005900
01 TD-DATA.
00006000

02 TD-NO
PIC 9(10).
02 TD-NAME PIC X(10).
02 TD-SAL PIC 9(10).
01 COMM
PIC X(50).
01 DATE1
PIC S9(4) COMP.
01 D
PIC X(10).
01 T
PIC X(08).
LINKAGE SECTION.
01 DFHCOMMAREA PIC X(50).
PROCEDURE DIVISION.
MOVE LOW-VALUES TO TDQMP1I.
IF EIBCALEN = 00
PERFORM DATE-TIME-PARA THRU
PERFORM SEND-RETURN-PARA THRU
ELSE
PERFORM RECEIVE-PARA
THRU
PERFORM EVALUATE-PARA
THRU
PERFORM STOP-RUN-PARA
THRU
END-IF.
DATE-TIME-PARA.
EXEC CICS
ASKTIME
ABSTIME(DATE1)
END-EXEC.
EXEC CICS
FORMATTIME
ABSTIME(DATE1)
DDMMYYYY(D)
DATESEP('-')
TIME(T)
TIMESEP(':')
END-EXEC.
MOVE D TO DATEO.
MOVE T TO TIMEO.
DATE-TIME-PARA-END. EXIT.
SEND-RETURN-PARA.
EXEC CICS
SEND
MAP('TDQMP1')
MAPSET('TDQMS1')
ERASE
END-EXEC.
EXEC CICS
RETURN
TRANSID('TTD1')
COMMAREA(COMM)
END-EXEC.
SEND-RETURN-PARA-END. EXIT.
RECEIVE-PARA.
EXEC CICS
RECEIVE
MAP('TDQMP1')
MAPSET('TDQMS1')
END-EXEC.
RECEIVE-PARA-END. EXIT.
EVALUATE-PARA.
MOVE SNOI TO TD-NO.
MOVE SNMI TO TD-NAME.
MOVE SPGI TO TD-SAL.
EVALUATE EIBAID

DATE-TIME-PARA-END
SEND-RETURN-PARA-END
RECEIVE-PARA-END
EVALUATE-PARA-END
STOP-RUN-PARA-END

00006100
00006200
00006300
00006400
00006500
00006600
00006700
00006800
00006900
00007000
00007100
00007200
00007300
00007400
00007500
00007600
00007700
00007800
00007900
00008000
00008100
00008200
00008300
00008400
00008500
00008600
00008700
00008800
00008900
00009000
00009100
00009200
00009300
00009400
00009500
00009600
00009700
00009800
00009900
00010000
00010100
00010200
00010300
00010400
00010500
00010600
00010700
00010800
00010900
00011000
00011100
00011200
00011300
00011400
00011500
00011600
00011700
00011800
00011900
00012000

MOVE LOW-VALUES TO EMP02I. SEND-RETURN-PARA. WORKING-STORAGE SECTION. P1. PROCEDURE DIVISION. DATA DIVISION. DATE-TIME-PARA. 01 DATE1 PIC S9(4) COMP. EXEC CICS ASKTIME ABSTIME(DATE1) END-EXEC. ENVIRONMENT DIVISION. MOVE D TO DATEO. DATE-TIME-PARA-END. LINKAGE SECTION. EXEC CICS FORMATTIME ABSTIME(DATE1) DDMMYYYY(D) DATESEP('-') TIME(T) TIMESEP(':') END-EXEC. ID DIVISION. SEND-RETURN-PARA-END. 02 EMPSAL PIC 9(10). DATE-TIME-PARA-END SEND-RETURN-PARA-END RECEIVE-PARA-END EVALUATE-PARA-END STOP-RUN-PARA-END 00012100 00012200 00012300 00012400 00012500 00012600 00012700 00012800 00012900 00013000 00013100 00013200 00013300 00013400 00013500 00013600 00013700 00013800 00013900 00014000 00014100 00014200 00014300 00014400 00014500 00014600 00014700 00014800 00014900 00015000 00015100 00015200 00015300 00015400 00015500 00015600 00015700 00015800 00015900 00016000 00016100 00016200 00016300 00016400 00016500 00016600 00016700 00016800 00016900 00017000 00017100 00017200 00017300 00017400 00017500 00017600 00017700 00017800 00017900 00018000 . STOP-RUN-PARA-END. EXIT. 01 T PIC X(08). 01 COMM PIC X(40). 02 EMPNM PIC X(10). EXIT. 01 DFHCOMMAREA PIC X(40). EXEC CICS RETURN END-EXEC. IF EIBCALEN = 00 PERFORM DATE-TIME-PARA THRU PERFORM SEND-RETURN-PARA THRU ELSE PERFORM RECEIVE-PARA THRU PERFORM EVALUATE-PARA THRU PERFORM STOP-RUN-PARA THRU END-IF. 01 EMPREC. COPY DFHAID. STOP-RUN-PARA. PERFORM DATE-TIME-PARA THRU PERFORM SEND-RETURN-PARA THRU EVALUATE-PARA-END. 01 ITEM-NO PIC S9(4) COMP.WHEN DFHPF1 EXEC CICS WRITEQ TD QUEUE('QKM3') FROM(TD-DATA) END-EXEC END-EVALUATE. PROGRAM-ID. COPY EMP01. EXIT. 01 D PIC X(10). MOVE T TO TIMEO. 02 EMPLOC PIC X(10). DATE-TIME-PARA-END.

EXIT. EXIT. EXEC CICS RETURN TRANSID('TKM3') COMMAREA(COMM) END-EXEC. WORKING-STORAGE SECTION. 01 TS-DATA. EVALUATE EIBAID WHEN DFHPF2 EXEC CICS READQ TS QUEUE('QKAM3') INTO(EMPREC) ITEM(ITEM-NO) END-EXEC MOVE NMI TO EMPNM MOVE LOCI TO EMPLOC MOVE SALI TO EMPSAL MOVE 'READ SUCCESS' TO MSGO WHEN DFHPF5 MOVE LOW-VALUES TO EMP02O WHEN DFHPF3 EXEC CICS RETURN END-EXEC END-EVALUATE. PROGRAM-ID. ADD 1 TO ITEM-NO. 02 TS-NO PIC 9(13). RECEIVE-PARA-END. RECEIVE-PARA. STOP-RUN-PARA. EXEC CICS RETURN END-EXEC. ID DIVISION. STD. 01 COMM PIC X(31). 02 TS-NAME PIC X(12). PERFORM DATE-TIME-PARA THRU DATE-TIME-PARA-END. EVALUATE-PARA. EXIT. COPY MSTD01S. EXIT. 77 TS-ITEM PIC S9(4) COMP VALUE 0. 00018100 00018200 00018300 00018400 00018500 00018600 00018700 00018800 00018900 00019000 00019100 00019200 00019300 00019400 00019500 00019600 00019700 00019800 00019900 00020000 00020100 00020200 00020300 00020400 00020500 00020600 00020700 00020800 00020900 00021000 00021100 00021200 00021300 00021400 00021500 00021600 00021700 00021800 00021900 00022000 00022100 00022200 00022300 00022400 00022500 00022600 00022700 00022800 00022900 00023000 00023100 00023200 00023300 00023400 00023500 00023600 00023700 00023800 00023900 00024000 .EXEC CICS SEND MAP('EMP02') MAPSET('EMP01') ERASE END-EXEC. SEND-RETURN-PARA-END. COPY DFHAID. 02 TS-PER PIC 9(2). EVALUATE-PARA-END. STOP-RUN-PARA-END. PERFORM SEND-RETURN-PARA THRU SEND-RETURN-PARA-END. EXEC CICS RECEIVE MAP('EMP02') MAPSET('EMP01') END-EXEC. DATA DIVISION.

00024100 00024200 00024300 00024400 00024500 00024600 00024700 00024800 00024900 00025000 00025100 00025200 00025300 00025400 00025500 00025600 00025700 00025800 00025900 00026000 00026100 00026200 00026300 00026400 00026500 00026600 00026700 00026800 00026900 00027000 00027100 00027200 00027300 00027400 00027500 00027600 00027700 00027800 00027900 00028000 00028100 00028200 00028300 00028400 00028500 00028600 00028700 00028800 00028900 00029000 00029100 00029200 00029300 00029400 00029500 00029600 00029700 00029800 00029900 00030000 . 01 D PIC X(10). EXEC CICS SEND MAP('MSTD01') MAPSET('MSTD01S') END-EXEC EXEC CICS RECEIVE MAP('MSTD01') MAPSET('MSTD01S') END-EXEC EVALUATE EIBAID WHEN DFHPF2 ADD 1 TO TS-ITEM EXEC CICS READQ TS QUEUE('MAN7') INTO(TS-DATA) ITEM(TS-ITEM) END-EXEC MOVE TS-NO TO MSTDNOO MOVE TS-NAME TO MSTDNMO MOVE TS-PER TO MSTDPGO IF MSTDNMO = 'KAVYA' MOVE '424000' TO TS-NO MOVE 'ANUSHA' TO TS-NAME MOVE '99' TO TS-PER EXEC CICS REWRITEQ TS QUEUE('MAN7') FROM(TS-DATA) ITEM(TS-ITEM) END-EXEC END-EVALUATE. PROCEDURE DIVISION. WORKING-STORAGE SECTION. STOP RUN. 02 EMPLOC PIC X(10). MOVE LOW-VALUES TO EMP02I. 02 EMPNM PIC X(10). ENVIRONMENT DIVISION.LINKAGE SECTION. DATA DIVISION. PROGRAM-ID. GO PARA-1. 01 EMPREC. 01 T PIC X(08). 02 EMPSAL PIC 9(10). PARA-1. LINKAGE SECTION. COPY EMP01. 01 COMM PIC X(40). ID DIVISION. PROCEDURE DIVISION. 01 DFHCOMMAREA PIC X(40). 01 DATE1 PIC S9(4) COMP. MOVE LOW-VALUES TO MSTD01I. 01 DFHCOMMAREA PIC X(31). 01 ITEM-NO PIC S9(4) COMP. P1. COPY DFHAID.

IF EIBCALEN = 00 PERFORM DATE-TIME-PARA PERFORM SEND-RETURN-PARA ELSE PERFORM RECEIVE-PARA PERFORM EVALUATE-PARA PERFORM DATE-TIME-PARA PERFORM SEND-RETURN-PARA END-IF. DATE-TIME-PARA. RECEIVE-PARA-END. SEND-RETURN-PARA. DATE-TIME-PARA-END. EXEC CICS FORMATTIME ABSTIME(DATE1) DDMMYYYY(D) DATESEP('-') TIME(T) TIMESEP(':') END-EXEC. EXIT. MOVE T TO TIMEO. GOBACK. EXEC CICS SEND MAP('EMP02') MAPSET('EMP01') ERASE END-EXEC. EVALUATE EIBAID WHEN DFHPF2 ADD 1 TO ITEM-NO MOVE NMI TO EMPNM MOVE LOCI TO EMPLOC MOVE SALI TO EMPSAL EXEC CICS WRITEQ TS QUEUE('QKAM1') FROM(EMPREC) ITEM(ITEM-NO) RESP(ERR) END-EXEC THRU DATE-TIME-PARA-END THRU SEND-RETURN-PARA-END THRU THRU THRU THRU RECEIVE-PARA-END EVALUATE-PARA-END DATE-TIME-PARA-END SEND-RETURN-PARA-END 00030100 00030200 00030300 00030400 00030500 00030600 00030700 00030800 00030900 00031000 00031100 00031200 00031300 00031400 00031500 00031600 00031700 00031800 00031900 00032000 00032100 00032200 00032300 00032400 00032500 00032600 00032700 00032800 00032900 00033000 00033100 00033200 00033300 00033400 00033500 00033600 00033700 00033800 00033900 00034000 00034100 00034200 00034300 00034400 00034500 00034600 00034700 00034800 00034900 00035000 00035100 00035200 00035300 00035400 00035500 00035600 00035700 00035800 00035900 00036000 . SEND-RETURN-PARA-END. EXEC CICS RETURN TRANSID('KM10') COMMAREA(COMM) END-EXEC. EXIT. MOVE D TO DATEO. EXEC CICS ASKTIME ABSTIME(DATE1) END-EXEC. EXEC CICS RECEIVE MAP('EMP02') MAPSET('EMP01') END-EXEC. EXIT. EVALUATE-PARA. RECEIVE-PARA.

IF EIBCALEN = 00 PERFORM DATE-TIME-PARA THRU DATE-TIME-PARA-END PERFORM SEND-RETURN-PARA THRU SEND-RETURN-PARA-END ELSE PERFORM RECEIVE-PARA THRU RECEIVE-PARA-END PERFORM EVALUATE-PARA THRU EVALUATE-PARA-END PERFORM STOP-RUN-PARA THRU STOP-RUN-PARA-END END-IF. ID DIVISION. PROGRAM-ID. COPY EMP01. LINKAGE SECTION. 02 EMPLOC PIC X(10). WORKING-STORAGE SECTION.IF ERR = DFHRESP(NORMAL) MOVE 'WRITE SUCCESS ' TO MSGO ELSE MOVE 'WRITE FAIL ' TO MSGO END-IF WHEN DFHPF3 ADD 1 TO ITEM-NO EXEC CICS READQ TS QUEUE('QKAM1') INTO(EMPREC) ITEM(ITEM-NO) RESP(ERR) END-EXEC IF ERR = DFHRESP(NORMAL) MOVE NMI TO EMPNM MOVE LOCI TO EMPLOC MOVE SALI TO EMPSAL MOVE 'READ SUCCESS ' TO MSGO ELSE MOVE 'READ FAIL ' TO MSGO END-IF WHEN DFHPF5 MOVE LOW-VALUES TO EMP02O END-EVALUATE. EVALUATE-PARA-END. ENVIRONMENT DIVISION. MOVE LOW-VALUES TO EMP02I. EXIT. 01 COMM PIC X(40). 01 D PIC X(10). EXEC CICS ASKTIME ABSTIME(DATE1) END-EXEC. 01 DFHCOMMAREA PIC X(40). 01 DATE1 PIC S9(4) COMP. DATA DIVISION. P1. 01 ITEM-NO PIC S9(4) COMP. 02 EMPNM PIC X(10). 01 EMPREC. PROCEDURE DIVISION. COPY DFHAID. 01 T PIC X(08). DATE-TIME-PARA. 02 EMPSAL PIC 9(10). EXEC CICS 00036100 00036200 00036300 00036400 00036500 00036600 00036700 00036800 00036900 00037000 00037100 00037200 00037300 00037400 00037500 00037600 00037700 00037800 00037900 00038000 00038100 00038200 00038300 00038400 00038500 00038600 00038700 00038800 00038900 00039000 00039100 00039200 00039300 00039400 00039500 00039600 00039700 00039800 00039900 00040000 00040100 00040200 00040300 00040400 00040500 00040600 00040700 00040800 00040900 00041000 00041100 00041200 00041300 00041400 00041500 00041600 00041700 00041800 00041900 00042000 .

SEND-RETURN-PARA. DATE-TIME-PARA-END. PERFORM DATE-TIME-PARA THRU DATE-TIME-PARA-END. EXEC CICS RETURN END-EXEC. PERFORM SEND-RETURN-PARA THRU SEND-RETURN-PARA-END. MOVE T TO TIMEO. PRINT NOGEN 00042100 00042200 00042300 00042400 00042500 00042600 00042700 00042800 00042900 00043000 00043100 00043200 00043300 00043400 00043500 00043600 00043700 00043800 00043900 00044000 00044100 00044200 00044300 00044400 00044500 00044600 00044700 00044800 00044900 00045000 00045100 00045200 00045300 00045400 00045500 00045600 00045700 00045800 00045900 00046000 00046100 00046200 00046300 00046400 00046500 00046600 00046700 00046800 00046900 00047000 00047100 00047200 00047300 00047400 00047500 00047600 00047700 00047800 00047900 00048000 .FORMATTIME ABSTIME(DATE1) DDMMYYYY(D) DATESEP('-') TIME(T) TIMESEP(':') END-EXEC. MOVE SALI TO EMPSAL. EXIT. EXEC CICS RECEIVE MAP('EMP02') MAPSET('EMP01') END-EXEC. EXIT. STOP-RUN-PARA-END. EXIT. SEND-RETURN-PARA-END. EXIT. MOVE LOCI TO EMPLOC. RECEIVE-PARA-END. MOVE D TO DATEO. RECEIVE-PARA. EVALUATE-PARA-END. EVALUATE-PARA. EXIT. ADD 1 TO ITEM-NO. MOVE NMI TO EMPNM. STOP-RUN-PARA. EVALUATE EIBAID WHEN DFHPF2 EXEC CICS WRITEQ TS QUEUE('QKAM3') FROM(EMPREC) ITEM(ITEM-NO) END-EXEC MOVE 'NSERT SUCCESS' TO MSGO WHEN DFHPF5 MOVE LOW-VALUES TO EMP02O WHEN DFHPF3 EXEC CICS RETURN END-EXEC END-EVALUATE. EXEC CICS RETURN TRANSID('TKM3') COMMAREA(COMM) END-EXEC. EXEC CICS SEND MAP('EMP02') MAPSET('EMP01') ERASE END-EXEC.

X00053900 INITIAL='__________' 00054000 . X00053800 ATTRB=(PROT. X00051200 COLOR=GREEN 00051300 DFHMDF POS=(14.LEMP321 DFHMSD TYPE=&SYSPARM. X00053400 ATTRB=(PROT. X00048800 TERM=3270. X00050800 INITIAL='____' 00050900 MSG1 DFHMDF POS=(12.NORM). X00049300 COLUMN=1. X00050700 ATTRB=(UNPROT. X00051700 INITIAL='PRESS PF1-TO GET THE DETAILS' 00051800 ********************************************************************10 00051900 EMP2 DFHMDI SIZE=(24. X00053700 LENGTH=10. X00048700 TIOAPFX=YES.10).NORM). X00048900 EXTATT=YES 00049000 ********************************************************************10 00049100 EMP1 DFHMDI SIZE=(24. X00052200 JUSTIFY=LEFT 00052300 ***************LINE 2 OF SCREEN**************************************14 00052400 DFHMDF POS=(9. X00049700 LENGTH=40. X00048200 MODE=INOUT.NORM).NORM.38). X00049900 COLOR=PINK. X00052600 ATTRB=(PROT. X00049400 JUSTIFY=LEFT 00049500 ***************LINE 1 OF SCREEN**************************************14 00049600 DFHMDF POS=(5. X00053100 INITIAL='____' 00053200 DFHMDF POS=(10. X00048500 DSATTS=COLOR. X00052000 LINE=1. X00048300 CTRL=FREEKB.NORM. X00050300 ATTRB=(ASKIP.NORM). X00050200 LENGTH=25.20). X00051100 ATTRB=(NORM. X00051000 LENGTH=50.2). X00050400 INITIAL='ENTER THE EMPLOYEE NO' 00050500 EMPI DFHMDF POS=(7. X00053000 ATTRB=(PROT. X00048400 STORAGE=AUTO. X00050600 LENGTH=04. X00051400 LENGTH=40.NORM). X00052500 LENGTH=15. X00050000 INITIAL='THE EMPLOYEE DETAIL SCREEN' 00050100 DFHMDF POS=(7.80).80). X00053300 LENGTH=15.10). X00048600 MAPATTS=COLOR. X00051600 COLOR=PINK.20). X00052900 LENGTH=04. X00049200 LINE=1.NUM).40). X00051500 ATTRB=(ASKIP. X00048100 LANG=COBOL.PROT).20).38). X00052100 COLUMN=1.IC). X00049800 ATTRB=(ASKIP.NORM). X00052700 INITIAL='EMPLOYEE NO:' 00052800 EMPO DFHMDF POS=(9. X00053500 INITIAL='EMP NAME:' 00053600 EMPN DFHMDF POS=(10.

ATTRB=(ASKIP.... 05 TSQ-RECORD.20). ATTRB=(PROT. LENGTH=30.. ATTRB=(UNPROT.MODE=INOUT DFHMDI SIZE=(24.LENGTH=03.LENGTH=02.18).INITIAL='F3-MUL'. LENGTH=40.30)... X00054100 X00054200 X00054300 00054400 X00054500 X00054600 X00054700 00054800 X00054900 X00055000 X00055100 00055200 X00055300 X00055400 X00055500 X00055600 00055700 00055800 00055900 X00056000 00056100 00056200 00056300 00056400 00056500 x00056600 x00056700 00056800 00056900 00057000 x00057100 x00057200 00057300 00057400 00057500 x00057600 00057700 00057800 x00057900 00058000 00058100 00058200 00058300 00058400 00058500 00058600 00058700 00058800 00058900 00059000 00059100 00059200 00059300 00059400 00059500 00059600 00059700 00059800 00059900 00060000 . 07 TSQ-REC-ELEMENT-1 PIC X(05) VALUE SPACES.18). 07 TSQ-REC-ELEMENT-2 PIC X(10) VALUE SPACES..39).LENGTH=16 DFHMDF POS=(08.LENGTH=06 DFHMDF POS=(15.PICOUT='9(02)'.INITIAL='RESULT'... CTRL=(FRSET. 03 CA-NUMITEMS PIC S9(04) COMP VALUE ZEROS.27).LANG=COBOL.LENGTH=06 DFHMDF POS=(10.80). LENGTH=15.ATTRB=PROT DFHMDF POS=(10..LENGTH=07 DFHMSD TYPE=FINAL END ******* THIS IS PAGING LOGIC PROGRAM ************** ******* THIS PROGRAM WRITEN BY MR.26).LINE=01.LENGTH=06 DFHMDF POS=(14.NUM)... PICOUT='Z(03)' DFHMDF POS=(12..LENGTH=19 DFHMDF POS=(09. 03 TSQ-PAGE-ENTRY OCCURS 10 TIMES.NUM) DFHMDF POS=(08.KAMESH ************** * IF PF7 IS FOR SCROLL DOWN.INITIAL='F6-NEXT'.LENGTH=02..INITIAL='MESSAGE'..NUM) DFHMDF POS=(09.INITIAL='ENTER FIRST NUMBER'...STORAGE=AUTO.FSET. * IF PF8 IS FOR SCROLL UP.INITIAL='F2-SUB'.FREEKB).10). ATTRB=(UNPROT. INITIAL='.43).10).38).NORM). INITIAL='__________' DFHMDF POS=(20.LENGTH=30..30). INITIAL='DEPT NAME:' DFHMDF POS=(11.LENGTH=16 DFHMDF POS=(02.ATTRB=ASKIP DFHMDF POS=(09.FSET) DFHMDF POS=(14. ATTRB=(PROT.DNAME MSG2 EMP01 EMP02 FNO SENO RES MSG DFHMDF POS=(11.INITIAL='________________'.10).20). 01 TSQ-PAGE-TABLE.40).NORM.20).' DFHMDF POS=(14. ATTRB=(UNPROT..FSET.18).LENGTH=06 DFHMDF POS=(14.NORM).LENGTH=18 DFHMDF POS=(08.LENGTH=07 DFHMDF POS=(12.INITIAL='F1-ADD'.10).INITIAL='____'..TIOAPFX=YES.NORM). A100-SOME-PARA-NAME. LENGTH=10.INITIAL='EMPLOYEE DETAILS'...IC..INITIAL='ENTER SECOND NUMBER'. 03 CA-ITEM PIC S9(04) COMP VALUE +1. COLOR=PINK.... INITIAL='PRESS PF3-TO EXIT' DFHMSD TYPE=FINAL END DFHMSD TYPE=&SYSPARM.INITIAL='____'.INITIAL='----------------'.INITIAL='____'..42)..COLUMN=01 DFHMDF POS=(01.PICOUT='9(02)'. PICIN='9(02)'.LENGTH=06 DFHMDF POS=(15.10).20). PICIN='9(02)'. ATTRB=(PROT.. PROCEDURE DIVISION.INITIAL='F5-CLR'.

00061900 00062000 IF SOME-ERROR 00062100 PERFORM SOME ERROR ROUTINE .00060100 00060200 00060300 00060400 EXEC CICS READNEXT . 00062200 END-IF. 00064900 P000-PAGING-PROCESS. 00060500 00060600 IF RESP-CODE = ZEROS 00060700 IF TSQ-SUB > 10 00060800 PERFORM A999-WRITEQ-TS THRU A999-EXIT 00060900 ELSE 00061000 ADD 1 TO TSQ-SUB 00061100 MOVE RECORD ELEMENTS TO TSQ-REC-ELEMENT-1 THRU 5 (TSQ00061200 END-IF 00061300 ELSE 00061400 IF RESP-CODE = DFHRESP(NOTFND) OR DFHRESP(ENDFILE) 00061500 SET NO-MORE-RECORDS TO TRUE 00061600 END-IF 00061700 END-IF 00061800 END-PERFORM. 00063900 00064000 IF RESP-CODE = ZEROS 00064100 INITIALIZE TSQ-PAGE-TABLE 00064200 MOVE ZEROS TO TSQ-SUB 00064300 ELSE 00064400 SET SOME-ERROR TO TRUE 00064500 END-IF. 00062700 PERFORM Z998-RETURN-TRANSID THRU Z998-EXIT. 00065000 00065100 IF EIBAID = DFHPF7 00065200 COMPUTE CA-ITEM = CA-ITEM 1 00065300 END-COMPUTE 00065400 IF CA-ITEM = 0 00065500 MOVE +1 TO CA-ITEM 00065600 MOVE FIRST PAGE MESSAGE TO MESSAGE AREA ON THE MAP 00065700 ELSE 00065800 PERFORM Y000-READQ-TS THRU Y000-EXIT 00065900 PERFORM Z900-LOAD-MAP THRU Z900-EXIT 00066000 PERFORM UNTIL NO-MORE-RECORDS OR SOME-ERROR . 00062600 PERFORM Z997-SEND-MAP THRU Z997-EXIT. 00064800 EXIT. 00062500 PERFORM Z900-LOAD-MAP THRU Z900-EXIT. 00063000 EXIT. 00062800 00062900 A100-EXIT. 00063100 00063200 A999-WRITEQ-TS. 00062300 00062400 PERFORM Y000-READQ-TS THRU Y000-EXIT. 00064600 00064700 A999-EXIT. 00063300 00063400 EXEC CICS WRITEQ TS QUEUE (NAME) 00063500 FROM (TSQ-PAGE-TABLE) 00063600 NUMITEMS (CA-NUMITEMS) 00063700 RESP (RESP-CODE) 00063800 END-EXEC.

00069800 00069900 Z900-EXIT. 00071400 PROGRAM-ID. 00072000 . 00070100 00070200 Z997-SEND-MAP. 00068400 00068500 IF RESP-CODE > ZEROS 00068600 PERFORM SOME ERROR ROUTINE 00068700 END-IF. 00070000 EXIT. 00069200 00069300 PEFORM VARYING TSQ-SUB FROM 1 BY 1 00069400 UNTIL TSQ-SUB > 10 00069500 MOVE TSQ-REC-ELEMENT-1 THRU 5 (TSQ-SUB) TO 00069600 MAP-REC-ELEMENT-1 THRU 5 (TSQ-SUB) REDEFINED SYMBOLI00069700 END-PERFORM. 00071500 DATA DIVISION. 00067500 P000-EXIT. PROGRAM1. 00071600 WORKING-STORAGE SECTION. 00070700 Z998-RETURN-TRANSID 00070800 00070900 EXEC CICS RETURN TRANSID . DATE & TIME. 00068800 00068900 Y000-EXIT. 00071700 01 OPERATION PIC X(01). 00070300 00070400 SET MAP FIELD ATTRIBUTES. 00067600 EXIT. 00067400 PERFORM Z998-RETURN-TRANSID THRU Z998-EXIT. 00066100 00066200 00066300 00066400 00066500 00066600 00066700 00066800 00066900 00067000 00067100 00067200 00067300 PERFORM Z997-SEND-MAP THRU Z997-EXIT. 00071800 COPY LEMP321. 00069000 EXIT. 00071900 COPY DFHAID. 00071200 EXIT.END-IF ELSE COMPUTE CA-ITEM = CA-NUMITEMS + 1 END-COMPUTE IF CA-ITEM > CA-NUMITEMS MOVE CA-NUMITEMS TO CA-ITEM MOVE LAST PAGE MESSAGE TO MESSAGE AREA ON THE MAP ELSE PERFORM Y000-READQ-TS THRU Y000-EXIT PERFORM Z900-LOAD-MAP THRU Z900-EXIT END-IF END-IF. 00071000 00071100 Z998-EXIT. 00071300 IDENTIFICATION DIVISION. ETC 00070500 00070600 EXEC CICS SEND MAP . PAGE NUMBER. 00067800 00067900 EXEC CICS READQ TS QUEUE (NAME) 00068000 INTO (TSQ-PAGE-TABLE) 00068100 ITEM (CA-ITEM) 00068200 RESP (RESP-CODE) 00068300 END-EXEC. 00067700 Y000-READQ-TS. 00069100 Z900-LOAD-MAP.

COMMUNICATION-AREA PIC X(01).01 01 01 01 01 01 EXEC SQL INCLUDE SQLCA END-EXEC.DEPT_NO.DEPT_NAME INTO :WS-EMP-NO1. WS-EMP-NAME PIC X(10). 1000-EXIT. EXEC CICS RECEIVE MAP('EMP1') MAPSET('LEMP321') END-EXEC MOVE EMPII TO WS-EMP-NO.EMP E. 01 DFHCOMMAREA PIC X(01). :WS-EMP-NAME.EMP_NO. EVALUATE TRUE WHEN EIBCALEN = 0 DISPLAY 'IN ENTER' MOVE LOW-VALUES TO EMP1O MOVE 'PLEASE ENTER THE VALUES' TO MSG1O EXEC CICS SEND MAP('EMP1') MAPSET('LEMP321') END-EXEC WHEN EIBAID = DFHPF1 DISPLAY 'IN DETAILS' MOVE LOW-VALUES TO EMP2O PERFORM 2000-SEND-DETAILS THRU 2000-EXIT PERFORM 3000-RETURN-PARA THRU 3000-EXIT END-EVALUATE. WS-EMP-NO PIC S9(9) USAGE COMP. WS-DEPT-NO PIC S9(9) USAGE COMP. 00072100 00072200 00072300 00072400 00072500 00072600 00072700 00072800 00072900 00073000 00073100 00073200 00073300 00073400 00073500 00073600 00073700 00073800 00073900 00074000 00074100 00074200 00074300 00074400 00074500 00074600 00074700 00074800 00074900 00075000 00075100 00075200 00075300 00075400 00075500 00075600 00075700 00075800 00075900 00076000 00076100 00076200 00076300 00076400 00076500 00076600 00076700 00076800 00076900 00077000 00077100 00077200 00077300 00077400 00077500 00077600 00077700 00077800 00077900 00078000 .EMP_NAME. EXEC SQL SELECT E. EXIT. WS-DEPT-NAME PIC X(10). PROCEDURE DIVISION. EXEC CICS RETURN TRANSID('LSP1') COMMAREA(COMMUNICATION-AREA) END-EXEC. 1000-RECEIVE-MAP-DATA. D. :WS-DEPT-NAME FROM LL9130A. WS-EMP-NO1 PIC S9(9) USAGE COMP. 2000-SEND-DETAILS. E. E. 0000-EXIT-PARA. EXIT. 0000-PROCESS-ENTRY. IF EIBCALEN NOT = 0 DISPLAY 'IN RECV' PERFORM 1000-RECEIVE-MAP-DATA THRU 1000-EXIT END-IF. :WS-DEPT-NO. LINKAGE SECTION.

00080500 EMP01 DFHMSD TYPE=&SYSPARM.ATTRB=ASKIP 00081600 DFHMDF POS=(02. X00081400 ATTRB=(UNPROT.INITIAL='MESSAGE :'.LENGTH=10 00081200 DFHMDF POS=(02. X00083200 LENGTH=30 00083300 DFHMDF POS=(21.70).LENGTH=13 00084000 .70).PICOUT='9(05)' 00081500 DFHMDF POS=(02.01).01).PICOUT='Z(06)'.INITIAL='UPDATE CONF:PF6'.01).LENGTH=10 00083500 DFHMDF POS=(21. 00079400 EXIT.FSET) 00082500 DFHMDF POS=(06.INITIAL='_____'.INITIAL='EMPLOC :'.12). 00079700 EXEC CICS SEND MAP('EMP2') 00079800 MAPSET('LEMP321') 00079900 ERASE 00080000 END-EXEC 00080100 EXEC CICS RETURN END-EXEC.LENGTH=10 00081300 ITEM DFHMDF POS=(02. EVALUATE SQLCODE WHEN 00 MOVE WS-EMP-NO1 TO EMPOO MOVE WS-EMP-NAME TO EMPNO MOVE WS-DEPT-NAME TO DNAMEO WHEN OTHER MOVE 'DATA NOT FOUND' TO MSG2O END-EVALUATE.LENGTH=10.INITIAL='______________________________'.01).LENGTH=06.INITIAL='DATE:'.LENGTH=13 00083900 DFHMDF POS=(23.64).EMP_NO = :WS-EMP-NO END-EXEC.30).26).30).01).LENGTH=10 00082700 SAL DFHMDF POS=(08.LENGTH=16 00080900 DFHMDF POS=(02.LENGTH=16 00083800 DFHMDF POS=(23.12).19).LENGTH=10 00083700 DFHMDF POS=(23.DEPT D WHERE E.LENGTH=08 00081800 DFHMDF POS=(04.FSET) 00082900 DFHMDF POS=(08.INITIAL='CLEAR :PF5'.INITIAL='TIME:'.LENGTH=01 00083000 DFHMDF POS=(10.DEPT_NO AND E.STORAGE=AUTO.LINE=01.INITIAL='INSERT:PF2'.64).INITIAL='______'.39). X00082800 PICIN='9(06)'.23).TIOAPFX=YES.INITIAL='EMPNAME :'.PICOUT='X(10)'.PICIN='X(10)' 00082100 DFHMDF POS=(04.12).80).INITIAL='__________'.FREEKB).INITIAL='ITEM NO :'.LENGTH=11 00083600 DFHMDF POS=(21.ATTRB=ASKIP 00082600 DFHMDF POS=(08.INITIAL='EMPLOYEE DETAILS'.LENGTH=16 00081000 DFHMDF POS=(01.23).ATTRB=PROT.INITIAL='READPREV :PF7'.LENGTH=05 00081100 DATE DFHMDF POS=(01.12). 00080200 00080300 3000-EXIT.LANG=COBOL.20).36).LENGTH=10 00082300 LOC DFHMDF POS=(06.18).PICIN='9(05)'.FSET).ATTRB=ASKIP 00082200 DFHMDF POS=(06.ATTRB=(UNPROT.LENGTH=10 00081900 NM DFHMDF POS=(04.INITIAL='________'.FSET. X00080600 CTRL=(FRSET.IC. 00079500 00079600 3000-RETURN-PARA.01).NUM).ATTRB=(UNPROT.INITIAL='READNEXT :PF8'.ATTRB=(UNPROT.12).LENGTH=10 00083400 DFHMDF POS=(21.COLUMN=01 00080800 DFHMDF POS=(01.LENGTH=05 00081700 TIME DFHMDF POS=(02.LENGTH=10 00083100 MSG DFHMDF POS=(10.DEPT_NO = D.INITIAL='READ :PF3'.LL9130A.MODE=INOUT 00080700 EMP02 DFHMDI SIZE=(24. 00078100 00078200 00078300 00078400 00078500 00078600 00078700 00078800 00078900 00079000 00079100 00079200 00079300 2000-EXIT.INITIAL='REWRITE:PF4'.01).LENGTH=10. 00080400 EXIT.INITIAL='----------------'. X00082400 PICIN='X(10)'.INITIAL='__________'.LENGTH=05.INITIAL='EMPSAL :'. X00082000 PICOUT='X(10)'.INITIAL='__________'.13).

77 TS-ITEM PIC S9(4) COMP VALUE 0.MATTS. -INSERT INTO MAT001. 02 TS-NAME PIC X(12). 01 COMM PIC X(31).DEPT321 VALUES(1002. STD. DATA DIVISION.DFHMSD TYPE=FINAL END ID DIVISION. MOVE LOW-VALUES TO MSTD01I. GO PARA-1.'MARKETING'). 01 DFHCOMMAREA PIC X(31).CREATE UNIQUE INDEX INDX1 ON MAT001.PRIMARY KEY(DEPT_NO)) IN -MATDB.DEPT321 VALUES(1001. -. 02 TS-NO PIC 9(13). LINKAGE SECTION. -INSERT INTO MAT001. -DEPT_NAME CHAR(10).'HR'). 02 TS-PER PIC 9(2). WORKING-STORAGE SECTION. PARA-1.DEPT321(DEPT_NO SMALLINT NOT NULL.CREATE TABLE MAT001.DEPT321(DEPT_NO). PROGRAM-ID. 01 TS-DATA. COPY DFHAID. STOP RUN. EXEC CICS SEND MAP('MSTD01') MAPSET('MSTD01S') END-EXEC EXEC CICS RECEIVE MAP('MSTD01') MAPSET('MSTD01S') END-EXEC EVALUATE EIBAID WHEN DFHPF2 ADD 1 TO TS-ITEM EXEC CICS READQ TS QUEUE('MAN7') INTO(TS-DATA) ITEM(TS-ITEM) END-EXEC MOVE TS-NO TO MSTDNOO MOVE TS-NAME TO MSTDNMO MOVE TS-PER TO MSTDPGO IF MSTDNMO = 'KAVYA' MOVE '424000' TO TS-NO MOVE 'ANUSHA' TO TS-NAME MOVE '99' TO TS-PER EXEC CICS REWRITEQ TS QUEUE('MAN7') FROM(TS-DATA) ITEM(TS-ITEM) END-EXEC END-EVALUATE. COPY MSTD01S. -. PROCEDURE DIVISION. 00084100 00084200 00084300 00084400 00084500 00084600 00084700 00084800 00084900 00085000 00085100 00085200 00085300 00085400 00085500 00085600 00085700 00085800 00085900 00086000 00086100 00086200 00086300 00086400 00086500 00086600 00086700 00086800 00086900 00087000 00087100 00087200 00087300 00087400 00087500 00087600 00087700 00087800 00087900 00088000 00088100 00088200 00088300 00088400 00088500 00088600 00088700 00088800 00088900 00089000 00089100 00089200 00089300 00089400 00089500 00089600 00089700 00089800 00089900 00090000 .

EMP321 E. 00095700 WORKING-STORAGE SECTION.LENGTH=05 00092500 DATE DFHMDF POS=(01. 00090800 -SELECT E.42). X00092000 CTRL=(FRSET. X00093400 ATTRB=(UNPROT.MATTS.20).20).DEPT_NO SMALLINT.ATTRB=ASKIP 00095000 DFHMDF POS=(18.LINE=01 00092200 DFHMDF POS=(03.FSET) 00094100 DFHMDF POS=(06.MODE=INOUT.20). X00093100 LENGTH=13 00093200 SNO DFHMDF POS=(04. 00091900 TDQMS1 DFHMSD TYPE=&SYSPARM.INITIAL='__________'. 00095500 ENVIRONMENT DIVISION.'KUMAR'.31).DEPT_NAME 00091200 -FROM MAT001.INITIAL='F1: WRITE'.LENGTH=08.20).1001).45).DEPT_NO.1003).INITIAL='__'.EMP_NAME. 00090400 -CREATE UNIQUE INDEX INDX2 ON MAT001.20). 00090500 -INSERT INTO MAT001.DEPT321) IN MATDB.FREEKB.EMP321(EMP_NO). X00093300 PICIN='9(10)'. 00090900 -E.ATTRB=ASKIP 00094200 DFHMDF POS=(08. 00090100 -.LENGTH=10 00095100 DFHMSD TYPE=FINAL 00095200 END 00095300 ID DIVISION. 00095800 01 EMPREC. 00095600 DATA DIVISION. X00094000 ATTRB=(UNPROT.45). X00094800 PICOUT='Z(10)'. X00092300 LENGTH=12 00092400 DFHMDF POS=(01.CREATE TABLE MAT001.INITIAL='__________'.STORAGE=AUTO.PICOUT='Z(10)'.COLUMN=01.1002).FSET) 00094900 DFHMDF POS=(10.LENGTH=10.LENGTH=2.IC) 00093500 DFHMDF POS=(04. 00091800 CREATE UNIQUE INDEX INDX11 ON MAT001.80).70).TIOAPFX=YES. 00095400 PROGRAM-ID.LENGTH=10.LENGTH=13 00094300 SPG DFHMDF POS=(08.EMPJ(EMPNO).'FINANCE').20).DEPT321 VALUES(1003.PICOUT='Z(10)'. P1. 00090700 -INSERT INTO MAT001.34).PICOUT='Z(2)'.34).DEPT_NO 00091500 -CREATE TABLE MAT001.'KAMESH'.64).INITIAL='STUDENT NUMB:'.INITIAL='PERCENTAGE :'. X00093700 LENGTH=13 00093800 SNM DFHMDF POS=(06.FSET. 00096000 .LANG=COBOL 00092100 TDQMP1 DFHMDI SIZE=(24. 00090600 -INSERT INTO MAT001.INITIAL='________'.INITIAL='MESSAGE :'.PRINT).WHERE E.34).37).DEPT321 D 00091400 -.'YATHIN'. 00091100 -D.70).LENGTH=10.FSET) 00094500 DFHMDF POS=(08. 00091600 -EMPNAME CHAR(10).LENGTH=10.ATTRB=ASKIP 00094600 DFHMDF POS=(10.EMP321 VALUES(0001.MATTS.EMP_NO. X00094400 PICIN='9(2)'.INITIAL='STUDENT FILE'.ATTRB=(UNPROT.PRIMARY KEY(EMPNO)) IN 00091700 -MATDB.INITIAL='DATE:'.INITIAL='STUDENT NAME:'.LENGTH=10 00094700 MSG DFHMDF POS=(10.EMP321(EMP_NO SMALLINT NOT NULL. 00090300 -FOREIGN KEY(DEPT_NO) REFERENCES MAT001.INITIAL='__________'. 00095900 02 EMPNM PIC X(10). 00091000 -E.LENGTH=05 00092800 TIME DFHMDF POS=(02.ATTRB=ASKIP 00093600 DFHMDF POS=(06.EMP321 VALUES(0002.DEPT_NO = D. 00091300 -MAT001.EMPLOCA CHAR(10).PRIMARY KEY(EMP_NO). X00092600 ATTRB=FSET 00092700 DFHMDF POS=(02.EMP321 VALUES(0004.INITIAL='TIME:'. X00092900 ATTRB=FSET 00093000 DFHMDF POS=(04.EMPJ(EMPNO SMALLINT NOT NULL. 00090200 -EMP_NAME CHAR(10).64).-INSERT INTO MAT001.INITIAL='__________'. X00093900 PICIN='X(10)'.ATTRB=(UNPROT.

DATE-TIME-PARA. RECEIVE-PARA. MOVE T TO TIMEO. EXEC CICS RECEIVE MAP('EMP02') MAPSET('EMP01') END-EXEC. EXIT. EXIT. LINKAGE SECTION. 01 T PIC X(08). DATE-TIME-PARA-END. 01 COMM PIC X(40). COPY EMP01. SEND-RETURN-PARA-END. PROCEDURE DIVISION. 02 EMPSAL PIC 9(06). MOVE D TO DATEO. EXEC CICS RETURN TRANSID('TK38') COMMAREA(COMM) END-EXEC. EXEC CICS FORMATTIME ABSTIME(DATE1) DDMMYYYY(D) DATESEP('-') TIME(T) TIMESEP(':') END-EXEC. EXEC CICS ASKTIME ABSTIME(DATE1) END-EXEC. 01 ERR PIC S9(8) COMP. SEND-RETURN-PARA. GOBACK. COPY DFHAID. IF EIBCALEN = 00 PERFORM DATE-TIME-PARA THRU PERFORM SEND-RETURN-PARA THRU ELSE PERFORM RECEIVE-PARA THRU PERFORM EVALUATE-PARA THRU PERFORM DATE-TIME-PARA THRU PERFORM SEND-RETURN-PARA THRU END-IF. EXEC CICS SEND MAP('EMP02') MAPSET('EMP01') ERASE END-EXEC. 01 ITEM-NO PIC S9(4) COMP. 01 DATE1 PIC S9(4) COMP. MOVE LOW-VALUES TO EMP02I. EXIT. DATE-TIME-PARA-END SEND-RETURN-PARA-END RECEIVE-PARA-END EVALUATE-PARA-END DATE-TIME-PARA-END SEND-RETURN-PARA-END 00096100 00096200 00096300 00096400 00096500 00096600 00096700 00096800 00096900 00097000 00097100 00097200 00097300 00097400 00097500 00097600 00097700 00097800 00097900 00098000 00098100 00098200 00098300 00098400 00098500 00098600 00098700 00098800 00098900 00099000 00099100 00099200 00099300 00099400 00099500 00099600 00099700 00099800 00099900 00100000 00100100 00100200 00100300 00100400 00100500 00100600 00100700 00100800 00100900 00101000 00101100 00101200 00101300 00101400 00101500 00101600 00101700 00101800 00101900 00102000 . 01 DFHCOMMAREA PIC X(40). 01 D PIC X(10). RECEIVE-PARA-END.02 EMPLOC PIC X(10).

EVALUATE EIBAID WHEN DFHPF2 PERFORM WRITE-PARA THRU WRITE-PARA-END WHEN DFHPF3 PERFORM READ-PARA THRU READ-PARA-END WHEN DFHPF4 PERFORM REWRITE-PARA THRU REWRITE-PARA-END WHEN DFHPF5 MOVE LOW-VALUES TO EMP02O WHEN DFHPF6 PERFORM REWRITE-CONFORM-PARA THRU REWRITE-CONFORM-END WHEN DFHPF7 PERFORM READPREV-PARA THRU READPREV-PARA-END WHEN DFHPF8 PERFORM READNEXT-PARA THRU READNEXT-PARA-END WHEN DFHPF9 PERFORM DELETE-PARA THRU DELETE-PARA-END WHEN OTHER MOVE 'INVALID KEY ' TO MSGO END-EVALUATE. MOVE ITEMI TO ITEM-NO. READ-PARA. EXIT. MOVE NMI TO EMPNM. EXIT. ADD 1 TO ITEM-NO. IF ERR = DFHRESP(NORMAL) MOVE EMPNM TO NMO MOVE EMPLOC TO LOCO MOVE EMPSAL TO SALO MOVE ITEM-NO TO ITEMO MOVE 'READ SUCCESS ' TO MSGO ELSE IF ERR = DFHRESP(ITEMERR) 00102100 00102200 00102300 00102400 00102500 00102600 00102700 00102800 00102900 00103000 00103100 00103200 00103300 00103400 00103500 00103600 00103700 00103800 00103900 00104000 00104100 00104200 00104300 00104400 00104500 00104600 00104700 00104800 00104900 00105000 00105100 00105200 00105300 00105400 00105500 00105600 00105700 00105800 00105900 00106000 00106100 00106200 00106300 00106400 00106500 00106600 00106700 00106800 00106900 00107000 00107100 00107200 00107300 00107400 00107500 00107600 00107700 00107800 00107900 00108000 . MOVE LOCI TO EMPLOC. EVALUATE-PARA-END. WRITE-PARA. MOVE SALI TO EMPSAL. WRITE-PARA-END. EXEC CICS READQ TS QUEUE('QKAM8') INTO(EMPREC) ITEM(ITEM-NO) RESP(ERR) END-EXEC. EXEC CICS WRITEQ TS QUEUE('QKAM8') FROM(EMPREC) ITEM(ITEM-NO) RESP(ERR) END-EXEC IF ERR = DFHRESP(NORMAL) MOVE LOW-VALUES TO EMP02O MOVE ITEM-NO TO ITEMO MOVE 'WRITE SUCCESS ' TO MSGO ELSE MOVE ITEM-NO TO ITEMO MOVE 'WRITE FAIL ' TO MSGO END-IF.EVALUATE-PARA.

REWRITE-PARA. REWRITE-CONFORM-END. EXIT. REWRITE-CONFORM-PARA. READPREV-PARA. REWRITE-PARA-END. EXEC CICS READQ TS 00108100 00108200 00108300 00108400 00108500 00108600 00108700 00108800 00108900 00109000 00109100 00109200 00109300 00109400 00109500 00109600 00109700 00109800 00109900 00110000 00110100 00110200 00110300 00110400 00110500 00110600 00110700 00110800 00110900 00111000 00111100 00111200 00111300 00111400 00111500 00111600 00111700 00111800 00111900 00112000 00112100 00112200 00112300 00112400 00112500 00112600 00112700 00112800 00112900 00113000 00113100 00113200 00113300 00113400 00113500 00113600 00113700 00113800 00113900 00114000 . EXEC CICS READQ TS QUEUE('QKAM8') INTO(EMPREC) ITEM(ITEM-NO) RESP(ERR) END-EXEC. EXEC CICS WRITEQ TS QUEUE('QKAM8') FROM(EMPREC) ITEM(ITEM-NO) RESP(ERR) REWRITE END-EXEC.1. MOVE SALI TO EMPSAL.MOVE 'END OF FILE' TO MSGO ELSE IF ERR = DFHRESP(NOTFND) MOVE 'ITEM NOT FOUND' TO MSGO ELSE MOVE 'READ FAIL ' TO MSGO END-IF END-IF END-IF. READ-PARA-END. IF ERR = DFHRESP(NORMAL) MOVE EMPNM TO NMO MOVE EMPLOC TO LOCO MOVE EMPSAL TO SALO MOVE ITEM-NO TO ITEMO MOVE 'CONFORM 2 REWRITE PRESS F6 ' TO MSGO ELSE IF ERR = DFHRESP(NOTFND) MOVE 'ITEM NOT FOUND ' TO MSGO ELSE MOVE 'RECORD NOT FOUND' TO MSGO END-IF END-IF. MOVE NMI TO EMPNM. IF ERR = DFHRESP(NORMAL) MOVE LOW-VALUES TO MSGO MOVE ITEM-NO TO ITEMO MOVE 'REWRITE SUCCESS ' TO MSGO ELSE MOVE ITEM-NO TO ITEMO MOVE 'REWRITE FAIL ' TO MSGO END-IF. EXIT. EXIT. MOVE ITEMI TO ITEM-NO. MOVE LOCI TO EMPLOC. COMPUTE ITEM-NO = ITEM-NO .

READNEXT-PARA-END.QUEUE('QKAM8') INTO(EMPREC) ITEM(ITEM-NO) RESP(ERR) END-EXEC. DELETE-PARA-END. READNEXT-PARA. ID DIVISION. 00114100 00114200 00114300 00114400 00114500 00114600 00114700 00114800 00114900 00115000 00115100 00115200 00115300 00115400 00115500 00115600 00115700 00115800 00115900 00116000 00116100 00116200 00116300 00116400 00116500 00116600 00116700 00116800 00116900 00117000 00117100 00117200 00117300 00117400 00117500 00117600 00117700 00117800 00117900 00118000 00118100 00118200 00118300 00118400 00118500 00118600 00118700 00118800 00118900 00119000 00119100 00119200 00119300 00119400 00119500 00119600 00119700 00119800 00119900 00120000 . EXIT. IF ERR = DFHRESP(NORMAL) MOVE ITEM-NO TO ITEMO MOVE 'DELETE SUCCESS ' TO MSGO ELSE MOVE 'READ FAIL ' TO MSGO END-IF. EXIT. EXIT. EXEC CICS DELETEQ TS QUEUE('QKAM8') RESP(ERR) END-EXEC. EXEC CICS READQ TS QUEUE('QKAM8') INTO(EMPREC) ITEM(ITEM-NO) RESP(ERR) END-EXEC. DELETE-PARA. COMPUTE ITEM-NO = ITEM-NO + 1. READPREV-PARA-END. IF ERR = DFHRESP(NORMAL) MOVE EMPNM TO NMO MOVE EMPLOC TO LOCO MOVE EMPSAL TO SALO MOVE ITEM-NO TO ITEMO MOVE 'READ SUCCESS ' TO MSGO ELSE IF ERR = DFHRESP(ITEMERR) MOVE 'END OF FILE' TO MSGO PERFORM READPREV-PARA THRU READPREV-PARA-END ELSE MOVE 'READ FAIL ' TO MSGO END-IF END-IF. IF ERR = DFHRESP(NORMAL) MOVE EMPNM TO NMO MOVE EMPLOC TO LOCO MOVE EMPSAL TO SALO MOVE ITEM-NO TO ITEMO MOVE 'READ SUCCESS ' TO MSGO ELSE IF ERR = DFHRESP(ITEMERR) MOVE 'END OF FILE' TO MSGO PERFORM READNEXT-PARA THRU READNEXT-PARA-END ELSE MOVE 'READ FAIL ' TO MSGO END-IF END-IF. PROGRAM-ID. KAMESH.

IF EIBCALEN = 00 PERFORM DATE-TIME-PARA THRU DATE-TIME-PARA-END PERFORM SEND-RTN-PARA THRU SEND-RTN-END-PARA ELSE PERFORM RECEIVE-PARA THRU RECEIVE-END-PARA PERFORM EVALUATE-PARA THRU EVALUATE-END-PARA PERFORM DATE-TIME-PARA THRU DATE-TIME-PARA-END PERFORM SEND-RTN-PARA THRU SEND-RTN-END-PARA END-IF. COPY DFHAID. 01 T PIC X(08). EXEC SQL INCLUDE SQLCA END-EXEC. 01 COMM PIC X(50). LINKAGE SECTION. RECEIVE-PARA. EXIT. 01 DATE1 PIC S9(4) COMP. EXEC CICS RECEIVE MAP('KAMU2') MAPSET('KAMU1') 00120100 00120200 00120300 00120400 00120500 00120600 00120700 00120800 00120900 00121000 00121100 00121200 00121300 00121400 00121500 00121600 00121700 00121800 00121900 00122000 00122100 00122200 00122300 00122400 00122500 00122600 00122700 00122800 00122900 00123000 00123100 00123200 00123300 00123400 00123500 00123600 00123700 00123800 00123900 00124000 00124100 00124200 00124300 00124400 00124500 00124600 00124700 00124800 00124900 00125000 00125100 00125200 00125300 00125400 00125500 00125600 00125700 00125800 00125900 00126000 .DATA DIVISION. SEND-RTN-PARA. EXEC CICS ASKTIME ABSTIME(DATE1) END-EXEC. 01 D PIC X(10). 0000-MAINPARA. DATE-TIME-PARA. MOVE T TO TIMEO. EXIT. 01 DFHCOMMAREA PIC X(50). EXEC CICS FORMATTIME ABSTIME(DATE1) DDMMYYYY(D) DATESEP('-') TIME(T) TIMESEP(':') END-EXEC. WORKING-STORAGE SECTION. PROCEDURE DIVISION. EXEC SQL INCLUDE DCLEMPJ END-EXEC. EXEC CICS SEND MAP('KAMU2') MAPSET('KAMU1') FREEKB ERASE END-EXEC. COPY DFHBMSCA. GOBACK. MOVE D TO DATEO. COPY KAMU1. SEND-RTN-END-PARA. MOVE LOW-VALUES TO KAMU2O. DATE-TIME-PARA-END. EXEC CICS RETURN TRANSID('TK45') COMMAREA(COMM) END-EXEC.

00129200 ADD-PARA.EMPNAME. 00130500 ADD-END-PARA.EMPJ WHERE EMPNO = :HV-EMPNO 00131200 END-EXEC. 00127700 MOVE ENOI TO HV-EMPNO. 00127600 VIEW-PARA. 00127500 EXIT. 00130600 EXIT. 00131300 IF SQLCODE = 00 00131400 MOVE HV-EMPNO TO ENOO 00131500 MOVE HV-EMPNAME TO NAMEO 00131600 MOVE HV-EMPLOCA TO LOCAO 00131700 MOVE 'CONFORM UPDATE TO PRESS F6 FUNCTION ' TO MSGO 00131800 ELSE 00131900 MOVE 'RECORD NOT FOUND' TO MSGO 00132000 .EMPJ(EMPNO. 00130700 UPDATE-PARA.EMPLOCA INTO :DCLEMPJ 00128000 FROM MAT001. 00129300 MOVE ENOI TO HV-EMPNO. 00128200 IF SQLCODE = 00 00128300 MOVE HV-EMPNO TO ENOO 00128400 MOVE HV-EMPNAME TO NAMEO 00128500 MOVE HV-EMPLOCA TO LOCAO 00128600 MOVE 'RECORD FOUND' TO MSGO 00128700 ELSE 00128800 MOVE 'RECORD NOT FOUND' TO MSGO 00128900 END-IF.EMPNAME. 00126100 RECEIVE-END-PARA. 00129100 EXIT. 00126300 EVALUATE-PARA.EMPLOCA) 00129800 VALUES(:HV-EMPNO.EMPLOCA INTO :DCLEMPJ 00131100 FROM MAT001. 00129400 MOVE NAMEI TO HV-EMPNAME. 00127800 EXEC SQL 00127900 SELECT EMPNO.EMPJ WHERE EMPNO = :HV-EMPNO 00128100 END-EXEC. 00129600 EXEC SQL 00129700 INSERT INTO MAT001. 00130900 EXEC SQL 00131000 SELECT EMPNO. 00126400 EVALUATE EIBAID 00126500 WHEN DFHPF1 PERFORM VIEW-PARA THRU VIEW-END-PARA 00126600 WHEN DFHPF2 PERFORM ADD-PARA THRU ADD-END-PARA 00126700 WHEN DFHPF3 PERFORM DELETE-PARA THRU DELETE-END-PARA 00126800 WHEN DFHPF4 PERFORM UPDATE-PARA THRU UPDATE-END-PARA 00126900 WHEN DFHPF5 PERFORM CLEAR-PARA THRU CLEAR-END-PARA 00127000 WHEN DFHPF6 PERFORM CONFUPDATE-PARA THRU CONFUPDATE-END-PARA00127100 WHEN OTHER 00127200 MOVE 'YOU ENTERED INVALID FUNCTION KEY' TO MSGO 00127300 END-EVALUATE. 00130000 IF SQLCODE = 00 00130100 MOVE 'INSERT SUCESSFUL' TO MSGO 00130200 ELSE 00130300 MOVE 'INSERT IN ERROR' TO MSGO 00130400 END-IF. 00129500 MOVE LOCAI TO HV-EMPLOCA.END-EXEC. 00129000 VIEW-END-PARA. 00127400 EVALUATE-END-PARA.:HV-EMPNAME. 00130800 MOVE ENOI TO HV-EMPNO.:HV-EMPLOCA) 00129900 END-EXEC. 00126200 EXIT.EMPNAME.

03). INITIAL='__________'. MOVE ENOI TO HV-EMPNO MOVE NAMEI TO HV-EMPNAME. DELETE-END-PARA.FSET).LENGTH=10. EXIT.INITIAL='LOCA :' LOCA DFHMDF POS=(07. CONFUPDATE-PARA. DELETE-PARA. CONFUPDATE-END-PARA.PICIN='9(04)'.17).LENGTH=07.ATTRB=(PROT). INITIAL='__________'.03). EXIT.FSET). MOVE ENOI TO HV-EMPNO.LENGTH=7.ATTRB=(PROT.LENGTH=40.23).INITIAL='EMPNO: ' ENO DFHMDF POS=(03.MODE=INOUT.ATTRB=(UNPROT.03). MOVE LOW-VALUES TO KAMU2O.INITIAL='DATE:' DATE DFHMDF POS=(01.FSET).PICOUT='X(10)' DFHMDF POS=(07.ATTRB=(UNPROT.IC.EMPJ SET EMPNAME=:HV-EMPNAME.LENGTH=10.PICIN='X(10)'. INITIAL='__________' DFHMDF POS=(03. UPDATE-END-PARA.ATTRB=(ASKIP) DFHMDF POS=(05. 00132100 00132200 00132300 00132400 00132500 00132600 00132700 00132800 00132900 00133000 00133100 00133200 00133300 00133400 00133500 00133600 00133700 00133800 00133900 00134000 00134100 00134200 00134300 00134400 00134500 00134600 00134700 00134800 00134900 00135000 00135100 00135200 00135300 00135400 00135500 X00135600 00135700 00135800 X00135900 00136000 00136100 X00136200 00136300 00136400 X00136500 00136600 00136700 X00136800 00136900 00137000 00137100 X00137200 00137300 00137400 00137500 X00137600 00137700 00137800 00137900 X00138000 .LANG=COBOL.LENGTH=07.PICOUT='X(10)' DFHMDF POS=(05.23).STORAGE=AUTO. EXIT.FSET).LENGTH=5.12).ATTRB=(ASKIP) DFHMDF POS=(07.54).INITIAL='NAME :' NAME DFHMDF POS=(05. KAMU1 DFHMSD TYPE=&SYSPARM.LENGTH=04. INITIAL='EMP DETAILS' DFHMDF POS=(01.80).13).PICIN='X(10)'.PRINT.NUM.INITIAL='TIME:' TIME DFHMDF POS=(02.ATTRB=(UNPROT.END-IF.47). MOVE LOCAI TO HV-EMPLOCA.FRSET).12). EXIT.ATTRB=(PROT. TIOAPFX=YES.LENGTH=10.EXTATT=YES KAMU2 DFHMDI SIZE=(24. CLEAR-END-PARA.FSET).LENGTH=11.47).LENGTH=10. EXEC SQL UPDATE MAT001. IF SQLCODE = 00 MOVE 'UPDATE SUCCESS ' TO MSGO ELSE MOVE 'ERROR IN UPDATE ' TO MSGO END-IF.PICOUT='9(04)' DFHMDF POS=(03.03).54).LENGTH=5. INITIAL='____'.12).COLUMN=1 DFHMDF POS=(01. IF SQLCODE = 00 MOVE 'DELETION SUCEES' TO MSGO ELSE MOVE 'ERROR IN DELETION' TO MSGO END-IF.25). EMPLOCA=:HV-EMPLOCA WHERE EMPNO=:HV-EMPNO END-EXEC.CTRL=(FREEKB.ATTRB=(ASKIP) DFHMDF POS=(15. INITIAL='__________' DFHMDF POS=(02.LINE=1.INITIAL='MESSAGE' MSG DFHMDF POS=(15.LENGTH=07. CLEAR-PARA.EMPJ WHERE EMPNO=:HV-EMPNO END-EXEC. EXEC SQL DELETE FROM MAT001.

25).LENGTH=7.LENGTH=7.LENGTH=7.LENGTH=7.05).INITIAL='F4:UPDA' POS=(22.INITIAL='F5:CLER' POS=(22.15).25).INITIAL='F6:CON' TYPE=FINAL END 00138100 00138200 00138300 00138400 00138500 00138600 00138700 00138800 00138900 .INITIAL='F2:INSE' POS=(20.15). DFHMDF DFHMDF DFHMDF DFHMDF DFHMDF DFHMDF DFHMSD INITIAL='________________________________________' POS=(20.INITIAL='F1:VIEW' POS=(20.LENGTH=7.LENGTH=7.INITIAL='F3:DELE' POS=(22.05).