I am facing an issue in implementing the scrolling logic .
Iam using KSDS file with START BR options(GTEQ) and READ PREV(PF7) and READ NEXT(PF8) . Screen is designed to show 8 records at a time .
Whenever the user presses the PF8 and PF7 the scrolling logic will be performed. But i had a requirement that if user place the cursor at the 4th record and press PF8 then the screen will start from 4th record to 12th record and vice versa . I dont know how to map the cursor postion and check and transform the control to startbr with key field.
Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
I recommend you go to the CICS Application Programming Reference manual and research EIBCPOSN.
You need to think up a way to keep track of each key on the screen, not just the first and last, so if EIBCPOSN indicates the cursor is on a lne of the screen you can use the key on that line to browse the file and regenerate the screen of data.
Since each site tends to have its own way of doing things like this, your best bet would be to talk to your site support group, team leader, or a coworker about how your site does CICS paging.
Joined: 24 Jan 2011 Posts: 22 Location: California
As Robert suggests.
Use EIBCPOSN after the Receive Map and convert it into a ROW number.
You may or may not need to use DEFSCRNWD.
Then use the Row number to pick up the key of the record at that row from which you are to resume and use EIBAID to determine whether you are going backwards or forwards.
Also if the user did not position the cursor - you would presumably want to scroll a full page of 8 records.
Don't just hold the keys from a bunch of records though as other users may be inserting/deleting records whilst you are scrolling so you need to to cater for that.
You also need to cater for being at the beginning or end of the file if the user were to try a scroll. e.g. if you are on the first screen and the user positioned the cursor on row 6 and pressed PF7 to go backwards.
If the file you are reading is volatile, you may need to go back and reread the records again in case anything was changed by another user.