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

Query regarding ISPF table and Panel


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

New User


Joined: 31 Mar 2008
Posts: 14
Location: kansas city

PostPosted: Tue Nov 10, 2009 6:20 pm
Reply with quote

Is it possible to display an ISPF table fileds in two-three lines not on a single line, so that Panel contains only one row at a time.
And when I pressed F8, then it will show next row from the table.
Here is my Panel
Code:
)ATTR DEFAULT(%+_)                                                     
  + TYPE(TEXT) INTENS(LOW)  COLOR(YELLOW) SKIP(ON)                     
  % TYPE(TEXT) INTENS(LOW)  COLOR(WHITE) SKIP(ON)                     
  @ TYPE(OUTPUT) INTENS(HIGH) COLOR(RED )                             
  $ TYPE(OUTPUT) INTENS(HIGH) COLOR(GREEN) HILITE(USCORE)             
  ¬ TYPE( INPUT) INTENS(LOW ) CAPS(OFF) JUST(ASIS ) PAD('_')           
  _ TYPE(INPUT) INTENS(HIGH) COLOR(RED) CAPS(ON) HILITE(USCORE)       
  ~ TYPE(OUTPUT) INTENS(HIGH) JUST(RIGHT) CAPS(OFF)                   
                                                                       
)BODY EXPAND(||)                                                       
%----------------------------------------------------------------------
+                       MML ABEND TRACKING SYSTEM                     
%TSO ID:&ZUSER  +                                         %DATE:&ZDATE
+                                                                     
%COMMAND ==>_ZCMD                                         %SCROLL:&AMT
%----------------------------------------------------------------------
+                       TABLE DATA STARTS HERE                         
+                                                                     
)MODEL ROWS(ALL)                                                       
_Z+   %ABEND-CODE : $ABENDCD +      %JOBNAME : $JOBID   +             
      %ABEND-DATE : $DTABEND +                                         
      %ABEND-DATA : $ABNDATA                                           
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       
                                                                    + 
+----------------------------------------------------------------------
+                       BOTTOM OF RECORD                               
)INIT                                                                 
 .ZVARS = 'ABND'       
  &AMT=PAGE                                                             
  &ZTDMARK = '---------- BOTTOM OF TABLE ----------'                   
 )END                                                                                                                 


Where ABND is my table that four coulumns. My main reason so display a singly row on apanel at one time, because ABNDATA have width greater then 200 characters.

The Rexx that I am using is
Code:

/*  REXX */                                                         
TRACE I                                                             
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"                             
ADDRESS ISPEXEC                                                     
"LIBDEF ISPTABL DATASET ID('Z001899.ABEND.ISPFTAB.LIB')"           
"LIBDEF ISPTLIB DATASET ID('Z001899.ABEND.ISPFTAB.LIB')"           
"LIBDEF ISPPLIB DATASET ID('Z001899.PANEL.LIB')"                   
"TBOPEN ABND NOWRITE SHARE"                                         
IF RC <> 0 THEN                                                     
   DO                                                               
   ZEDSMSG ="INVALID TABLE"                                         
   "SETMSG MSG(ISRZ001)"                                           
   EXIT                                                             
END                                                                 
/*    */                                                           
ADDRESS ISPEXEC "VGET (ZPF07 ZPF08) PROFILE"     
SPF07 = ZPF07 ; SPF08 = ZPF08 ;                               
ZPF07 = 'TUP' ; ZPF08 = 'TDOWN'                               
ADDRESS ISPEXEC "VPUT (ZPF07 ZPF08) PROFILE"                 
/*    */                                                     
ADDRESS ISPEXEC                                               
"TBQUERY" ABND "ROWNUM(ROWS)"                                 
"TBTOP" ABND                                                 
ADDRESS ISPEXEC "TBSKIP" ABND "NUMBER(1)"                     
"TBDISPL" ABND "PANEL(TBVIEW2)"                               
/*    */                                                     
VIEWRC = 0                                                   
I = 0                                                         
DO WHILE VIEWRC < 8                                           
 "TBDISPL" ABND "PANEL(TBVIEW2)"                             
 VIEWRC = RC                                                 
 IF VIEWRC < 8   
 THEN DO                                                           
 MSG1 = ''                                                         
 IF ZCMD = 'TDOWN'                                                 
 THEN DO                                                           
 I       = I + 1                                                   
 IF I  > ROWS  THEN                                                 
 DO                                                                 
      MSG1 = 'NO MORE RECORDS.'                                     
      "TBTOP" ABND                                                 
 END                                                               
 ELSE                                                               
 DO                                                                 
      "TBTOP" ABND                                                 
      ADDRESS ISPEXEC "TBSKIP" ABND "NUMBER("I")"                   
 END                                                               
 "TBDISPL" ABND "PANEL TBVIEW2)"   
END                                                     
ELSE IF ZCMD = 'TUP'                                     
THEN DO                                                 
I = I - 1                                               
 IF I = 0 THEN                                           
 DO                                                     
     MSG1 = 'YOU ARE ON SCREEN 1.'                       
     "TBTOP" ABND                                       
 END                                                     
 ELSE                                                   
 DO                                                     
     "TBTOP" ABND                                       
     ADDRESS ISPEXEC "TBSKIP" ABND "NUMBER("I")"         
 END                                                     
 "TBDISPL" ABND "PANEL(TBVIEW2)"                         
 END                                                     
 END
END                                               
"TBCLOSE" ABND                                   
ZPF07 = SPF07 ; ZPF08 = SPF08 ;                   
ADDRESS ISPEXEC "VPUT (ZPF07 ZPF08) PROFILE"     
EXIT                                                                                                                                                                                                 


Now when I try to execute the above REXX it thorws RC = 20 at first display statement. Although I checked the Panel thru ISPF panel check utility, The Panel is fine.

Please Help me.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Nov 10, 2009 10:40 pm
Reply with quote

Sorry, I did not take the time to evaluate your entire program...

But I think you are breaking the rules for )MODEL section. The model rows have to be last thing on the panel. That is probably what gives you a bad return code. But you should get a panel with a dialog error box... don't you get one?

Use option 7 to set breakpoints and debug the error.

Suggestion: I think you can use TBSKIP to move your table cursor... the values for that table row will populate your variables. Use DISPLAY (not TBDISPL) to display the panel. You would need to remove the )MODEL line.
Back to top
View user's profile Send private message
kansassho

New User


Joined: 31 Mar 2008
Posts: 14
Location: kansas city

PostPosted: Wed Nov 11, 2009 12:36 pm
Reply with quote

Hi Pedro

Although your suggestion worked for me.
However, as far concerning about the )Model , I am using a similar kinf of panel to diplay another table that have to display all the rows on a single screen. so the )model in panel i think have no problwm.

Anyways thanks a lot.

The reason I was using the TBDISL, is that I have to display on selected record of table on Panel. I mean to say, only records that have a specfic value for a column in the table.
I am not able to display the records(using panel and rexx, coded as per your suggestion), as I am getting RC 8
Code:

"TBTOP" ABND                                   
JOBID = 'MMPDD040'                             
"TBSARG" ABND "NEXT NAMECOND(JOBID,EQ)"       
"TBSCAN" ABND                                 
/*"TBSCAN " ABND "ARGLIST(JOBID)" */           
 "TBGET" ABND                                 


I am getting RC 8 at TBSCAN as well as TBGET.

Please help me here too.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Nov 11, 2009 2:52 pm
Reply with quote

RC 8 for TBSCAN meand that no row matched your criteria.

You might want to try TBVCLEAR before assigning values to your variables. In addition, check and see (using Dialog trace or 3.16) that there are actually matching rows.

O.
Back to top
View user's profile Send private message
kansassho

New User


Joined: 31 Mar 2008
Posts: 14
Location: kansas city

PostPosted: Wed Nov 11, 2009 6:06 pm
Reply with quote

There are rows matching this value, but still this problem comes.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Nov 11, 2009 8:38 pm
Reply with quote

You mention two separate requirements:
1. display only one row from the table
2. display all rows of the table

For the first, you would use DISPLAY service of panel without )MODEL.
For the second, you would use TBDISPL service of a panel with )MODEL.

Your table and program logic should work regardless of DISPLAY or TBDISPL
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Nov 11, 2009 10:16 pm
Reply with quote

I did not see TBOPEN or TBCREATE in your sample program.
Back to top
View user's profile Send private message
kansassho

New User


Joined: 31 Mar 2008
Posts: 14
Location: kansas city

PostPosted: Thu Nov 12, 2009 3:27 pm
Reply with quote

Hi Pedro

I already create the table, using the code
Code:

"TBCREATE ABND keys(ABENDCD,JOBID,DTABEND) names(ABNDATA) SHARE"


And before reading the table, I opened it.

My requirement was to get selected records from the above table(means the records macthicng a specfied value for the Colummn JOBID) and then write these records to a file and in other case to display those records.

Please help me.
Thanks for your all help
Back to top
View user's profile Send private message
kansassho

New User


Joined: 31 Mar 2008
Posts: 14
Location: kansas city

PostPosted: Thu Nov 12, 2009 3:50 pm
Reply with quote

The code that I am using to get the record
Code:

ADDRESS ISPEXEC                               
"TBOPEN ABND"                                 
"TBQUERY" ABND "ROWNUM(ROWS)"                 
"TBTOP" ABND                                 
"TBVCLEAR ABND"                               
JOBID = 'MMPDV999'                           
"TBSARG" ABND "NEXT NAMECOND(JOBID,EQ)"       
RC1 = RC                                     
ISPEXEC "TBSCAN" ABND                         


Now when I executes this, TBSARG gives me RC as 00, but TBSCAN gives me RC as 8, means no matching record, however I have matching record.

Please see the code and suggest me
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Nov 12, 2009 9:49 pm
Reply with quote

How was the table built? Perhaps you have trailing blanks in the JOBID variable. (though, I am not sure it matters)
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Fri Nov 13, 2009 2:58 pm
Reply with quote

ABND is used as a "Z" variable name place holder (.ZVARS = 'ABND').

In the rexx coding i see a lot of statements where ABND is not within quotes. My guess is that ABND is treated as a variable with contents
unknown, which result in errors.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Nov 13, 2009 8:35 pm
Reply with quote

Good catch, Peter.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Sat Nov 14, 2009 7:55 pm
Reply with quote

Well Pedro, thank you very much.
Back to top
View user's profile Send private message
kansassho

New User


Joined: 31 Mar 2008
Posts: 14
Location: kansas city

PostPosted: Mon Nov 16, 2009 12:24 pm
Reply with quote

Hi Peter

That is not the issue. I used the table name without using quotes in other program, and they are working fine.

However, I tried your suggestion, but bad luck it is not working the same RC=8.

Anyways Thanks for looking in to my issue.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


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

PostPosted: Mon Nov 16, 2009 2:17 pm
Reply with quote

Maybe using JOBID as primary key or only key in your TBCREATE statement will make a difference.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Nov 16, 2009 8:26 pm
Reply with quote

Quote:
I used the table name without using quotes in other program, and they are working fine.


It is a problem waiting to happen.

FYI... The problem that Peter noticed is that 1) the table name is not quoted AND the 2) same variable is used in the )MODEL section. The ABND field is part of the )MODEL section, and is defined as a single character input field.

1. The name used in TBOPEN is quoted and uses a name of ABND.
2. because you then switch to an input field provided by the user, it will likely not match the value of 'ABND'

If that is what you really want, you probably need to check for valid input values and issue TBOPEN for any supported table names.
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 Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts Preserve changes to ISPF Panel Variables TSO/ISPF 5
No new posts can an ISPF appl save user changes in... TSO/ISPF 14
No new posts Unload and Load ISPF Table TSO/ISPF 4
No new posts ISPF Table to add a new column TSO/ISPF 1
Search our Forums:

Back to Top