You are on page 1of 3

how to code the following map using occours clause?

all the three fields have different length.


ename eno addr

1) _______ _________ __________


2) _______ _________ __________
3) _______ _________ __________
4) _______ _________ __________
5) _______ _________ __________
6) _______ _________ __________

TELNO DFHMDF POS=(7,1),LENGTH=9,ATTRB=NORM,OCCURS=40


The description of these fields in the symbolic map looks
like this in COBOL:

02 TELNOG OCCURS 40.


03 FILLER PICTURE X(2).
03 TELNOA PICTURE X.
03 TELNOO PIC X(9).
PF7 & PF8 LOGIC;

Hi For that purpose u have two ways: 1: using TSQ S 2: using Browse commands. using DFHcomm area

Eg: Linkage section. 01 DFHCOMMAREA 05 LN-CUST-CODE PIC X (10)---------------

also primary key aur any key from u start browse using browse commands first after eibaid u can
give if condition for chaech identifier keys (PF7/PF8)....

EVALUATE EIBAID
WHEN DFHPF7
MOVE LN-CUST-CODE TO CUST-CODE ( VSAM PK)
PERFORM STARTBR-PARA PERFORM READ-PREV-PARA VARYING I FROM 1 BY 1 UNTILL I > 10
OR WS- FLAG = 'Y' ( For showing 10 records per screen on map)
WHEN DFHPF8 MOVE LN-CUST-CODE TO CUST-CODE ( VSAM PK)
PERFORM STARTBR-PARA PERFORM READ-NEXT-PARA VARYING I FROM 1 BY 1 UNTILL I > 10
OR WS- FLAG = 'Y' WHEN OTHER MOVE INVALID KEY PRESSED' TO MSGO(MAP o Fields)
END_EVALUATE.

STARTBR-PARA.
EXEC CICS STARTBR FILE ('File Name')
RIDFLD( CUST_CODE)....
Primary key RESP(WS_-RESP)
END-EXEC.
Handle codes using IF conditions.
READ-NEXT-PARA.
EXCE CICS
READNEXT FILE ('File Name') INTO(Rec Name)
LENGTH( REC length)
RIDFLD( CUST-CODE)
RESP(WS-RESP)
END-EXEC.
Handle codes using IF conditions. MOVE the values into mapO fields u wants to display on screen.Same
as READ-PREV-PARA. I think u got it all. IF i wrong correct me.Regards Sunil

You might also like