Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rexx Regina Error handling difference

Status
Not open for further replies.

Altergo

Programmer
Jan 20, 2006
5
GB
I'm getting a difference between IBM and Regina which I can't control- can anyone help ?
When I get an Error in an external subroutine (let's take SYNTAX as an example)
With IBM Root module halts
With REGINA Root module continues
------------------------------------------------------------
Eg.
Root module contains
call t2
call t3 /* continues to execute this when error in T2 */
-----------------------------------------------------------
T2.cmd contains
x = left('abc',y) /* error here */
------------------------------------------------------------
T3.cmd contains
say hello t3
------------------------------------------------------------
Regina Execution produces
1 +++ x = left('abc',y)
1 +++ call t2
Error 40 running "C:\NPD\Prep\ph1\T2.cmd", line 1: Incorrect call to routine
Error 40.13: LEFT argument 2 must be zero or positive; found "Y"
[red] HELLO T3 [/red]
------------------------------------------------------------
IBM Rexx Execution produces
1 *-* x = left('abc',y)
1 *-* call t2
Error 40 running C:\NPD\Prep\ph1\T2.CMD line 1: Incorrect call to routine
Error 40.12: LEFT argument [red]3 [/red] must be a whole number; found "Y"
------------------------------------------------------------
Apart from the fact that IBM can't count up to 3.
I've played about with SIGNALs and CALLs but I can't seem to get the IBM effect which is what I want.
In reality there going to be many routines involved and a depth of call of about 5 or 6.

thanks for any replies
 
Do you have a 'signal on syntax' in the root? What does your SYNTAX code look like?


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Thanks Frank

I tried that
SIGNAL ON SYNTAX in the root makes no difference to the output both IBM and Regina

SIGNAL appears to have a scope of the containing code only. So to trap SYNTAX in T2 I need to code a SIGNAL statement in that routine. I have a lot of routines.

Yes, I thought, like you, that SIGNAL would be interited dynamically like, say, in PL/I
 
In addition to the "signal on syntax" specification (early in the code), there must also be a "SYNTAX:" label somewhere to which control can be transferred in case of a syntax error. For instance, I usually do
Code:
SYNTAX:   
   errormsg = exec_name "encountered REXX error" rc "in line" sigl":",
                        errortext(rc)
   say errormsg
   zsigl = sigl
   signal SHOW_SOURCE   
/* ------------------ */
SHOW_SOURCE:
   if sourceline() <> "0" then
      say sourceline(zsigl)
   rc =  trace("?R")
   nop
   exit
so you get a message "... REXX error ## at line ###", then it shows you that line, then it places you into trace-interactive-results and finally, gives you one last opportunity to manually intervent (nop) before forcing the routine to end. Now, an 'exit' from an external subroutine causes control to return to the caller. If you want the caller to halt as well, you must send back some information the caller can interrogate and interpret as an order-to-halt.



Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
By the way, your mainframe code must be doing something special in order to not run T3. Is it possible T2 and T3 are actually part of the main module on the mainframe?


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Frank thaks for your replies but I need more help from you

Corrections to my posts:-
1. Root module is called T and T2 , T3 are really external (honest)
2. I was talking about IBM OORexx under Windows versus Regina Rexx under Windows

Frank - I think you're probably wrong about MVS Rexx here. If I run this trio on the mainframe (code as in first post) T2 goes down and I get

2 +++ X = LEFT('ABC',Y)
Error running AA1, line 2: Incorrect call to routine
2 +++ CALL T2
Error running T, line 2: Incorrect call to routine
***
T3 is not called.

I think that that is right and Regina is wrong. The root process should stop (by default) when a subroutine is in error). I'm hoping you have found a way to force this if it's not the default as I have with Regina.

I really need to contact the Regina lads but their ListServer is down (since October)

many thanks

John Ennever
 
OK OK

the routines were called AA AA1 and AA2 in the mainframe version

- I edited the output above to T T2 and T3 - and I missed one

sorry - John
 
I'm as perplexed as you.

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
This thread has been continued on listserver
regina-l@lightlink.com
Where it looks like the agreement will be that it is a Regina Bug

thanks

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top