View previous topic :: View next topic
|
Author |
Message |
kansassho
New User
Joined: 31 Mar 2008 Posts: 14 Location: kansas city
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
kansassho
New User
Joined: 31 Mar 2008 Posts: 14 Location: kansas city
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
kansassho
New User
Joined: 31 Mar 2008 Posts: 14 Location: kansas city
|
|
|
|
There are rows matching this value, but still this problem comes. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
I did not see TBOPEN or TBCREATE in your sample program. |
|
Back to top |
|
|
kansassho
New User
Joined: 31 Mar 2008 Posts: 14 Location: kansas city
|
|
|
|
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 |
|
|
kansassho
New User
Joined: 31 Mar 2008 Posts: 14 Location: kansas city
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
How was the table built? Perhaps you have trailing blanks in the JOBID variable. (though, I am not sure it matters) |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Good catch, Peter. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Well Pedro, thank you very much. |
|
Back to top |
|
|
kansassho
New User
Joined: 31 Mar 2008 Posts: 14 Location: kansas city
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Maybe using JOBID as primary key or only key in your TBCREATE statement will make a difference. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
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 |
|
|
|