View previous topic :: View next topic
|
Author |
Message |
Harold Barnes
New User
Joined: 27 Oct 2015 Posts: 33 Location: United States
|
|
|
|
I've figured out how to use a panel/table to display and select a line.
The panel has a command line input as well.
Since my table has a 1000s of rows, I would like to add a "FIND" command which would search the table and position the display of he table to start on that row.
I'm thinking of ways to code it but maybe there is a standard set of macros or rexx that add browse commands to a panel view of a table? |
|
Back to top |
|
 |
Harold Barnes
New User
Joined: 27 Oct 2015 Posts: 33 Location: United States
|
|
|
|
After a bit more googling it looks like I ca use CURSOR and CSRROW to set the row number to display.
So if I can figure out how to find which row I want, I can just set the CSRROW?
Is there a table search function? Googling... |
|
Back to top |
|
 |
Harold Barnes
New User
Joined: 27 Oct 2015 Posts: 33 Location: United States
|
|
|
|
It looks like TBSCAN is the command that will search a table for a string and return the row.
Am I on the right track? |
|
Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 701 Location: Denmark
|
|
|
|
Google is fine, but you really should look in the 'ISPF Services Guide' manual.
You can use TBSCAN if you know the entire or prefix value of the variable(s) you wish to position at, otherwise you must scan through the records using TKSKIP. Whether you use TBSCAN or TBSKIP, you save the position using the ROWID(name) parameter, and use TBSKIP ROW(name) to position the display afterwards. You may have to do a TBTOP before reposition, I can't remember offhand.
Alternate you can use TBSCAN or TBSKIP with the POSITION(crpname) parameter and the reposition using TBTOP + TBSKIP NUMBER('crpname'). I looked at some of my code and it looks like I prefer the latter. I seem to remember that the ROWID parameter may cause problems if you add or delete records.
You should also look up the built-in variable ZTSTOP for reposition after a user action. |
|
Back to top |
|
 |
|