View previous topic :: View next topic
|
Author |
Message |
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
anshul_gugnani
New User
Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
- Why are you invoking the TBBOTTOM service?
- Why are you overlaying REC instead of parsing the record into the table variables?
- Shouldn't you be checking LC rather than L to determine whether to leave your DO FOREVER loop?
|
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
but it is a TOOL!. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
Michael Jakob
New User
Joined: 13 Mar 2011 Posts: 17 Location: Switzerland
|
|
|
|
Have you tried to use the record number (I) as key?
"ISPEXEC TBCREATE OUTDATA KEYS(I) NAMES(REC) NOWRITE" |
|
Back to top |
|
|
|