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

REXX table content on panel will be reduzed after Enter


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
DaPusti

New User


Joined: 27 Apr 2021
Posts: 2
Location: England

PostPosted: Tue Nov 16, 2021 6:11 pm
Reply with quote

Hello together,

i searched multiple times for some examples but couldnt find it. It build a REXX that will display a panel. In this panel i got a variable with inputfield. If the user fill this inputfield and type "GO" in the commandline the panel should be added with multiple lines.

I got not problem with the REXX to display the Panel. To solve the problem with the multiple lines, i build a Table and filled it with values depending on the input of the user. It´s also working that after the "go" the panel will be displayed with the filled values. But after i use the Keyword enter my Panel will be display with only 1 line and i dont know why..I think it will jump to the DISPLAY PANEL(PHYPFX01) and ignores my content of the table. But why is there still 1 row? And how could i fix it, that after the "GO" the content with the table has now to be displayed and only if i use "REF" the panel will be displayed without the table.




Code:

ADDRESS ISPEXEC                               
"TBCREATE "HOTFVER" NAMES(HTYPE HMODUL) NOWRITE
 REPLACE"                                     
DO FOREVER                                     
  ADDRESS ISPEXEC "DISPLAY PANEL(PHYPFX01)"   
  IF RC <> 0 THEN LEAVE                       
  IF STRIP(ZCMD) = "GO" THEN                   
  DO                                           
       
    HTYPE = "COMPILE"                         
    HMODUL= PATHC                             
    "TBADD "HOTFVER" ORDER"                   
                                               
    HTYPE = "LINK"                             
    HMODUL= PATHL                             
    "TBADD "HOTFVER" ORDER"                   
                                       
    "TBTOP HOTFVER"                     
    "TBDISPL HOTFVER PANEL(PHYPFX01)   
     CURSOR(ACT) CSRROW(1) AUTOSEL(NO)"
  END                                   
END                                     
   
                                       
EXIT 0                     
           


Thank you very much for the answers
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Nov 16, 2021 7:00 pm
Reply with quote

You need the TBDISPL command to display a table panel, also the use of two DISPLAY commands in one loop will be confusing.
Is your panel really a table display panel (with a )MODEL) line?
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Nov 16, 2021 9:09 pm
Reply with quote

Perhaps the following demo can help. It
- builds and activates an internal table panel.
- create a temporary table.
- adds 4 lines to the table, displaying the table as lines are added.
- quits freeing all resources.

It might be slightly over-engineered, but it works.

Code:
                                                                   
/*                                                                   
 demo - add lines to active table panel                               
*/                                                                   
 parse value '' with libdd pnldd tbl pnl                             
 /* make panel */                                                     
 lan=0                                                               
 len=0                                                               
 do n=1 to sourceline() until lan<>0                                 
   if translate(word(sourceline(n),1))=')ATTR' then lan=n             
 end                                                                 
 if lan=0 then call quit 'ATTR stmt not found'                       
 do n=lan to sourceline() until len<>0                               
    if translate(word(sourceline(n),1))=')END' then len=n             
 end                                                                 
 if len=0 then call quit 'END stmt not found'                         
 pln=0                                                               
 do n=lan to len                                                     
   parse value pln+1 strip(sourceline(n),'t') with pln pl.pln         
 end                                                                 
 pl.0=pln                                                             
 cc=bpxwdyn('alloc new delete rtddn(libdd) rtdsn(libds) dir(1)',     
    'lrecl(80) recfm(f,b) blksize(0) tracks space(1,1) unit(sysda)') 
 if cc<>0 then Call quit 'alloc lib failed' cc                       
 zz=        'alloc shr da('libds'('libdd') rtddn(pnldd)'             
 cc=bpxwdyn('alloc shr da('libds'('libdd') rtddn(pnldd)')             
 if cc<>0 then Call quit 'alloc pnl failed' cc                       
 "execio" pln "diskw" pnldd "(stem pl. finis)"                       
 if rc<>0 then Call quit 'write pnl failed' rc                       
                                                                     
 /* display */                                                       
 address ispexec                                                     
 "control errors return"                                             
 "libdef ispplib library id("libdd")"                                 
 if rc<>0 then Call quit 'libdef failed' rc zerrlm                   
 pnl=libdd                                                           
 tbl=libdd                                                           
 "tbcreate" tbl "names(text) nowrite"                                 
 if rc<>0 then Call quit 'tbcreate failed' rc zerrlm                 

 do pn=1 to 4                                                         
   "tbbottom" tbl                                                     
   text='Line' pn 'added'                                             
   "tbadd" tbl                                                       
   "tbtop" tbl                                                       
   "control display lock"                                             
   "tbdispl" tbl "panel("pnl")"                                       
   if rc>8 then Call quit 'tbdispl failed' rc zerrlm                 
   if rc>0 then leave                                                 
   call syscalls 'ON'        /* wait */                               
   address syscall 'sleep 3' /* three */                             
   call syscalls 'OFF'       /* seconds */                           
 end                                                                 
                                                                     
 Call Quit                                                           
                                                                     
Quit:                                                   
 if tbl  <>'' then address ispexec "tbend" tbl         
 if pnl  <>'' then address ispexec "libdef ispplib"     
 if pnldd<>'' then zz=bpxwdyn('free dd('pnldd')')       
 if libdd<>'' then zz=bpxwdyn('free dd('libdd')')       
 if arg(1)<>'' then say arg(1)                         
 exit 0                                                 
 /*                                                     
)ATTR                                                   
 # type(output) color(turq) caps(off)                   
 _ type(input)  color(turq)  caps(on) hilite(uscore)   
 + type(text )  color(green) skip(on)                   
 " type(text )  color(blue)  skip(on)                   
)BODY EXPAND(\\)                                       
%\ \Show text\ \+                                       
%Cmd ==>_ZCMD \ \%Scrl#scrl+                           
+                                                       
+                                                       
)MODEL                                                 
#text                                                   
)INIT                                                   
)PROC                                                   
)END                                                   
 */                                                     
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Nov 16, 2021 10:50 pm
Reply with quote

I agree with Willy... verify that the panel is coded as a table display: make sure it has a )MODEL section.
Back to top
View user's profile Send private message
DaPusti

New User


Joined: 27 Apr 2021
Posts: 2
Location: England

PostPosted: Wed Nov 17, 2021 2:30 pm
Reply with quote

Thank you for your answers. I got a MODEL in my Panel-definition:

)MODEL
çz$@htype $@hmodul $

And the table is displayed in my panel. But it just seems that after every Enter it jumps within the table to the next entry and only displays this entry.

I´m new to this table+panel definition, but could it be that Enter is a keyword to jump from one entry of the table to the next entry and so only this one will be displayed?

Kind regards
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Nov 17, 2021 6:19 pm
Reply with quote

You still have a DISPLAY command in there.

Try this, it probably will not give you exactly want you want, but it should give you some idea of how table services work:
Code:
 DO FOREVER                             
   "TBTOP" HOTFVER                       
   "TBDISPL" HOTFVER "PANEL(PHYPFX01)", 
   ZCMD=''                               
   "CURSOR(ACT) CSRROW(1) AUTOSEL(NO)"   
   IF RC <> 0 THEN LEAVE                 
   IF STRIP(ZCMD) = "GO" THEN DO         
     "TBBOTTOM" HOTFVER                 
     HTYPE = "COMPILE"                   
     HMODUL= PATHC                       
     "TBADD" HOTFVER                     
     "TBBOTTOM" HOTFVER                 
     HTYPE = "LINK"                     
     HMODUL= PATHL                       
     "TBADD "HOTFVER                     
   END                                   
 END                                     
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Nov 17, 2021 7:04 pm
Reply with quote

In the TBCREATE command you use HOTFVER like it is a variable containing the table name, but later in the TBTOP and TBDISPL is is a literal. Which one should it be?
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Load new table with Old unload - DB2 DB2 6
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top