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

Refresh Content on Model line variable


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

New User


Joined: 08 Oct 2008
Posts: 5
Location: washington state

PostPosted: Thu Oct 09, 2008 7:29 pm
Reply with quote

I have a panel that displays using a variable in the )MODEL statement. The value of the variable can change. I want to dynamically refresh the screen when requested by the user. This works sort of, it has to be executed twice for it to work. Here is a sample of my code. In my REXX program I set the variable &SHOWDT to "Y" or to "N", then I look at that to build the model line.

Code:

)MODEL CLEAR(PGMOPT STATUS) ROWS(&MODTYPE)                             
&TBLLINE                                                               
)INIT                                                                 
 .HELP = PMSH01                                                       
 &ZHTOP=PMSH01                                                         
                                                                       
 .ZVARS =                                                             
  '(ZSCBR PGMOPT PGMNAME, +                                           
    REL VER CSR SUBGRP USER LDATE LOC, +                               
    STATUS LOCK MIGRATE)'                                             
                                                                       
 &LINEBASE = '@Z !Z       !Z   !Z !Z     !Z  $Z   $Z     $Z$Z      $Z'
 &LINEDTS = '$MODDT $MIGPOS$MIGCVC¬$Z¬'                               
 &LINECMT = '!COMMENTS             $Z¬'                               
                                                                       
 VGET (SHOWDT) PROFILE                                                 
 IF (&SHOWDT = 'Y')                                                   
   &TBLLINE = '&LINEBASE.&LINEDTS'                                     
 ELSE                                                                 
   &TBLLINE = '&LINEBASE.&LINECMT'                                     
 VPUT (SHOWDT TBLLINE) PROFILE                                         
                                       
)REINIT                                 
 VGET (SHOWDT) PROFILE                 
 IF (&SHOWDT = 'Y')                     
   &TBLLINE = '&LINEBASE.&LINEDTS'     
 ELSE                                   
   &TBLLINE = '&LINEBASE.&LINECMT'     
 VPUT (SHOWDT TBLLINE) PROFILE         
 REFRESH(TBLLINE)                       
)PROC                                   
 VGET (SHOWDT TBLLINE) PROFILE         
)END                                   


Any idea of why it has to be executed twice for it to work?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Oct 09, 2008 9:36 pm
Reply with quote

Because of the way you use TBLLINE variable, I get the impression that you are not displaying a table!

I think panels with )MODEL sections are meant to be used with TBDISPL service (and in your program, also use TBCREATE, TBADD, etc...). I suspect without using table services, you get unpredictable results.
Back to top
View user's profile Send private message
russnesbitt

New User


Joined: 08 Oct 2008
Posts: 5
Location: washington state

PostPosted: Thu Oct 09, 2008 10:03 pm
Reply with quote

No, I am using a table. The reason I am doing it this way is to simulate page right and left. When the customer wants to show different fields I change the value of "tblline". I was doing this in my REXX code and it was working fine, but I had to add some fields and it became kindof a pain to change all the places in the REXX code. So I am trying to do it all in the panel.

I think it should work. For testing I am showing the value of tblline on the panel and it gets changed correctly, but the table data does not change until the second time I redisplay the panel.

Here it is showing correctly (when I first come in)
Code:

-------------------------------  SHOWING COMMENT ------------------------------
COMMAND ==>                                                 Row 1 to 35 of 396
  @Z !Z       !Z   !Z !Z     !Z  $Z   $Z     $Z$Z      $Z!COMMENTS             $
                                    CHECKED          L                         
   PGM NAME  REL VR  CSR   GRP USER   OUT  L STATUS  K COMMENTS              M
-- -------- ---- -- ------ --- ---- ------ - ------- - --------------------- -
__ ALI0415A 45X_ 00 R1218_ AUD 1218 200409 T _______ _ AUDIT________________ B
__ ALI200XA 60X_ 00 R5359_ ST9 5359 200703 T _______ _ SORT TAX DET PAYMENTS B
__ ALI200XD 60X_ 00 R5359_ ST9 5359 200703 T _______ _ NPI PHASE 3__________ B


Here is what it looks like after I try to change the display. If you look just below the command line you will see the value of tblline. It is correct. My titles changed but not the table data ...
Code:

-------------------------------  SHOWING DATES   -----------------------------
COMMAND ==>                                                 Row 1 to 35 of 396
 @Z !Z       !Z   !Z !Z     !Z  $Z   $Z     $Z$Z      $Z$MODDT $MIGPOS$MIGCVC¬
                                    CHECKED          L  LAST    MIG    MIG   
   PGM NAME  REL VR  CSR   GRP USER   OUT  L STATUS  K MOD DT TO POS TO CVC  M
-- -------- ---- -- ------ --- ---- ------ - ------- - --------------------- -
__ ALI0415A 45X_ 00 R1218_ AUD 1218 200409 T _______ _ AUDIT________________ B
__ ALI200XA 60X_ 00 R5359_ ST9 5359 200703 T _______ _ SORT TAX DET PAYMENTS B
__ ALI200XD 60X_ 00 R5359_ ST9 5359 200703 T _______ _ NPI PHASE 3__________ B



And now here it is, displayed correctly after the second time ...
Code:

-------------------------------  SHOWING DATES   ------------------------------
COMMAND ==>                                                 Row 1 to 35 of 396
  @Z !Z       !Z   !Z !Z     !Z  $Z   $Z     $Z$Z      $Z$MODDT $MIGPOS$MIGCVC¬$
                                    CHECKED          L  LAST    MIG    MIG     
   PGM NAME  REL VR  CSR   GRP USER   OUT  L STATUS  K MOD DT TO POS TO CVC  M
-- -------- ---- -- ------ --- ---- ------ - ------- - --------------------- -
__ ALI0415A 45X_ 00 R1218_ AUD 1218 200409 T _______ _ 200409 ______ ______  B
__ ALI200XA 60X_ 00 R5359_ ST9 5359 200703 T _______ _ 200703 ______ ______  B
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Oct 09, 2008 11:15 pm
Reply with quote

You have some assignment statements in the )INIT section. Try putting the same assignment statements in the )REINIT section.

FYI. I think it is easier to have two separate panels and display the desired one as needed.
Back to top
View user's profile Send private message
russnesbitt

New User


Joined: 08 Oct 2008
Posts: 5
Location: washington state

PostPosted: Fri Oct 10, 2008 2:51 am
Reply with quote

Yes, I had already tried moving the assignment statments to the reinit section. I guess I will take a look at what it will take to create two seperate panels.

Thanks for your time.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Oct 10, 2008 5:04 am
Reply with quote

Quote:
already tried moving

I meant to have in both places.

Quote:
what it will take to create two seperate panels

Just copy the original, then edit both and remove the stuff that does not belong in that panel. Your application needs to display one panel or the other based on if LEFT or RIGHT was pressed.
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts rewrite same SAY line CLIST & REXX 8
Search our Forums:

Back to Top