I am having a problem of the entries being shown on a panel from a ISPF
table sometimes showing multiple entries wrt actual entries in a file during the
first time of invoking the panel. I am reading from a file and displaying in a
panel using ISPF tables.
The problem is related to some memory clearing if i am correct.
I am reading from a file whose contents are as follows:
Whichever record is not having 'D' at the end should be displayed in the panel.
So as per that only record starting with SIA782 and HOR77 should be
displayed.
But when i display the panel, it is displaying
record starting with SIA782
record starting with HOR77
record starting with HOR782
Opt Build Name Build No
--- -------------- -------------
_ SIA782 UIOZIWER
_ HOR77 JO83989E
_ HOR782 DRUIJ0ES
The record with HOR782 should not appear in the panel.In the previous test i
had used HOR782 , may be that is why it is showing in the table. Is it possible
to clear all the rows in a table? How do we know the no. of rows in a table at
a particular time?
INSEQ = "'"||SKANNON.NR.TEST.BLDLST||"'"
SEL = ''
CALL,POP_TBL
SAY 'BEFORE TBTOP'
'ISPEXEC TBTOP MAXTB '
DO WHILE ENDRC <= 4
' ISPEXEC TBVCLEAR MAXTB'
CALL TBDISPL_BLDDTL
/*'ISPEXEC TBEND MAXTB ' */
SAY 'BEFORE ZTDSEL'
IF ZTDSEL=0 | RC>4 THEN
DO
ENDRC=RC
say 'NO BUILD SELECTED'
' ISPEXEC TBVCLEAR MAXTB'
'ISPEXEC TBEND MAXTB '
'ISPEXEC DISPLAY PANEL(SBLBDSP)'
SAY 'DISP PFKEY' PFKEY
IF PFKEY = 'PF03' THEN RETURN
END
ELSE IF T0 = 'S' THEN
DO
SEL = 'X'
CALL BLD_MEMLIST
IF ZTDSEL=0 | RC>4 THEN
DO
ENDRC=RC
'ISPEXEC TBEND MAXTB '
END
END
ELSE IF T0 = 'A' THEN
DO
SEL = 'X'
SAY 'BEFORE INSRT'
CALL INSRT_REC
ENDRC = 8
END
ELSE IF T0 = 'D' THEN
DO
*"ISPEXEC TBCREATE XTB1 NAMES(T0 T1 T2),NOWRITE, SHARE"
ROWCNT2=ZTDSELS
DO IX1=1 TO ROWCNT2
VTBA1.IX1.1=T0
VTBA1.IX1.2=T1
VTBA1.IX1.3=T2
'ISPEXEC CONTROL NONDISPL'
END
DO IX1=1 TO ROWCNT2
OPTTYPE=VTBA.IX1.1
BUINAM1 =VTBA.IX1.2
END */
SEL = 'X'
BUINAM1 = T1
SAY 'BUINAM1' BUINAM1
CALL DLT_REC
/* "ISPEXEC TBCREATE MAXTB NAMES(T0 T1 T2 T3) "|| ,
",NOWRITE, SHARE " */
ENDRC = 8
/*'ISPEXEC TBTOP MAXTB ' */
END
END
SAY 'VALUE OF SEL' SEL
IF SEL = 'X' THEN
DO
SAY 'BEFORE POP'
/*'ISPEXEC TBEND MAXTB ' */
CALL POP_TBL
SAY 'AFTER POP_TBL'
CALL TBDISPL_BLDDTL
'ISPEXEC DISPLAY PANEL(SBLBDSP)'
SAY 'SECON DISP' PFKEY
IF PFKEY = 'PF03' THEN RETURN
END
RETURN
TBDISPL_BLDDTL:
SAY 'WITHIN DISPL'
'ISPEXEC TBDISPL MAXTB PANEL(SBLBDSP)'
SAY 'AFTER TBDISPL'
RETURN
TBADD_BLDDTL:
SAY 'WITHIN BLDDTLADD :' T1
SAY 'WITHIN BLDDTLADD1:' T2
SAY 'WITHIN BLDDTLADD2:' T3
"ISPEXEC TBADD MAXTB"
RETURN
BLD_MEMLIST:
/*CALL THE REXX ROUTINE FOR COPYING THE SQLSCRIPT AND CHANGING TBLOWNER
THEN CALL THE ROUTINE FOR BRINGING UP THE SQL JOB'
*/
SAY 'WITHIN BLD_MEMLIST'
SAY 'T0:' T0
SAY 'T1:' T1
SAY 'T2:' T2
MYDSNHLQ = DSNHL
TBOWNER = TBOWN
SAY 'High level: ' MYDSNHLQ
SAY 'TB Owner : ' TBOWNER
IF MYDSNHLQ = '' | TBOWNER = '' THEN
DO
SAY 'DSNHLQ and TBOWNER cannot be empty'
RETURN
END
ISPEXEC VPUT (MYDSNHLQ)'
ISPEXEC VPUT (TBOWNER)'
IF ZTDSELS = 0 THEN
DO
SAY 'NO BUILD SELECTED'
'ISPEXEC DISPLAY PANEL(SBLBDSP)'
SAY 'THIRD DISP' PFKEY
IF PFKEY = 'PF03' THEN RETURN
END
IF ZTDSELS > 1 THEN
O
SAY 'ONLY ONE CAN BE SELECTED'
'ISPEXEC DISPLAY PANEL(SBLBDSP)'
SAY 'FOURTH DISP' PFKEY
IF PFKEY = 'PF03' THEN RETURN
END
/* "ISPEXEC TBEND XTB "
"ISPEXEC TBCREATE XTB NAMES(T0 T1 T2),NOWRITE, SHARE"
ROWCNT=ZTDSELS
DO IX=1 TO ROWCNT
VTBA.IX.1=T0
VTBA.IX.2=T1
VTBA.IX.3=T2
'ISPEXEC CONTROL NONDISPL'
'ISPEXEC TBDISPL MAXTB'
END
DO IX=1 TO ROWCNT
OPTTYPE=VTBA.IX.1
BUINAM =VTBA.IX.2
END */
BUINAM = T1
ADDRESS ISPEXEC
'ISPEXEC VPUT (BUINAM)'
CALL BDSQCOPY
CALL SBLJBBDS
RETURN
INSRT_REC:
NBLD = SUBSTR(T1,1,6)||SUBSTR(T2,1,8)
SAY 'NBLD' NBLD
"ALLOC FI(INSEQ) DA("||INSEQ||") MOD"
push NBLD
"EXECIO 1 DISKW INSEQ"
'EXECIO 0 DISKW INSEQ (FINIS '
'FREE FI(INSEQ)'
RETURN
DLT_REC:
SAY 'WITHIN DLT_REC'
"ALLOC FI(INSEQ) DA("||INSEQ||") OLD"
LCTR=0
EOF=0
DO WHILE EOF=0
say "LCTR " LCTR
LCTR = LCTR + 1
"EXECIO 1 DISKR INSEQ "
EOF=RC
LINE1 = ''
PULL LINE1
SAY 'BUINAM1 BEFORE CHECK' BUINAM1
SAY 'SUBSTR LINE1' SUBSTR(LINE1,1,6)
IF BUINAM1 = SUBSTR(LINE1,1,6) THEN
LEAVE
ELSE
ITERATE
END
SAY 'BEFORE LCTR ' LCTR
"EXECIO 1 DISKRU INSEQ " LCTR
PULL LINE
NBLD1 = SUBSTR(T1,1,6)||SUBSTR(T2,1,8)||'D'
PUSH NBLD1
"EXECIO 1 DISKW INSEQ (FINIS "
"FREE F(INSEQ)"
' ISPEXEC TBDELETE MAXTB'
RETURN
POP_TBL:
DROP X.
TRKLINE = ''
"ALLOC FI(INSEQ) DA("||INSEQ||") SHR REUS"
'EXECIO 1 DISKR INSEQ(STEM X. '
EOF=RC
' ISPEXEC TBVCLEAR MAXTB'
DO WHILE EOF=0
SAY 'WITHIN LOOP'
PARSE VAR X.1 TRKLINE
TRKLINE=STRIP(TRKLINE)
T0='_'
T1=SUBSTR(TRKLINE,1,6)
T2=SUBSTR(TRKLINE,7,8)
T3=SUBSTR(TRKLINE,15,1)
say 'ALL T1' T1
say 'ALL T2' T2
say 'ALL T3' T3
IF T3<>'D' THEN
DO
say 'T1' T1
say 'T2' T2
say 'T3' T3
CALL TBADD_BLDDTL
END
"EXECIO 1 DISKR INSEQ (STEM X."
EOF=RC
T0 = ''
T1 = ''
T2 = ''
END
'EXECIO 0 DISKW INSEQ (FINIS '
'FREE FI(INSEQ)'
RETURN
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
The main problem with your program is that you have no comments to explain what it is supposed to do.
You may also want to add some blank lines to separate some code segments from others.
Another problem is that your sample program is too long for a casual viewer to look at and understand. You should simplify your code to demonstrate the problem with minimum distraction.
It is not clear what you are trying to do, but it sounds like you want to occasionally end the table and recreate it. So you need TBCREATE and TBEND. It might be there, but the program is not structured so that we can tell if they are being done at the correct times.
- records not having 'D' at the end should be displayed in the panel.
So as per that only record starting with SIA782 and HOR77 should be
displayed.
But when i display the panel, it is displaying
record starting with SIA782
record starting with HOR77
record starting with HOR782
Opt Build Name Build No
--- -------------- -------------
_ SIA782 UIOZIWER
_ HOR77 JO83989E
_ HOR782 DRUIJ0ES
The record with HOR782 should not appear in the panel.In the previous test i had used HOR782 , may be that is why it is showing in the table. Is it possible to clear all the rows in a table? How do we know the no. of rows in a table at a particular time?
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
Quote:
It is not clear what you are trying to do, but it sounds like you want to occasionally end the table and recreate it. So you need TBCREATE and TBEND. It might be there, but the program is not structured so that we can tell if they are being done at the correct times.
Was I not clear? You need to issue pairs of TBCREATE an TBEND occasionally.
Look in the ISPF Services manual. All of the table related services begin with TB. There -is- one that will return to you the number of rows in the table.