Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Logic for Scroll up and Scroll Down

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Logic for Scroll up and Scroll Down
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    Post subject:
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    Post subject: Re: Logic for Scroll up and Scroll Down
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    Post subject:
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    Post subject: Re: Logic for Scroll up and Scroll Down
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help in building a logic Benchwarmer All Other Mainframe Topics 4 Wed Feb 22, 2017 2:49 am
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Sort Logic to extract data scorp_rahul23 DFSORT/ICETOOL 13 Tue Mar 01, 2016 1:22 am
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm
No new posts Tricky sort logic required pgopi92 DFSORT/ICETOOL 3 Mon Jan 25, 2016 3:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us