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
 

 

Query regarding ISPF table and Panel

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Query regarding ISPF table and Panel
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

Senior Member


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

PostPosted: Tue Nov 10, 2009 10:40 pm    Post subject: Reply to: Query regarding ISPF table and Panel
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    Post subject:
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: 2360
Location: Israel

PostPosted: Wed Nov 11, 2009 2:52 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Wed Nov 11, 2009 8:38 pm    Post subject: Reply to: Query regarding ISPF table and Panel
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

Senior Member


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

PostPosted: Wed Nov 11, 2009 10:16 pm    Post subject: Reply to: Query regarding ISPF table and Panel
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Thu Nov 12, 2009 9:49 pm    Post subject: Reply to: Query regarding ISPF table and Panel
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Nov 13, 2009 2:58 pm    Post subject:
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

Senior Member


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

PostPosted: Fri Nov 13, 2009 8:35 pm    Post subject: Reply to: Query regarding ISPF table and Panel
Reply with quote

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

Global Moderator


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

PostPosted: Sat Nov 14, 2009 7:55 pm    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 16, 2009 2:17 pm    Post subject:
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

Senior Member


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

PostPosted: Mon Nov 16, 2009 8:26 pm    Post subject: Reply to: Query regarding ISPF table and Panel
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    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
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Two Selects in a single select query Rohit Umarjikar DB2 1 Fri Nov 04, 2016 8:46 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm


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