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

VGET error in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Sat Oct 27, 2012 3:24 am
Reply with quote

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
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Oct 27, 2012 3:49 am
Reply with quote

Code:
"VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD SQLVSAM) PR
 OFILE"
        +++ RC(8) +++

Code:
 VER(&SQLVSAM,LEN,'<',18)
 VPUT (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD,SQLVSAM) PROFILE
 )END
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Oct 27, 2012 4:53 am
Reply with quote

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.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Sat Oct 27, 2012 5:18 am
Reply with quote

Sorry it looks like I pasted the wrong VGET, here is how it is coded in my CLIST.

"VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD",
"SQLVSAM) PROFILE"

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
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Oct 27, 2012 1:05 pm
Reply with quote

You have some missing commas in the variable lists ...

Code:
   "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"


Code:
should be
   "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"



Quote:
here is how it is coded in my CLIST.


and learn to use the right terms... that' s REXX not CLIST icon_cool.gif
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Sat Oct 27, 2012 1:36 pm
Reply with quote

Does not help I tried this option - It gives me the same error message. Also please note that it does not give this error with some IDs.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Oct 29, 2012 7:47 pm
Reply with quote

Whats this :
Code:
ADDRESS TSOXEC
?

Quote:

Does not help I tried this option - It gives me the same error message. Also please note that it does not give this error with some IDs.


What option? Enrico's commas? Show the trace ouput, or it didnt happen.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Oct 29, 2012 10:37 pm
Reply with quote

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?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Oct 29, 2012 10:47 pm
Reply with quote

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 ****************************
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Oct 30, 2012 10:22 am
Reply with quote

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

    40 *-*  ERRORSW  = 'N'
       >L>    "N"

    41 *-*  "LIBDEF ISPPLIB DATASET ID('XKT.ALTXXX.MODEL.PANELS.SETR1')"
       >L>    "LIBDEF ISPPLIB DATASET ID('XKT.ALTXXX.MODEL.PANELS.SETR1')"

    42 *-*  "VGET (CYCUID,ACNTCDE,HOLD,CURRCYCL,PDSPRFX) PROFILE"
       >L>    "VGET (CYCUID,ACNTCDE,HOLD,CURRCYCL,PDSPRFX) PROFILE"

   43 *-*  "VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD",
           "SQLVSAM) PROFILE"

       >L>    "VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD"
       >L>    "SQLVSAM) PROFILE"
       >O>    "VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD SQLVSAM) PR
OFILE"
       +++ RC(8) +++
     45 *-*  SAY errortext(RC)
        >V>    "8"
        >F>    "Unexpected THEN or ELSE"
 Unexpected THEN or ELSE

Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Oct 30, 2012 10:30 am
Reply with quote

Code:

43 *-*  "VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD",
           "SQLVSAM) PROFILE"



There is a comma missing.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Oct 30, 2012 10:46 am
Reply with quote

Oh sorry i missed it but it does not make any difference



Code:
     44 *-*  "VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD,",
             "SQLVSAM) PROFILE"
        >L>    "VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD,"
        >L>    "SQLVSAM) PROFILE"
        >O>    "VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD, SQLVSAM) P
 ROFILE"
        +++ RC(8) +++

     46 *-*  SAY RC
        >V>    "8"
 8

     47 *-*  SAY errortext(RC)
        >V>    "8"
        >F>    "Unexpected THEN or ELSE"
 Unexpected THEN or ELSE
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Oct 30, 2012 12:25 pm
Reply with quote

Try the next statement on 1 line :

Code:

"VGET (SQLRECVP,SQLCPRC,SQLCPRC2,SQLCTC,SQLCPY,SQLLOD SQLVSAM) PROFILE"
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 30, 2012 12:33 pm
Reply with quote

what is that You do not understand

a RC 8 means that a variable that You are trying to VGET is not there

my previous suggestion was based on the wrong assumption that the separator had to be the same

I just tested an the space and the comma can be mixed

anyway ...
fix the RC 8
and fix the logic flow ... ( THEN ELSE ) stuff

it is not uncommon to obtain different results from the VGET for different users

the names found could be leftovers.

when testing it usually good habit to
1) start with an empty profile
2) DELETE from the profile all the variables
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Oct 30, 2012 12:53 pm
Reply with quote

i put in one line and it did not work.

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?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 30, 2012 1:18 pm
Reply with quote

look at the manuals for VERASE, VDELETE, VRESET

it would be nice if You posted the whole script
what You posted is pretty useless to provide help

to see what is going on

use the ispf option 7 Dialog test
and set a break BEFORE the VGET service
after that You can use suboption 3 to look at the variables
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 30, 2012 2:22 pm
Reply with quote

Quote:
This is how my paragraph looks like exactly coded

It is not a paragraph - it is a sub-routine/procedure. A paragraph is something that occurs in COBOL and printed material.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Oct 30, 2012 8:26 pm
Reply with quote

Worth noting:

RC 8 comes from your ISPF command (VGET),
ErrorText displays the REXX error.

It is not the same thing!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Oct 30, 2012 8:56 pm
Reply with quote

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
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Oct 30, 2012 9:26 pm
Reply with quote

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"   
                       
 return                 
                       
error:                 
SAY errortext(RC)       
return                 
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Oct 30, 2012 9:53 pm
Reply with quote

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
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Oct 30, 2012 11:40 pm
Reply with quote

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?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 31, 2012 12:04 am
Reply with quote

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
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Wed Oct 31, 2012 2:18 am
Reply with quote

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.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Oct 31, 2012 2:34 am
Reply with quote

a VPUT to the profile will keep the values across <logoff/logon>

apart that case and when required by <interfaced> appls and ISPF itself
I never had the need to use vget and vput
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 -> CLIST & REXX Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top