Paging Logic In Mainframes
Paging Logic In Mainframes
Paging Logic for Mainframe CICS Pages.
Swap-key>+4 is applicable for 4 screens as I had mentioned earlier as an example. And it’s for horizontal swap.
I am talking about vertical paging.
Let me explain my views to your current problem now:
Consider single screen can hold up to 10 - 15 records.
Fetch records from table and write it into the vsam (File) .You read those records from the file and display it in the screen(12 records per screen)
IF HKEY-AT-CURSOR-PAGE > +1
AND HKEY-AT-CURSOR-PAGE < +12
MOVE HKEY-L00-PAGE (HKEY-AT-CURSOR-PAGE) TO HKEY-A-PAGE
ELSE
MOVE HKEY-L00-PAGE (01) TO HKEY-A-PAGE.
IF HKEY-A-PAGE = HKEY-FIRST-PAGE
OR HKEY-A-PAGE = LOW-VALUES
PERFORM 68-GET-LAST-PAGE
GO TO THIS-EXIT.
PERFORM 63-GET-KEY.
MOVE SCREEN-DATAO (01) TO SCREEN-DATAO (12).
MOVE HKEY-L00-PAGE (01) TO HKEY-L00-PAGE (12).
MOVE LOW-VALUES TO HKEY-L00-PAGE (01).
IF HKEY-AT-CURSOR-PAGE > +1
AND HKEY-AT-CURSOR-PAGE < +12
MOVE +12 TO X3-SYS
ELSE
MOVE +13 TO X3-SYS.
PERFORM 65-GET-PRIOR.
---------------------------------------------------
68-GET-LAST-PAGE SECTION.
MOVE HKEY-LAST-PAGE TO HKEY-A-PAGE.
PERFORM 63-GET-KEY.
MOVE SCREEN-DATAO (01) TO SCREEN-DATAO (12).
MOVE HKEY-L00-PAGE (01) TO HKEY-L00-PAGE (12).
MOVE LOW-VALUES TO HKEY-L00-PAGE (01).
MOVE +12 TO X3-SYS.
--------------------------------------------------
In get key move low-values to SCREEN-DATAO (01),(02)...(12)
--------------------------------------------------
65-OUT.
IF HKEY-L00-PAGE (12) = HKEY-LAST-PAGE
MOVE 'BOTTOM OF DATA' TO MESSAGE-WS.
IF HKEY-L00-PAGE (01) = HKEY-FIRST-PAGE
MOVE 'TOP OF DATA' TO MESSAGE-WS.
----------------------------------------------------
For last page
MOVE HKEY-LAST-PAGE TO HKEY-A-PAGE.
for first page
MOVE HKEY-FIRST-PAGE TO HKEY-A-PAGE.
Hope this Helps.