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
 

 

pagination logic

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Tue Aug 16, 2005 4:15 pm    Post subject: pagination logic
Reply with quote

Could anyone please give the logic for map pagination in cics asap?
Back to top
View user's profile Send private message

radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Wed Aug 17, 2005 9:34 am    Post subject:
Reply with quote

I guess the following will give you a clear idea abt paging.There are many ways of paging.The example below shows you abt paging in CICS thru COBOL.

| I Scr | II Scr | III Scr |
-------------------------------------
A B C |C D E |F G H |
-------------------------------------
........ |........ |..........|.................................
........ |........ |..........|.................................
........ |........ |..........|.................................
........ |........ |..........|.................................
........ |........ |..........|.................................
........ |.........|..........|.................................

Let us consider 4 screens.You can assign any of the funtional keys to browse thru the number of screens using DFH parameter in CICS.
The following code in COBOL can be used for paging.

IF AID-VE = DFHPF11
ADD +1 TO SWAP-KEY
IF AID-VE = DFHPF10
SUBTRACT +1 FROM SWAP-KEY.
IF SWAP-KEY > +4
MOVE +1 TO SWAP-KEY
IF SWAP-KEY < +1
MOVE +4 TO SWAP-KEY

following the above:
If swap-Key = 1 then you need to move the fields to the corresponding positions in the screens.
eg:In the I scr the fields are A, B, C..Move A to the corresponding position in the screen.
Populate the field values accordingly.

By doing the above way,it is easier to do paging and to change the number of screens with slight changes in the code in cobol,whenever needed.

Pleasure to answer further queries,if any
Back to top
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Wed Aug 17, 2005 11:17 am    Post subject: Pagination Logic
Reply with quote

Hi radhakrishnan,

Thanx for your suggestions.

I would like to give the senario. Suppose we have 1000 records in our database to be displayed on the map. And we want to see the resord with F8 (Next Page) and F7( Prior Page). So, as per your logic i cant hard code 'IF SWAP-KEY > +4'.

Now, when i am at 10th page and wants to see the 7th one then how can be track the record of 7th page.

Please advise if you have any idea.
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Wed Aug 17, 2005 11:59 am    Post subject:
Reply with quote

Swap-key>+4 is applicable for 4 screens as i had mentioned earlier as an example.And its for horizontal swap.

You are talking abt vertical paging.
Let me explain my views to your current problem now:

Consider single screen can hold upto 10 - 15 records.
Fetch records from table and write it into the vsam.You read those records from the file and display it in the screen(12 records per screen)

IF HKEY-AT-CURSOR-SPSV > +1
AND HKEY-AT-CURSOR-SPSV < +12
MOVE HKEY-L00-SPSV (HKEY-AT-CURSOR-SPSV) TO HKEY-A-SPSV
ELSE
MOVE HKEY-L00-SPSV (01) TO HKEY-A-SPSV.

IF HKEY-A-SPSV = HKEY-FIRST-SPSV
OR HKEY-A-SPSV = 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-SPSV (01) TO HKEY-L00-SPSV (12).
MOVE LOW-VALUES TO HKEY-L00-SPSV (01).

IF HKEY-AT-CURSOR-SPSV > +1
AND HKEY-AT-CURSOR-SPSV < +12
MOVE +12 TO X3-SYS
ELSE
MOVE +13 TO X3-SYS.
PERFORM 65-GET-PRIOR.

---------------------------------------------------

68-GET-LAST-PAGE SECTION.

MOVE HKEY-LAST-SPSV TO HKEY-A-SPSV.
PERFORM 63-GET-KEY.
MOVE SCREEN-DATAO (01) TO SCREEN-DATAO (12).
MOVE HKEY-L00-SPSV (01) TO HKEY-L00-SPSV (12).
MOVE LOW-VALUES TO HKEY-L00-SPSV (01).
MOVE +12 TO X3-SYS.

--------------------------------------------------
In get key move low-values to SCREEN-DATAO (01),(02)...(12)
--------------------------------------------------
65-OUT.

IF HKEY-L00-SPSV (12) = HKEY-LAST-SPSV
MOVE 'BOTTOM OF DATA' TO MESSAGE-WS.
IF HKEY-L00-SPSV (01) = HKEY-FIRST-SPSV
MOVE 'TOP OF DATA' TO MESSAGE-WS.
----------------------------------------------------
For last page
MOVE HKEY-LAST-SPSV TO HKEY-A-SPSV.
for first page
MOVE HKEY-FIRST-SPSV TO HKEY-A-SPSV.

--------------------------------------------------------

hope this helps.
Back to top
View user's profile Send private message
vinit_infy
Warnings : 1

New User


Joined: 07 Apr 2005
Posts: 56

PostPosted: Wed Aug 17, 2005 12:03 pm    Post subject: pagination logic
Reply with quote

Thanx alot Radhakrishnan,

Thats what i am looking for. Thank you very much.
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Wed Aug 17, 2005 3:52 pm    Post subject: Re: pagination logic
Reply with quote

you are welcome
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 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
No new posts DB2 - CURRENT DATE + 2 YRS logic balaji81_k DB2 3 Thu Nov 26, 2015 3:07 am


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