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

Only Last Record getting displayed in panel


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

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Thu Apr 28, 2011 4:53 pm
Reply with quote

Hi,

I have created a REXX to open a PS dataset and display the records in a panel. I do not want the record to be the key for the table. My problem is am getting only the last record of file displayed multiple times on panel.

Heris is the part of REXX where I am creating table and adding records -
Code:

"ISPEXEC TBCREATE OUTDATA NAMES (&REC) NOWRITE"               
DO I = 1 TO RECD.0                                             
   REC = STRIP(RECD.I,'T')                                     
   "ISPEXEC TBADD OUTDATA"                                     
   "ISPEXEC TBBOTTOM OUTDATA"                                   
END                                                           
"ISPEXEC TBTOP OUTDATA"                                       
DO FOREVER                                                                                       
  "ISPEXEC TBDISPL OUTDATA PANEL(PANEL3)"                       
  LC = RC                                                       
  IF LC \= 0 THEN LEAVE                                           
END                                                           
"ISPEXEC TBEND OUTDATA"


And Here is is my panel
Code:
)Attr                                                                   
@ Type(Output) Intens(HIGH)                                             
)BODY EXPAND (\\)                                                       
---------------------------------------------------------------------- 
                      RELEASE SCHEDULE                                 
---------------------------------------------------------------------- 
%COMMAND ======> _CMD                                %SCROLL===_SAMT+   
+                                                                       
+                                                                       
%              RLS DATE      FROM DATE     TO DATE                     
%              ----------    ----------    ----------                   
)MODEL                                                                 
@REC                                                                   +
)INIT                                                                   
&PFKEY2 = ' '                                                           
&SAMT=CSR                                                               
)PROC                                                                   
 &PFKEY=.PFKEY                                                         
)END                                                                   


Can Anyone pleae suggest why only last record is getting displayed instead of all records of file. thanks for your help.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 28, 2011 5:03 pm
Reply with quote

if you are not going to run the clist thru trace,
you could at least check return-codes on all your service calls.
Back to top
View user's profile Send private message
anshul_gugnani

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Thu Apr 28, 2011 5:06 pm
Reply with quote

Hi,

I run the trace and found that all the records were being read from file and added in table but for TBDISPL it only displays the last record the no of times there are records in file.

Could you please suggest where am in going wrong.

Thanks.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Apr 28, 2011 5:16 pm
Reply with quote

  1. Why are you invoking the TBBOTTOM service?
  2. Why are you overlaying REC instead of parsing the record into the table variables?
  3. Shouldn't you be checking LC rather than L to determine whether to leave your DO FOREVER loop?
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Thu Apr 28, 2011 5:17 pm
Reply with quote

You should also learn to use ISPF Dialog Test.

BTW your LIBDEF and ADDPOP do not need to be inside your DO FOREVER loop.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 28, 2011 5:34 pm
Reply with quote

This makes the difference, changing '&REC' to just 'REC':

Code:

"ISPEXEC TBCREATE OUTDATA NAMES(REC) NOWRITE"    <<===           
DO I = 1 TO RECD.0                                             
   REC = STRIP(RECD.I,'T')                                     
   "ISPEXEC TBADD OUTDATA"                         
END                                                           
"ISPEXEC TBTOP OUTDATA"                                       
DO FOREVER                                                                                       
  "ISPEXEC TBDISPL OUTDATA PANEL(PANEL3)"                       
  LC = RC                                                       
  IF LC \= 0 THEN LEAVE                                           
END                                                           
"ISPEXEC TBEND OUTDATA"
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Thu Apr 28, 2011 7:51 pm
Reply with quote

superk wrote:
This makes the difference, changing '&REC' to just 'REC'

Hmmm. Perhaps the TS will deign to inform us whether she meant to create an ISPF table with one column named REC, or whether she meant to create a table with a variable number of columns whose names were held in the Rexx variable REC.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 28, 2011 9:02 pm
Reply with quote

I haven't quite figured out what the point is of creating an ISPF Table just to display records from a dataset, something that EDIT/BROWSE/VIEW does better and easier? The way the panel's designed, there's nothing that the user can do with them anyway.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 28, 2011 9:18 pm
Reply with quote

but it is a TOOL!.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Apr 28, 2011 9:35 pm
Reply with quote

superk,

I thought the same thing, until I had an occasion to use it.

I have a tso application written in REXX that displays a panel to take requests from the user.

The requests are written to a sequential file (which they have update to of course), which is processed by a batch job later in the day.

The application allows users to see what requests are pending. This process loads the data into a ispf table to be displayed.

This allows me to format the data which is strung together in the file for easy reading.

It also allows me to 'hide' the file name to deter the user from changing the data incorrectly. A resourceful user could of course figure out the file name if they so desired, but this is a rare user.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Fri Apr 29, 2011 1:51 am
Reply with quote

Quote:
The way the panel's designed, there's nothing that the user can do with them anyway.


I see it as a first draft. The next draft (or next project / class assignment / etc... ) will do something more powerful.
Back to top
View user's profile Send private message
Michael Jakob

New User


Joined: 13 Mar 2011
Posts: 17
Location: Switzerland

PostPosted: Fri May 06, 2011 8:08 am
Reply with quote

Have you tried to use the record number (I) as key?
"ISPEXEC TBCREATE OUTDATA KEYS(I) NAMES(REC) NOWRITE"
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 Copy only TEXT or String from a record SYNCSORT 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts Sort based on the record type DFSORT/ICETOOL 1
Search our Forums:

Back to Top