View previous topic :: View next topic
|
Author |
Message |
sundaresanjs
New User
Joined: 29 May 2006 Posts: 18 Location: USA
|
|
|
|
hai all,
i have tried the logic for the scroll options using attentition identifiers. and got the result.
Code: |
IDENTIFICATION DIVISION.
PROGRAM-ID. MSCROL1.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY MAP4.
COPY DFHAID.
01 RECORD1.
02 COD PIC X(4).
02 FILLER PIC X(76).
77 I PIC 99 VALUE ZERO.
77 J PIC 99 VALUE ZERO.
77 L PIC 99.
77 F PIC 99.
77 K PIC 9 VALUE ZERO.
77 CHK PIC S9(5) COMP.
PROCEDURE DIVISION.
MOVE LOW-VALUES TO MAP4O, MAP4I.
EXEC CICS HANDLE AID
PF7(UP1)
PF8(DOWN1)
ENTER(EXIT1)
ANYKEY(ERROR1)
END-EXEC.
EXEC CICS SEND MAP('MAP4') MAPSET('CNEW143')
END-EXEC.
MOVE LOW-VALUES TO COD.
EXEC CICS STARTBR
FILE('CNEW143F')
RIDFLD(COD)
KEYLENGTH(LENGTH OF COD)
GTEQ
END-EXEC.
FIRST1.
MOVE 0 TO J.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 10
EXEC CICS READNEXT
FILE('CNEW143F')
INTO(RECORD1)
RIDFLD(COD)
LENGTH(LENGTH OF RECORD1)
RESP(CHK)
END-EXEC
IF CHK = DFHRESP(ENDFILE)
MOVE 'END OF FILE' TO TITLEO
MOVE 1 TO K
MOVE LOW-VALUES TO EMPRECO(I)
COMPUTE J = J + 1
ELSE
MOVE RECORD1 TO EMPRECO(I)
END-IF
END-PERFORM.
SEND1.
EXEC CICS SEND MAP('MAP4') MAPSET('CNEW143')
ERASE
END-EXEC.
ALWAYS.
EXEC CICS RECEIVE MAP('MAP4') MAPSET('CNEW143')
END-EXEC.
EXIT1.
MOVE 'THE SESSION CLOSED' TO TITLEO.
EXEC CICS SEND MAP('MAP4') MAPSET('CNEW143')
ERASE
END-EXEC.
EXEC CICS RETURN END-EXEC.
DOWN1.
IF TITLEO = 'START FILE'
MOVE LOW-VALUES TO TITLEO
END-IF.
IF K NOT EQUAL TO 1
GO TO FIRST1
END-IF.
GO TO ALWAYS.
UP1.
IF TITLEO = 'END OF FILE'
MOVE LOW-VALUES TO TITLEO
END-IF.
COMPUTE L = 20 - J.
PERFORM VARYING F FROM 1 BY 1 UNTIL F > L
EXEC CICS READPREV
FILE('CNEW143F')
INTO(RECORD1)
RIDFLD(COD)
LENGTH(LENGTH OF RECORD1)
RESP(CHK)
END-EXEC
IF CHK = DFHRESP(ENDFILE)
MOVE 0 TO K
MOVE 'START FILE' TO TITLEO
GO TO FIRST1
END-IF
END-PERFORM.
GO TO FIRST1.
ERROR1.
MOVE 'ENTER CORRECT KEY' TO TITLEO.
EXEC CICS SEND MAP('MAP4') MAPSET('CNEW143')
ERASE
END-EXEC.
GO TO ALWAYS.
|
this is my own logic i ddnt copy from others, i have used the vsam file in it.
correct any errors,
regards, |
|
Back to top |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
Have you tested this code?
Before going ahead further how it is identifying function keys....
Regards,
jai |
|
Back to top |
|
|
venu_dr
New User
Joined: 06 Jul 2006 Posts: 6
|
|
|
|
I am sure this program wont work for your mentioned logic. It needs some modifications. your approach is good to take the record from VSAM but problem is the seqence of the sending the map and receiving the map. Also if PF7 pressed, it wont go to UP1 paragraph directly, instead you need to code like below;
EVALUATE DFHAID
IF PF7
PERFORM UP1
IF PF8
PERFORM DOWN1
END-EVALUATE |
|
Back to top |
|
|
venu_dr
New User
Joined: 06 Jul 2006 Posts: 6
|
|
|
|
Correction to the above logic
EVALUATE EIBAID
WHEN DFHPF7
PERFORM UP1
WHEN DFHPF8
PERFORM DOWN1
END-EVALUATE |
|
Back to top |
|
|
sundaresanjs
New User
Joined: 29 May 2006 Posts: 18 Location: USA
|
|
|
|
hai venu_dr,
I have already checked this code by reading a Vsam file, it works fine. there is no need in the correction of my code. u said that, if F7 is pressed it wont go to the up para but in cics it will check for handle aid para and take decision for the attention identifiers. i have checked it throughlly and then only i posted it.
the vsam file has fields upto 80 columns
the map has field name emprec , which is declared in occurs clause.
regards,
[/code] |
|
Back to top |
|
|
|