IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Trouble Scrolling TBDISPL in my Panel


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Mon Sep 09, 2013 3:03 pm
Reply with quote

HI All,
I am coding one tool Where I need to take few input parameters from user and delete some files on behalf of those parameters , Before that I have to ask user that how many files he want to delete.. So I coded 2 panels one is normal whihc will ask for the number of files and then depending on the number of files my second panel will display to take the inputs from user..

For example if user enter 11 in first panel so my second panel will be like below

Code:
e Command ===>                                          Scroll===> CSR        e
e                                                                             e
e  ENTER BELOW THE PARAMETERS PASSED BY AGENCIES TO DELETE THE FILES:-        e
e                                                                             e
e  RCD = Recovery Code  TIME= Time of File MIO = MIO Code Date= Date of File  e
e  AMT = AMOUNT OF FILE   NOI = NUMBER OF ITEMS                               e
e                                                                             e
e  REC-CODE  MIO     TIME-OF-FILE    NUM-OF-ITEMS     AMOUNT-OF-FILE          e
e  -------   ---     ------------    ------------     ---------------         e
e  R.1-         MI.1-        TI.1-            IT.1-       AM.1-               e
e  R.2-         MI.2-        TI.2-            IT.2-       AM.2-               e
e  R.3-         MI.3-        TI.3-            IT.3-       AM.3-               e
e  R.4-         MI.4-        TI.4-            IT.4-       AM.4-               e
e  R.5-         MI.5-        TI.5-            IT.5-       AM.5-               e
e  R.6-         MI.6-        TI.6-            IT.6-       AM.6-               e
e  R.7-         MI.7-        TI.7-            IT.7-       AM.7-               e


And if I want to scroll down here to see all the rows are displayed correctly I press PF8 and simply I can get to the bottom .. But now .. If I enter the data in first screen and prerss PF8 then the control directly transfers to my rexx program and does not comes back to me


Code:
 Command ===>                                          Scroll===> CSR       
                                                                           
  ENTER BELOW THE PARAMETERS PASSED BY AGENCIES TO DELETE THE FILES:-       
                                                                           
  RCD = Recovery Code  TIME= Time of File MIO = MIO Code Date= Date of File
  AMT = AMOUNT OF FILE   NOI = NUMBER OF ITEMS                             
                                                                           
  REC-CODE  MIO     TIME-OF-FILE    NUM-OF-ITEMS     AMOUNT-OF-FILE         
  -------   ---     ------------    ------------     ---------------       
  R.8-         MI.8-        TI.8-            IT.8-       AM.8-             
  R.9-         MI.9-        TI.9-            IT.9-       AM.9-             
  R.10-        MI.10-       TI.10            IT.10       AM.10             
  R.11-        MI.11-       TI.11            IT.11       AM.11             
 ***************************** Bottom of data ******************************


Please put some light on this that how can I enter the the data in entire screen thorwn by TBDISPL ..or show me a way to achieve what I am trying to do ...

Please refer the below link if you want to see my PANEL and rexx Code ( Please refer the last 2 codes I paste there ).. I am starting this new post here Since I felt my below post is bit confusing and I was not much clear on that post ,with lot of code paste icon_confused.gif

ibmmainframes.com/viewtopic.php?t=61597&highlight=

Let me know if I am not clear above or you have questiosn.. Many Thanks in Advance .. I really want it to be working as soon as possible
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Mon Sep 09, 2013 6:29 pm
Reply with quote

You have to use a Do While loop to repeat the table display after each user interaction. Exit the loop until the user presses F3. Check the return code of TBDISPL.
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Mon Sep 09, 2013 6:43 pm
Reply with quote

I strongly recommend to read the "ISPF Dialog Developers Guide and Reference" very carefully and completely. This document contains working samples and excellent explanations about nearly everything an ISPF dialog developer needs.
As general rules you should know the following:
ISPF offers several services for creating, manipulating and displaying ISPF tables. The TBDISPL service is most suitable for "browsing" data in tabular form as this service handles scrolling of the displayed table contents and positioning within the table data with no action required by your program. The control is (normally) passed back to your program only if the user had entered END (or pressed an equivalent function key).
But if you want to use a table display for entering additional data (such as a selection field) you have to add an input field to the table line defined in the )MODEL section. Keep in mind that this input field is NOT part of the table data. It will be replicated by ISPF itself as if it was a table column. So the user can enter data against every single line. This ISPF knows what line has been selected. That is the reason why a TBDISPL service always should be coded within a loop. You can use predefined variables to llop htrough all lines that have been selected by the user via re-invoking the TBDISPL service without refreshing the display itself. Each follow-up invocation only feeds the variables of the table with the content of the selected table row. Read the above mentioned documentation especially about table display processing.
It is also possible to define the original table fileds as input. This makes it possible to get the update values of a "touched" table line and use it with a TBPUT service for updating the underlying ISPF table.
It might take a while to fully understand the simple dialogs provided as samples in the IBM docs. But once you have got it running you'll see how brilliant these services are, and still modern too.
Forget about other techniques offered by ISPF such as dynamic areas. These provide extended features for advanced users for solving problems which are way beyond your small dialog.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Sep 10, 2013 12:08 am
Reply with quote

Stefan, I do not think you were clear here:
Quote:
Keep in mind that this input field is NOT part of the table data. It will be replicated by ISPF itself as if it was a table column. So the user can enter data against every single line.


Your panel should show a 'Select' column: the user will use this column to issue line commands. Your TBCREATE statement needs to include a variable for the line command field. Use the same name in the )MODEL line as in the TBCREATE.
Back to top
View user's profile Send private message
thesumitk

Active User


Joined: 24 May 2013
Posts: 156
Location: INDIA

PostPosted: Thu Sep 12, 2013 10:57 pm
Reply with quote

HI Pedro,

Thanks for your suggestions !

I got your and stefan's point but I am not able to get an idea that how would I do it .. I mean I tried it but not getting the desired results..

Put my TBDISPL in loop till the number of iteration user entered? or till any flag I need to set ?
PLease provide me some more information on this .. I am not getting this
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Sep 13, 2013 12:30 am
Reply with quote

The beauty of using ISPF Services correctly is that the end user should intrinsically know how to use them. Don't forget that ISPF Services rely heavily on the return-code value of the Service being called.

For a table display, there are, to the best of my knowledge, three possible conditions you need to check for:

- RC=0 the user did nothing, probably pressed the Enter key without any other actions. This should cause a re-display of the table.

- RC=4 the user selected one or more rows. You need to code some sort of routine to process the row variables at that time, then re-display the table with CONTROL DISPLAY LOCK, and keep going until there are no more selected rows (RC=0).

- RC=8 the user entered END so the table display process should end, and control returned to the previous display, or just end the dialog.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Sep 13, 2013 1:26 am
Reply with quote

I think you need two loops!

outer loop: TBDISPL mytabl PANEL(mypanl)

if ZTDSELS > 0
inner loop:
1. process current row
2. TBDISPL mytabl <with no parameters to get next row>

The inner loop should be done for the number of rows changed by the user. TBDISPL mytabl without other parameters tells ISPF to navigate to the next row touched by the user.

repeat outer loop until user press F3 (RC=8)

Search the manuals for ZTDSELS and TBDISPL
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Call program, directly from panel CLIST & REXX 9
No new posts scrolling horizontally TSO/ISPF 35
No new posts panel creation question TSO/ISPF 12
No new posts Panel variable model line TSO/ISPF 3
Search our Forums:

Back to Top