REXX error code 40 running under MVS 2.2



IBM's Command List programming language & Restructured Extended Executor

REXX error code 40 running under MVS 2.2

Postby Steve Coalbran » Fri Feb 24, 2017 3:32 pm

We recently implemented MVS2.2 fully.
Certain REXX execs invoking the GET_JCL_DETAIL routine shown below started failing, job ending CC 3656.
This routine was previously totally stable.
The compiled REXX abends...
EAGREX4000E Error 40 running compiled SLAALARM, line 504: Incorrect call to routine
EAGREX4010I Result not a whole number
Here's the source REXX excerpt...
PARSE VALUE GET_JCL_DETAIL('FF'X),                          
      WITH  p1'FF'X p2'FF'X p3'FF'X p4'FF'X p5'FF'X p6'FF'X .
jobid   = STRIP(p1)                                          
jobname = STRIP(p2)                                          
jobttl  = STRIP(p3)                                          

...

/*===================================================================*/
/* GET JCL DETAILS                                                   */
/*===================================================================*/
GET_JCL_DETAIL: PROCEDURE                                              
                                                                       
psatold  = X2D('21C')                                                  
tcbjscb  = X2D('B4')                                                    
jscbssib = X2D('13C')                                                  
ssibsuse = X2D('20')                                                    
sjbsjb   = X2D('18')                                                    
sjbjct   = X2D('24')                                                    
tcbaddr  = CONTENTS(psatold)                                            
jscbaddr = CONTENTS(tcbaddr+tcbjscb)                                    
ssibaddr = CONTENTS(jscbaddr+jscbssib)                                  
sjbaddr  = CONTENTS(ssibaddr+ssibsuse)                                  
nextsjb  = CONTENTS(sjbaddr+sjbsjb)                                    
DO WHILE (nextsjb<>0)                                                  
  sjbaddr  = nextsjb                                                    
  nextsjb  = CONTENTS(sjbaddr+sjbsjb)                                  
END                                                                    
jctjname = X2D('6C')                    /* jobname                   */
jctjobid = X2D('120')                   /* job id number             */
jctpname = X2D('128')                   /* programmer name           */
jctnotus = X2D('1B0')                   /* notify userid             */
jctjusid = X2D('1BA')                   /* userid from job           */
jctacctn = X2D('150')                   /* account number            */
jctaddr  = CONTENTS(sjbaddr+sjbjct)                                    
                                                                       
RETURN getjct(jctjobid,8)'FF'X,                                        
    !! getjct(jctjname,8)'FF'X,                                        
    !! getjct(jctpname,20)'FF'X,                                      
    !! TRANSLATE(getjct(jctnotus,8),'40'X,'00'X)'FF'X,                
    !! getjct(jctjusid,8)'FF'X,                                        
    !! C2X(getjct(jctacctn,4))'FF'X                                    
/*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
                                                                       
/*===================================================================*/
/* return the JCT address                                            */
/*===================================================================*/
GETJCT: PROCEDURE EXPOSE jctaddr                                      
RETURN STORAGE(D2X(jctaddr+ARG(1)),ARG(2)) /*>>>>>>>>>>>>>>>>>>>>>>>>*/
                                                                       
/*===================================================================*/
/* return the data at an address                                     */
/*===================================================================*/
CONTENTS: PROCEDURE                                                    
ARG addr                                                              
RETURN C2D(STORAGE(D2X(addr),4)) /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

Re: REXX error code 40 running under MVS 2.2

Postby NicC » Fri Feb 24, 2017 3:58 pm

Hi Steve,

Which line is line 504? What does a trace show?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: REXX error code 40 running under MVS 2.2

Postby Steve Coalbran » Fri Feb 24, 2017 5:05 pm

Hi Nic,
How's life? :-D Where are you: Pompey/Bankok/.....?
Our Endevor REXX compiler has no TRACE allowed.
I added a NUMERIC DIGITS 10 (as advised) to this version but then I get...
  470 +++  jscbaddr = CONTENTS(tcbaddr+tcbjscb)                    
    35 +++ PARSE VALUE JOBDETAILS('FF'X),                            
F'X p5'FF'X p6'FF'X .                                                
IRX0041I Error running SLAALARM, line 470: Bad arithmetic conversion
WE had to get the fix in and the job runs every hour 24x7, and I couldn't be bothered to try various DIGITS values (although in retrospect 32 may have been worth a go?), so I commented out the lot and replaced with...
jobname = "PB92JST6"                    /* hardcoded                */
jobid   = "UNKNOWN"                     /* just-in-case             */
jobttl  = "BETASTAT"                    /* hardcoded                */                   
CALL OUTTRAP "O."                              
ADDRESS TSO "ST" jobname                      
CALL OUTTRAP "OFF"                            
DO i = 1 TO o.0                                
   PARSE VAR o.i . "JOB " . "(" jes ")" sta .  
   IF( sta="EXECUTING" )THEN                  
      PARSE VALUE o.0 jes WITH i jobid        
   ELSE NOP                                    
END                                            

OK boring but it works!!!
The same code I discovered is used several other places which I similarly hacked but perhaps there's a simpler solution.
We were advised control-block manipuklation was uncertain in the 70s & 80s so I should pick more stable solutions in future. No more shooting oneself in the foot using freeware solutions?
I suspect (or our software guys do) that the various CB addresses are now much higher and the CONTENTS routine no longer gets valid parameters(?).
There may be other occurences just waiting to happen.
These reports are all essentially Production Support Internal use only but annoying they abend?
Steve
User avatar
Steve Coalbran
 
Posts: 138
Joined: Wed Apr 06, 2011 11:49 am
Location: Stockholm, Sweden
Has thanked: 13 times
Been thanked: 1 time

Re: REXX error code 40 running under MVS 2.2

Postby BillyBoyo » Sat Feb 25, 2017 1:37 am

Which release of z/OS did you migrate from? The migration documentation should include a list of all the control-block mappings that have changed (Assembler macros) and I'm sure something that you are using will have changed. It is the problem with using non-Assembler to access control blocks. You have to look out for changes, and then update your mappings, everywhere they have been used.

I have head that there is an API-type access to some common Control Block information for Java. It would be useful if that could be utilised elsewhere, either directly to the "Java" or by a parallel non-Java API. Save some of the hassles.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post