1

I "borrowed" the LPINFOX REXX program from this url: [http://www.longpelaexpertise.com/toolsLPinfoX.php]

When I run it "directly" (EX 'hlq.EXEC(LPINFOX)') it runs fine:

 ------------------------------------------------------ 
  LPInfo: Information for z/OS ssssssss as of 18 Mar 2021    
 ------------------------------------------------------ 
 z/OS version: 02.04                                    
 Sysplex name: LOCAL                                    
 JES: JES2 z/OS 2.4 (Node nnnn)                           
 Security Software: RACF                                
                                                        
 CEC: 3907-Z02 (IBM Z z14 ZR1)                          
 CEC Serial: ssssss                                     
 CEC Capacity mmmm MSU                                   
 LPAR name: llll                                        
 LPAR Capacity mmm`enter code here` MSU                                  
 Not running under a z/VM image 

But, if I insert the call into another exec, I get a RC -2 from the address LINKPGM call:

------------------------------------------------------             
 LPInfo: Information for z/OS ssssssss as of 18 Mar 2021                
------------------------------------------------------             
z/OS version: 02.04                                                
Sysplex name: LOCAL                                                
JES: JES2 z/OS 2.4 (Node N1)                                       
Security Software: RACF                                            
                                                                   
    79 - Address Linkpgm 'IWMQVS QVS_Out'                        
       +++ RC(-2) +++                                              
CEC:     -                                                         
CEC Serial:                                                        
LPAR name:                                                         
Not running under a z/VM image

      

I'm sure this has to do with the second level of REXX program running, but what can I do about the error (besides queueing up the EXecution of the second REXX)? I'm also stumped on where this RC is documented...my Google search for "REXX ADDRESS RC -2" comes up short.

Thanks, Scott

PS(1), per answer from @phunsoft:

Interesting. I didn't copy the code to my other REXX. I invoked LPINFOX from within another rexx: I have a hlq.LOGIN.EXEC that has a "EX 'hlq.LPINFOX.EXEC" statement within it. When I reduce the first exec to "TEST1" (follows), it fails the same way:

/* REXX */                   
   "EXECUTIL TS"             
   "EX 'FAGEN.LPINFOX.EXEC'" 
   exit 0 

When I run TEST1, this is the output from the EXECUTIL from around the IWMQVS call:

EXECUTIL Output when running called from TEST1

When I run LPINFOX.EXEC directly from the command line, the output is the same, except the address LINKPGM IWMQVS works fine:

EXECUTIL Output when running from the command line

I can only surmise that there is some environmental difference when I run the exec "standalone" vs. when I run the exec from another exec.

PS(2), per question about replacing IWMQVS with IEFBR14 from phunsoft:

Changing the program to IEFBR14 doesn't change the result, RC=-2.

enter image description here

  • I can't see what difference there should be, but, there obviously is some. Not sure what a next step could be. Thinking... – phunsoft Mar 19 '21 at 17:21
  • What happens when you edit the *PLINFOX* REXX and change "IWMQVS" to "IEFBR14"? Does it still fail? – phunsoft Mar 19 '21 at 18:52
  • Yes, it still fails, same exact way. It doesn't seem to have anything to do with the program being called. See PS(2) above. – Scott Fagen Mar 19 '21 at 22:36
  • Well, *IEFBR14* was not optimal advice, since we still do not know whether the program is actuelly being called or not. RC = -2 means either a problem with variable handling before calling the program, or a problem with variable handling after returning from the program. But IEFBR14 does no manipulate the data area, so I would guess the problem is *before* calling the program. What does this help? Hmm, nothing, I'm afraid. Any chance your TSO session runs out of storage? – phunsoft Mar 20 '21 at 14:33
  • You could have a look at the system trace, and hopefully find a hint on what's going on. – phunsoft Mar 20 '21 at 16:39

1 Answers1

2

LINKPGM is a TSO/E REXX host command environment, so you need to search in the TSO/E REXX Reference. From that book:

Additionally, for the LINKMVS, ATTCHMVS, LINKPGM, and ATTCHPGM environments, the return code set in RC may be -2, which indicates that processing of the variables was not successful. Variable processing may have been unsuccessful because the host command environment could not:

o Perform variable substitution before linking to or attaching the program

o Update the variables after the program completed

Difficult to say what th problem is without seeing the code.

You may want to use REXX's trace feature to debug. Do you run this REXX from TSO/E foreground? If so, you might run TSO EXECUTIL TS just before you start that REXX. It will then run as if trace ?i wa specified as the fist line of the code.

I've had look at the LPINFOX EXEC and saw that variable QVS_Out is set as follows just before linking to IWMQVS:

QVS_Outlen = 500                       /* Output area length          */
QVS_Outlenx = Right(x2c(d2x(QVS_Outlen)),4,d2c(0))  
                                   /* Get length as fullword      */
QVS_Out = QVS_Outlenx || Copies('00'X,QVS_Outlen-4)

Did you do this also when you copied the call to your other REXX?

phunsoft
  • 2,674
  • 1
  • 11
  • 22