View previous topic :: View next topic
|
Author |
Message |
David Eisenberg
New User
Joined: 15 Nov 2007 Posts: 39 Location: New York
|
|
|
|
Anyone,
I'm a panel language newbie. I'm attempting to make a small modification to a preexisting panel which processes a table. What I'm doing is simply to set one of the fields in the table row to blanks when certain conditions are true. The code works fine, but only on table rows which were modified by the user. I need the code to work unconditionally for every row in the table, whether it is visible on-screen at that moment or not, and whether the user modified a field in that row or not.
I did see a reference to "auto-selection" in the manual; I confess that I'm not even sure that's relevant (although it looks like it is).
I suspect that this is something quite simple, but I have no experience with ISPF tables. Can someone please point me in the right direction?
Thanks so much,
David |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Indeed, this is a straight-forward task:
Code: |
1. Start with openning the table (TBOPEN)
2. Then TBTOP to position the table at start.
3. Then first TBSKIP with NUMBER(1) to get the first record.
4. Initiate a loop (using DO)
5. Update the record
6. TBSKIP again, until RC \= 0
7. Exit the loop
8. Close/Save the table. |
O. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Quote: |
What I'm doing is simply to set one of the fields in the table row to blanks when certain conditions are true. The code works fine, but only on table rows which were modified by the user. |
It seems you are blanking the field in the )PROC section of the panel itself.
Am I right ?
What Ofer proposed should be done in the program, before the TBDISP command. |
|
Back to top |
|
|
David Eisenberg
New User
Joined: 15 Nov 2007 Posts: 39 Location: New York
|
|
|
|
>It seems you are blanking the field in the )PROC section of the panel itself. Am I right ?<
You are absolutely right, and now I realize how much I don't know about this, and that I may have a problem. I don't have access to the program, only the panel. I only have the load module for the program, not the source.
The panel I'm modifying is part of a product we are using. I'm comfortable making modifications to the panel (and indeed, I think this is not uncommon), but any changes I make need to happen within the panel.
So yes, the few lines I added were to the )PROC section, and they do work, but only if a user modifies a field in the row. Is is possible, within the panel itself, to code the sort of loop that Ofer suggested? Or might there be another way to do what I need?
David |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Can you work with the table offline? That is, is it a table that you can manipulate and save and then have the new row information available for the next user?
If so, you can use TBSTATS and TBQUERY to get information about the table size and table structure. Then write a program as O suggested to open the table and update each row. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can invoke REXX/COBOL/any other language from within panel, using the PANEXIT statement.
O. |
|
Back to top |
|
|
David Eisenberg
New User
Joined: 15 Nov 2007 Posts: 39 Location: New York
|
|
|
|
Responding to the last couple of posts...
>Can you work with the table offline?<
No. I really need to do whatever I'm going to do in the foreground, as part of the transaction.
>You can invoke REXX/COBOL/any other language from within panel, using the PANEXIT statement.<
Ah... and if I do that, then I would implement Ofer's algorithm from earlier in this thread?
Is that the only way that I could accomplish this? It's not possible to do it inline within the panel?
David |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Please ignore my suggestion. I just recalled that PANEXIT (just like the newer *REXX statement) can't issue ISPF services. Sorry...
O. |
|
Back to top |
|
|
|