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

Forcing a single (or no) selection within a TBDISPL call


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ron Masters
Currently Banned

New User


Joined: 21 Dec 2011
Posts: 24
Location: UK

PostPosted: Thu Aug 30, 2012 4:15 pm
Reply with quote

Dear people
I'm long in the tooth on rexx, but a beginner at making ISPF Services dance for me. Here's my rexx fragment...
Code:

panel = "PANEL(URPNAMLA)"     
do until rc >= 8             
  cmd = "TBDISPL" table panel
  address ISPEXEC cmd         

...and here's my panel...
Code:

)ATTR                                                                   
/*********************************************************************/
/*                                                                   */
/*  Aggregate Name List panel                                        */
/*                                                                   */
/*  Amendment Log                                                    */
/*  -------------                                                    */
/*  19 Jun 2012  RM  Original code                                   */
/*********************************************************************/
 09 TYPE(FP)                               /* Field prompt           */
 26 TYPE(NEF) CAPS(ON) PADC(USER)          /* Normal entry field     */
# TYPE(OUTPUT) COLOR(WHITE)                                             
[ TYPE(OUTPUT) COLOR(GREEN)                                             
~ TYPE(OUTPUT) COLOR(BLUE)                                             
% TYPE(TEXT)   INTENS(LOW)  SKIP(ON) COLOR(WHITE)                       
+ TYPE(TEXT)   INTENS(LOW)  SKIP(ON) COLOR(BLUE)                       
$ TYPE(TEXT)   INTENS(LOW)  SKIP(ON) COLOR(GREEN)                       
] TYPE(TEXT)   INTENS(LOW)  SKIP(ON) COLOR(TURQ)                       
_ TYPE(NEF)    CAPS(ON)                                                 
)BODY  CMD(ZCMD)  Expand({}) WIDTH(&ZSCREENW)                           
{ }+User Repository V101 { }                                         
 Command ===> ZCMD { }  Scroll ===> AMT                               
$                                                                     
$                                                                     
$Aggregate list of Names        Filters                               
$                               System :#filsys     $Service :#filsvc
$                               Userid :#filusr     $CEN     :#filcen
$                                                                     
+Primary commands. . :%L                                             
+Line commands . . . :%S                                             
$                                                                     
%S  Count  Name                                                       
%-  -----  {-}                                                       
)MODEL                                                               
_s$[tblcnt[tblname                                                   
)INIT                                                                 
)PROC                                                                 
 VER (&ZTDSELS,LIST,0000,0001,MSG=URM001B)                           
 VER (&S,LIST,S,MSG=URM001D)                                         
)END                                                                 

...in which msg URM001B is 'Select just one' and msg URM001D is 'Invalid line command'.

The requirement is to prevent control returning from TBDISPL with rc(4).

My panel when displayed is fine. When I type 'S' as a line command into more than one row and hit Enter, these things happen: control is not returned from TBDISPL, I get msg URM001B as expected and the cursor is positioned on the first row selected, and the line commands are still there where I typed them. All this is good.

What I want now is to be able to remove all (or all but one) of my line commands, so that verification in the )PROC section will succeed and control will return from TBDISPL to the rexx.

The problem is that the first VER in the )PROC sention continues to produce msg URM001B and re-display the panel without returning control, setting the cursor to the first row where I had entered a line command, even though I blanked it out.

Please does anyone know how I can write the panel so that TBDISPL will check there is no more than one row which has a non-blank line command, and that that line command is an 'S'?

Thanks
Ron
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 30, 2012 5:47 pm
Reply with quote

Dont check ZTDSELS in )PROC, but in your code. If > 1 display message
and set ZTDSELS = 0 and redisplay your panel. Maybe that will work.
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Thu Aug 30, 2012 6:09 pm
Reply with quote

Adopt this example:
Code:
/* REXX - Sample TBDISPL Dialog                                      */

/* I use panel ISPYVPN as it exists in standard ispf libraries.      */
address ispexec
'control errors return'

/* Initialize some working variables.                                */
table    = 'sample'
panel    = 'ispyvpn'
loop_end = 0
ispyvll  = '99'
ispyvls  = ''

/* First create the table and load some sample data.                 */
'tbcreate' table 'names(ispyvvn ispyvpl ispyvat ispyvvl) nowrite'
do i = 1 by 1 to 22
   ispyvvn = 'Var#' i
   ispyvpl = i
   ispyvat = i
   ispyvvl = 'Value' random(1,100)
   'tbadd' table
end
'tbtop' table

/* Now display the table and start the loop processing.              */
do while loop_end = 0
   ispyvlc = ''                  /* Initialize line command field    */
   'TBDISPL' table 'PANEL(' !! panel !! ')'
   if rc > 4 then loop_end = 1   /* User wants to leave the dialog   */
   else do
      select
         when ztdsels > 1 then , /* Multiple lines were selected     */
              do
                 zedlmsg = 'Please select only ONE line'
                 'setmsg msg(isrz001)'
              end
                                 /* Process valid line command 'S'   */
         when ((ztdsels = 1) & (ispyvlc = 'S')) then ,
              do
                 zedlmsg = '<S> on variable' ispyvvn 'completed'
                 'setmsg msg(isrz000)'
              end
                                 /* Process valid line command 'Q'   */
         when ((ztdsels = 1) & (ispyvlc = 'Q')) then ,
              do
                 zedlmsg = '<Q> on variable' ispyvvn 'completed'
                 'setmsg msg(isrz000)'
              end
         otherwise NOP           /* Reposition the table display     */
              do                 /* when user did nothing than ENTER */
                 'tbtop' table
                 'tbskip' table 'row(' !! ztdtop !! ')'
              end
      end
   end
end
'tbend' table
exit
Back to top
View user's profile Send private message
Ron Masters
Currently Banned

New User


Joined: 21 Dec 2011
Posts: 24
Location: UK

PostPosted: Thu Aug 30, 2012 6:11 pm
Reply with quote

Thanks for the quick response, Peter.

I want to avoid returning to the rexx if possible.

Ron
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 30, 2012 6:21 pm
Reply with quote

Well what someone wants is not always possible, but maybe you can do it in the )INIT or )REINIT section of the panel.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 30, 2012 6:57 pm
Reply with quote

Hello,

Quote:
I want to avoid returning to the rexx if possible.
If you post why you prefer this, it will help us understand.
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 How to append a PS file into multiple... JCL & VSAM 3
No new posts Submit multiple jobs from a library t... JCL & VSAM 14
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Call program, directly from panel CLIST & REXX 9
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top