IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Logic for Scroll up and Scroll Down


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sundaresanjs

New User


Joined: 29 May 2006
Posts: 18
Location: USA

PostPosted: Fri Jul 07, 2006 12:39 pm
Reply with quote

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
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Jul 07, 2006 3:52 pm
Reply with quote

Have you tested this code?

Before going ahead further how it is identifying function keys....

Regards,
jai
Back to top
View user's profile Send private message
venu_dr

New User


Joined: 06 Jul 2006
Posts: 6

PostPosted: Fri Jul 07, 2006 6:17 pm
Reply with quote

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
View user's profile Send private message
venu_dr

New User


Joined: 06 Jul 2006
Posts: 6

PostPosted: Fri Jul 07, 2006 6:24 pm
Reply with quote

Correction to the above logic

EVALUATE EIBAID
WHEN DFHPF7
PERFORM UP1
WHEN DFHPF8
PERFORM DOWN1
END-EVALUATE
Back to top
View user's profile Send private message
sundaresanjs

New User


Joined: 29 May 2006
Posts: 18
Location: USA

PostPosted: Sat Jul 08, 2006 2:18 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Change Default Scroll Setting TSO/ISPF 1
No new posts Finding faulty logic Subscript out of... COBOL Programming 5
This topic is locked: you cannot edit posts or make replies. Need assistance in job scheduling logic. Mainframe Interview Questions 2
No new posts Rexx Logic error while adding seperat... CLIST & REXX 3
No new posts PL/1 Callback address logic in z/OS C... PL/I & Assembler 1
Search our Forums:

Back to Top