Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Forcing a single (or no) selection within a TBDISPL call
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: 2433
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 30, 2012 5:47 pm    Post subject:
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    Post subject: Re: Forcing a single (or no) selection within a TBDISPL call
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    Post subject:
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: 2433
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 30, 2012 6:21 pm    Post subject:
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

Site Director


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

PostPosted: Thu Aug 30, 2012 6:57 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Need help in triggering a PL1 module ... Varungv99 IMS DB/DC 0 Fri Apr 07, 2017 10:01 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us