File Handling Program:(Reading single Record) ID DIVISION. PROGRAM-ID. AD12GM. DAT...
ID DIVISION.
PROGRAM-ID. AD12GM.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY FILE01.
COPY FILE02.
01 COMMAREA.
02 VARS PIC X(4).
01 REC1.
02 EID2 PIC X(4).
02 FILLER PIC X.
02 ENAME2 PIC X(10).
02 FILLER PIC X.
02 ESAL2 PIC 9(5).
02 FILLER PIC X(59).
77 LENG PIC S9(4) COMP.
PROCEDURE DIVISION.
MOVE LOW-VALUES TO FILEI.
MOVE LOW-VALUES TO FILE1I.
MOVE LOW-VALUES TO FILEO.
MOVE LOW-VALUES TO FILE1O.
EXEC CICS SEND
MAP('FILE1')
MAPSET('FILE02')
ERASE
END-EXEC.
PERFORM READ-PARA.
EXEC CICS SEND
MAP('FILE')
MAPSET('FILE01')
END-EXEC.
EXEC CICS RETURN END-EXEC.
STOP RUN.
READ-PARA.
EXEC CICS RECEIVE
MAP('FILE1')
MAPSET('FILE02')
END-EXEC.
MOVE EID1I TO EID2.
EXEC CICS READ
FILE('FILE001')
INTO(REC1)
RIDFLD(EID2)
LENGTH(LENGTH OF REC1)
END-EXEC.
MOVE EID2 TO EIDO.
MOVE ENAME2 TO ENAMEO.
MOVE ESAL2 TO ESALO.
map1:
FILE02 DFHMSD TYPE=&SYSPARM, X
MODE=INOUT, X
TIOAPFX=YES, X
STORAGE=AUTO, X
LANG=COBOL, X
CTRL=(FRSET,FREEKB)
FILE1 DFHMDI SIZE=(24,80),LINE=1,COLUMN=1
DFHMDF INITIAL='EMP DETAIL',POS=(1,35),LENGTH=10,ATTRB=ASKIP
DFHMDF INITIAL='ENTER EMP NO :',POS=(06,11),LENGTH=14, X
ATTRB=PROT
EID1 DFHMDF POS=(06,26),LENGTH=4,ATTRB=(UNPROT,IC), X
INITIAL='____'
MSG1 DFHMDF POS=(10,11),LENGTH=18,ATTRB=UNPROT
FILE02 DFHMSD TYPE=FINAL
END
Symbolic map for map1(Map name):
01 FILE1I.
02 FILLER PIC X(12).
02 EID1L COMP PIC S9(4).
02 EID1F PICTURE X.
02 FILLER REDEFINES EID1F.
03 EID1A PICTURE X.
02 EID1I PIC X(4).
02 MSG1L COMP PIC S9(4).
02 MSG1F PICTURE X.
02 FILLER REDEFINES MSG1F.
03 MSG1A PICTURE X.
02 MSG1I PIC X(18).
01 FILE1O REDEFINES FILE1I.
02 FILLER PIC X(12).
02 FILLER PICTURE X(3).
02 EID1O PIC X(4).
02 FILLER PICTURE X(3).
02 MSG1O PIC X(18).
map2:
FILE01 DFHMSD TYPE=&SYSPARM, X
MODE=INOUT, X
TIOAPFX=YES, X
STORAGE=AUTO, X
LANG=COBOL, X
CTRL=(FRSET,FREEKB)
FILE DFHMDI SIZE=(24,80),LINE=1,COLUMN=1
DFHMDF INITIAL='EMP DETAIL',POS=(1,35),LENGTH=10,ATTRB=ASKIP
DFHMDF INITIAL='EMP ID :',POS=(03,11),LENGTH=11,ATTRB=ASKIP
EID DFHMDF POS=(03,24),LENGTH=4,ATTRB=(UNPROT,IC), X
INITIAL='____'
DFHMDF INITIAL='EMP NAME :',POS=(05,11),LENGTH=11,ATTRB=ASKIP
ENAME DFHMDF POS=(05,24),LENGTH=10,ATTRB=UNPROT, X
INITIAL='__________'
DFHMDF INITIAL='EMP SALARY:',POS=(07,11), X
LENGTH=11,ATTRB=PROT
ESAL DFHMDF POS=(07,24),ATTRB=(UNPROT,NUM), X
LENGTH=05, X
INITIAL='_____'
MSG DFHMDF POS=(10,11),LENGTH=18,ATTRB=UNPROT
FILE01 DFHMSD TYPE=FINAL
END
Symbolic map for map2(Map name):
01 FILEI.
02 FILLER PIC X(12).
02 EIDL COMP PIC S9(4).
02 EIDF PICTURE X.
02 FILLER REDEFINES EIDF.
03 EIDA PICTURE X.
02 EIDI PIC X(4).
02 ENAMEL COMP PIC S9(4).
02 ENAMEF PICTURE X.
02 FILLER REDEFINES ENAMEF.
03 ENAMEA PICTURE X.
02 ENAMEI PIC X(10).
02 ESALL COMP PIC S9(4).
02 ESALF PICTURE X.
02 FILLER REDEFINES ESALF.
03 ESALA PICTURE X.
02 ESALI PIC X(5).
02 MSGL COMP PIC S9(4).
02 MSGF PICTURE X.
02 FILLER REDEFINES MSGF.
03 MSGA PICTURE X.
02 MSGI PIC X(18).
01 FILEO REDEFINES FILEI.
02 FILLER PIC X(12).
02 FILLER PICTURE X(3).
02 EIDO PIC X(4).
02 FILLER PICTURE X(3).
02 ENAMEO PIC X(10).
02 FILLER PICTURE X(3).
02 ESALO PIC X(5).
02 FILLER PICTURE X(3).
02 MSGO PIC X(18).
No comments
Post a Comment