This is the error message I get while executing a VGET statement. The problem is it does not appear with my mainframe ID but it does appear for others when they are doing it and its a new REXX.
Code:
"VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD SQLVSAM) PR
OFILE"
+++ RC(8) +++
IRX0100I +++ Interactive trace. TRACE OFF to end debug, ENTER to continue. +++
45 *-* SAY errortext(RC)
>V> "8"
>F> "Unexpected THEN or ELSE"
Unexpected THEN or ELSE
Here is the panel -
Code:
+Command ===> _ZCMD %F1 for
+Receiving PDS for JCL .@SQLRECVP #
%Verify PROC Libraries:
+ First PROC Lib . . . .@SQLCPRC #
+ Second PROC Lib . . .@SQLCPRC2 #
+ (Please enter ZZZ.PROD.PRO in case no test PROC overrides are #
+ needed. Also used on non-SQ conversion jobs. Do not leave blank.) #
%Verify Default PDS Libraries:
+ Control Card (CTC) . .@SQLCTC #
+ Copy book (CPY). . . .@SQLCPY #
+ Load library (LOD) . .@SQLLOD #
+ (1.Please note these are test overrides only for SQ libraries, if #
+ test libraries need to be fed to be used in conversion jobs for #
+ Other systems the option would be provided in later screens.) #
+ (2.Please press F1 to get more insight into these libraries and data#
+ expected, let them be production as default values present on the #
+ screen in case no test libraries need to be used.Do not leave blank)#
%Enter VSAM File Names:
+ SQT VSAM NODE. .@SQLVSAM #
+ (in the format <NODE>.POLXXXX etc...Pls press F1 for more info) #
% ENTER to Continue, F3 to Restart/Make Changes
)INIT
.HELP = HFDSN
VGET(ERRFLD) SHARED
.CURSOR = &ERRFLD
)PROC
VER(&SQLCPRC,NONBLANK)
VER(&SQLCPRC2,NONBLANK)
VER(&SQLCTC,NONBLANK)
VER(&SQLCPY,NONBLANK)
VER(&SQLLOD,NONBLANK)
VER(&SQLVSAM,NONBLANK)
VER(&SQLVSAM,LEN,'<',18)
VPUT (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD,SQLVSAM) PROFILE
)END
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
I do not believe it is a VGET error, but a rexx error instead.
Code:
"Unexpected THEN or ELSE"
Show us everything from the last IF statement through to your VGET statement. My many years of debugging rexx leads me to suspect there is an "Unexpected THEN or ELSE"
| actually, the extraneous THEN/ELSE probably follows the VGET.
I am checking RC after every step in my INIT para and the first time I see RC 8 is on the VGET so I do not know how this VGET is coming into picture, does it scan the REXX as part of VGET. I am not a regular REXX programmer but picking it after some years.
Code:
SIGNAL ON HALT
SIGNAL ON SYNTAX
CALL init
CALL displayScreens
IF RC \= 8 THEN DO
bScreensDone = 1
CALL convertSkeleton
END
CALL cleanup
Code:
init:
UserID = SYSVAR(SYSUID)
bScreensDone = 0
bRedo = 0 /* Flag to let us know if we are starting over */
/* do not want to reset defaults for changed values */
ADDRESS ISPEXEC
ERRORSW = 'N'
"LIBDEF ISPPLIB DATASET ID('CKT.ALTxxxx.MODEL.PANELS.SQSETR1')"
"VGET (CYCUID,ACNTCDE,HOLD,CURRCYCL,PDSPRFX) PROFILE"
"VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD",
"SQLVSAM) PROFILE"
"VGET (TMDDATE2,PREVDAT2,CK4input,CURCYCK,TPAinput,CURCYTP",
"MGinput,CURCYCM,IPinput,CURCYCCI,ALinput,CURCYCA",
"VAinput,CURCYCV,ACinput,PLinput) PROFILE"
"VGET (DFLTPARM,DFLTLOD) PROFILE"
"VGET (ALCTC,ALLOD) PROFILE"
"VGET (PCCTC,PCLOD) PROFILE"
ADDRESS TSOXEC
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
Quote:
I am checking RC after every step in my INIT para
There is no sign of that in the code you posted. Is that the actual code or some sanitized version of it? You should not ask us to help solve your problem if you do not show us the version that fails.
Can you reorder your VGET statements so that the failing one is done first, and show us the entire trace through to the failure?
is it so difficult to look at the manual Yourself for the explanation
of the RC 8 after a VGET ???
or use the model command ???
try with
Code:
****** ***************************** Top of Data ******************************
000001 /* rexx */
000002 trace "o"
000003 signal on novalue name novalue
000004 Address ISPEXEC "VGET (N1 N2) "
000005 say RC
000006 say n1 n2
000007 Address ISPEXEC "VGET (N1 N2) SYMDEF SYMNAMES(SYSNAME SYSPLEX)"
000008 say RC
000009 say rxvars()
000010 say n1 n2
000011 exit
000012 novalue:
000013 say "*********************************"
000014 say "** **"
000015 say "** novalue trapped at line" || right(sigl,4) || " **"
000016 say "** **"
000017 say "*********************************"
000018 exit
****** **************************** Bottom of Data ****************************
1. TSOXEC was wrongly placed, have removed but it did not help.
2. I am checking RC after every step - by this I meant I started trace I a few statements before the VGET giving RC 8 and i could see RC 0 and then RC 8 started on the VGET in question.
This is how my paragraph looks like exactly coded
Code:
init:
trace ?i
UserID = SYSVAR(SYSUID)
bScreensDone = 0
bRedo = 0 /* Flag to let us know if we are starting over */
/* do not want to reset defaults for changed values */
ADDRESS ISPEXEC
ERRORSW = 'N'
"LIBDEF ISPPLIB DATASET ID('XKT.ALTXXXX.MODEL.PANELS.SETR1')"
"VGET (CYCUID,ACNTCDE,HOLD,CURRCYCL,PDSPRFX) PROFILE"
"VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD",
"SQLVSAM) PROFILE"
SAY errortext(RC)
"VGET (TMDDATE2,PREVDAT2,CK4input,CURCYCK,TPAinput,CURCYTP",
"MGinput,CURCYCM,IPinput,CURCYCCI,ALinput,CURCYCA",
"VAinput,CURCYCV,ACinput,PLinput) PROFILE"
"VGET (DFLTPARM,DFLTLOD) PROFILE"
"VGET (ALCTC,ALLOD) PROFILE"
And this is the trace I output
Code:
IRX0100I +++ Interactive trace. TRACE OFF to end debug, ENTER to continue. +++
36 *-* bScreensDone = 0
>L> "0"
37 *-* bRedo = 0 /* Flag to let us know if we are starting over */
>L> "0"
38 *-* /* do not want to reset defaults for changed values */
39 *-* ADDRESS ISPEXEC
I am not able to track which 'THEN ELSE' it is talking about that is what i am trying to know....and that is what is causing RC 8, and not sure why it is coming as part of VGET
Can you please tell me how can we start with an empty profile and delete all the profile variables?
IMO the TS forgot to issue a display panel .... (*)
LIBDEF for what I suppose the library containing the panels
followed by a VGET
most probably the TS posted only what he felt like and not what could be useful.
in one of the first post the ts showed a panel fragment with the VPUTs
again...
POST THE WHOLE SCRIPT, not just some fragments
since we are the ones helping You should trust our judgement about the info we need ...
so post what we ask, not what You feel like
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
Quote:
It is not the same thing!
The VGET gets a RC=8 and then the rexx ERROR error handling routine gets called.
1. The problem with "Unexpected THEN or ELSE" is that he is using the errortext() function for a host command error when it is meant for a rexx syntax error. The errortext() function should be used in a SYNTAX error handling routine, not for ERROR.
2. The ERROR routine should not be active for VGET calls as RC=8 should be frequent occurrence.
This demonstrates the problem:
Code:
/* rexx */
signal on error
Address ISPEXEC
trace('I')
"VGET (QQ99) PROFILE"
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
I suppose that for rexx syntax errors, there will only be one condition that results in RC=8.
But for host command errors, there are any number of them that will set a RC=8. The errortext() function has no way to determine the context of the return code; it was not intended to do so.
Rather than errortext(), I recommend that you use sourceline(), like this:
Code:
error:
SAY 'RC='rc 'at line' sigl ':' sourceline(sigl)
return
I used the sourceline(sigl) idea as suggested by Pedro and I could see this now, so the problem was using errortext() where it was not meant to be used.
Code:
>V> "46"
>L> "4"
>F> " 46"
>O> "** novalue trapped at line 46"
>L> " **"
>O> "** novalue trapped at line 46 **"
** novalue trapped at line 46 **
As for enrico, we have put all our VGETs in INIT paragraph and our display panels are in specific paragraphs. Does it have to be just before display panel without any RC 8 check? I got this design from a popular REXX in our system and that seems to be working fine for everybody.
If so I can put the VGET just before the 'corresponding' display panel statements and not check RC 8 of VGET but rather of the display panel itself?
somebody in Your organization should also consider that
for PANEL fields there is no need for the VGET,
the values are available by design of the ISPF REXX interface
Ok I removed the VGETs totally and it worked fine and also did give the correct results, thanks........
While reading the manual, I could not get what advantage we get from putting things in different pools, which is the purpose of VGET. Or its use more complicated than what we generally think of - getting variables from panel (which now to me does not look to be the use). If you can provide a practical example where its use is required.