Conditional Display [TBDISPL] before using any panel



IBM's Command List programming language & Restructured Extended Executor

Conditional Display [TBDISPL] before using any panel

Postby nkulkarni » Tue Jul 19, 2016 5:03 pm

Hi,

In a program I display an ISPF table using below code (which is working fine :-) )...


display_coll:                                
                                             
do forever                                  
   zcmd = ''                                
   ztdsels = 0                              
   "ISPEXEC TBDISPL COLLDATA PANEL(SIAELM98)"
   prc = rc                                  
   SELECT                                    
     WHEN ztdsels > 0 THEN DO                
         "ADDPOP ROW(01) COLUMN(03)"        
         "DISPLAY PANEL(SIAELM97)"          
          prc = rc                          
         "REMPOP ALL"                        
          END                                
     WHEN prc <> 0 then do                  
          leave                              
          end                                
     OTHERWISE NOP                          
   END                                      
 


I want to display contents of the table "COLLDATA" conditionally using the panel "SIAELM98" when table has more than 1 row...Else I want to display the data using panel "SIAELM97"

Could you please help ?
NK
nkulkarni
 
Posts: 52
Joined: Mon Sep 28, 2015 2:28 pm
Has thanked: 17 times
Been thanked: 0 time

Re: Conditional Display [TBDISPL] before using any panel

 

Re: Conditional Display [TBDISPL] before using any panel

Postby willy jensen » Tue Jul 19, 2016 7:02 pm

The TBQUERY command can return the number of rows.

These users thanked the author willy jensen for the post:
nkulkarni (Wed Jul 20, 2016 3:54 pm)
willy jensen
 
Posts: 108
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 18 times

Re: Conditional Display [TBDISPL] before using any panel

Postby Pedro » Tue Jul 19, 2016 9:14 pm

... and after knowing how many panels you have, use a variable for the panel name:

if tablrows > 1 Then
  panname = SIAELM98
Else
  panname = SIAELM97
do forever                                  
   zcmd = ''                                
   ztdsels = 0                              
   "ISPEXEC TBDISPL COLLDATA PANEL("panname")"
 
Pedro Vera

These users thanked the author Pedro for the post:
nkulkarni (Wed Jul 20, 2016 3:54 pm)
User avatar
Pedro
 
Posts: 562
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 38 times

Re: Conditional Display [TBDISPL] before using any panel

Postby nkulkarni » Wed Jul 20, 2016 3:56 pm

Thank you Pedro & Willy Jensen. I have used TBQUERY command to load the number of rows in the table to a variable and used it in conditional processing...
NK
nkulkarni
 
Posts: 52
Joined: Mon Sep 28, 2015 2:28 pm
Has thanked: 17 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post