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
 

 

How could i implement up page and down page in cics?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
daye.Zheng

New User


Joined: 15 Feb 2008
Posts: 22
Location: China

PostPosted: Mon Mar 24, 2008 6:45 am    Post subject: How could i implement up page and down page in cics?
Reply with quote

Hi all,
i have several questions.

1. How could i implement up page and down page in cics?

2. I need read more than one rows from db2 table to cics map, how
could i implement it effectively? Whick technique i can use?
How could i design the map? Defining many rows variables?

3. If i need operate one of the rows, BUt only one row can be do, how
could i implement it effectively? One by one select it ?
Back to top
View user's profile Send private message

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Mon Mar 24, 2008 8:08 am    Post subject:
Reply with quote

here is a simple UP-DOWN scroll program in CICS :
Code:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. SCRLPGM.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 REC.
            02 EMPID   PIC X(5).
            02         PIC X.
            02 EMPNAME PIC X(10).
            02         PIC X.
            02 EMPCOR  PIC X(10).
            02         PIC X(53).
       77 LEN          PIC S9(4) COMP VALUE 80.
       01 WS-COMMAREA  PIC X.
       01 WS-RESP      PIC S9(8) COMP.
       01 WS-FLAG      PIC X  VALUE 'N'.
       01 I            PIC 99 VALUE 0.
       COPY SCRLSET.
       COPY DFHAID.
       COPY DFHBMSCA.
       LINKAGE SECTION.
       01 DFHCOMMAREA PIC X.
       PROCEDURE DIVISION.
            IF EIBCALEN = 0
               MOVE 'PRESS THE ENTER KEY TO PROCESS.' TO MSGO
            ELSE
               EVALUATE EIBAID
               WHEN DFHPF3
                    PERFORM EXIT-PARA
               WHEN DFHPF7
                    PERFORM STARTBR-PARA
                    PERFORM READ-PREV-PARA VARYING I FROM 10 BY -1 UN
      -             TIL I < 1  OR WS-FLAG = 'Y'
               WHEN DFHPF8
                    PERFORM STARTBR-PARA
                    PERFORM READ-NEXT-PARA VARYING I FROM 1  BY  1 UN
      -             TIL I > 10 OR WS-FLAG = 'Y'
               WHEN OTHER
                    PERFORM ERROR-PARA
               END-EVALUATE
            END-IF.
            PERFORM CLEAR-PARA.
            EXEC CICS
               HANDLE CONDITION
               ERROR(ERROR-PARA)
            END-EXEC.

       SEND-PARA.
            EXEC CICS
               SEND MAP('SCRLMAP') MAPSET('SCRLSET') ERASE
            END-EXEC.
            EXEC CICS
               RETURN TRANSID('SCRL')
               COMMAREA(WS-COMMAREA)
               LENGTH(LEN)
            END-EXEC.

       RECEIVE-PARA.
            EXEC CICS
               RECEIVE MAP('SCRLMAP') MAPSET('SCRLSET')
            END-EXEC.

       STARTBR-PARA.
            PERFORM RECEIVE-PARA.
            MOVE EMPIDI TO EMPID.
            EXEC CICS
                 STARTBR FILE('SCRLFILE')
                 RIDFLD(EMPID)
                 GTEQ
                 RESP(WS-RESP)
            END-EXEC.
            IF WS-RESP NOT = DFHRESP(NORMAL)
               MOVE 'RECORD NOT FOUND.' TO MSGO
            END-IF.

       READ-PREV-PARA.
            EXEC CICS
                 READPREV FILE('SCRLFILE')
                 INTO(REC)
                 LENGTH(LEN)
                 RESP(WS-RESP)
                 RIDFLD(EMPID)
            END-EXEC.
            IF WS-RESP = DFHRESP(NORMAL)
               STRING '     EMP-ID : ', EMPID,
                      '     EMP NAME : ', EMPNAME,
                      '     EMP COURSE : ', EMPCOR
                      DELIMITED BY SIZE INTO DETAILO(I)
            ELSE
               IF WS-RESP = DFHRESP(ENDFILE)
                  MOVE 'Y' TO WS-FLAG
               ELSE
                  PERFORM ERROR-PARA
               END-IF
            END-IF.

       READ-NEXT-PARA.
            EXEC CICS
                 READNEXT  FILE('SCRLFILE')
                 INTO(REC)
                 LENGTH(LEN)
                 RESP(WS-RESP)
                 RIDFLD(EMPID)
            END-EXEC.
            IF WS-RESP = DFHRESP(NORMAL)
               STRING '     EMP-ID : ', EMPID,
                      '     EMP NAME : ', EMPNAME,
                      '     EMP COURSE : ', EMPCOR
                      DELIMITED BY SIZE INTO DETAILO(I)
            ELSE
               IF WS-RESP = DFHRESP(ENDFILE)
                  MOVE 'Y' TO WS-FLAG
               ELSE
                  PERFORM ERROR-PARA
               END-IF
            END-IF.

       CLEAR-PARA.
            MOVE LOW-VALUES TO SCRLMAPO.
            MOVE LOW-VALUES TO REC.
            PERFORM SEND-PARA.

       ERROR-PARA.
            MOVE 'INVALID OPERATION.' TO MSGO.
            PERFORM SEND-PARA.

       EXIT-PARA.
            EXEC CICS
               RETURN
            END-EXEC.
Back to top
View user's profile Send private message
daye.Zheng

New User


Joined: 15 Feb 2008
Posts: 22
Location: China

PostPosted: Mon Mar 24, 2008 8:30 am    Post subject: RE:here is a simple UP-DOWN scroll program in CICS :
Reply with quote

Hi the_gautam,
Thanks for your reply! Your sample is very useful for me.

But, it just a sample for vsam, do you have any db2 sample like this one, i am very appreciate for your help!
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 CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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