Pointer not set for location referenced - MCH3601

Any IBM i topic that does not fit in another forum
Post Reply
BAZangare
Posts: 6
Joined: Sun May 26, 2024 1:14 am

Pointer not set for location referenced - MCH3601

Post by BAZangare »

This started occurring a few weeks ago and I haven't been able to diagnose the problem. All of a sudden, calls to subprograms started getting MCH3601 errors. Thinking that maybe something went because of the parameters being passed, I removed the parameters from both the calling and called programs and still the error persists. The main program is written in COBOL and the called program is CL. One other test was to call the CL program from the command line and see what happens when it gets to the program being called with the CL. The call from the CL also returned a different MCH3601 as shown below. Also, this is my personal hosted IBM i account, not a company system. Has anyone seen this before?

COBOL to CL CALL, no parameters:
Pointer not set for location referenced.
Function check. MCH3601 unmonitored by @@MT002CB at statement 0000001577, instruction X'0000'.
Message 'MCH3601' in program object '@@MT002CB' in library 'AARDVARK' (C D F G).

Command line CALL to CL program, No parameters on CALL to CL or COBOL program:
CALL PGM(@@MT011CL)
Pointer not set for location referenced.
Function check. MCH3601 unmonitored by QLNRMAIN at statement 0000000008, instruction X'0000'.
Pointer not set for location referenced.
Exception recursion detected.
Application error. *N unmonitored by *N at statement *N, instruction X'4000'.
Pointer not set for location referenced.
Application error. MCH3601 unmonitored by QLNRMAIN at statement 0000000005, instruction X'0000'.
moti
Posts: 6
Joined: Tue Aug 17, 2021 12:37 pm

Re: Pointer not set for location referenced - MCH3601

Post by moti »

Hi,

In order to better understand the problem' we need to see the ENTIRE Joblog or at least more than you're showing.
There is supposed to be another message BEFORE the "Pointer not set for location referenced" message.
Usually it's about a file that doesn't exist in the *Libl.
Change (if it applies) the Logging parameter to (4 00 *SECLVL) and LOGCLPGM(*YES) and try again.
THEN, look at the Joblog - Perhaps you'll see something that will explain the error.

Have a nice day.
Moti.
BAZangare
Posts: 6
Joined: Sun May 26, 2024 1:14 am

Re: Pointer not set for location referenced - MCH3601

Post by BAZangare »

Here's more detail. I left out entries prior to the couple just before the pointer not set message. Again, the statement that is giving the error is a CALL to the program and doesn't have parameters.


3800 - CALL PGM(@@UT007CB) /* The CALL command contains
parameters */
- RETURN /* RETURN due to end of CL program */
Pointer not set for location referenced.
Function check. MCH3601 unmonitored by @@MT002CB at statement 0000001577,
instruction X'0000'.
Message 'MCH3601' in program object '@@MT002CB' in library 'AARDVARK' (C
D F G).
? C
Application error. *N unmonitored by *N at statement *N, instruction
X'4000'.
/* */
BAZangare
Posts: 6
Joined: Sun May 26, 2024 1:14 am

Re: Pointer not set for location referenced - MCH3601

Post by BAZangare »

I stripped the test down a little more to make sure nothing was getting in the way. I removed the parameters and linkage section from the program and called it from the command line. This program was working until a few weeks ago. It gets compiled the same now as it was before the problem.

CALL @@MT011CB
Application error. *N unmonitored by *N at statement *N, instruction
X'4000'.
Application error. MCH3601 unmonitored by QLNRMAIN at statement
0000000005, instruction X'0000'.
Scott Klement
Site Admin
Posts: 693
Joined: Sun Jul 04, 2021 5:12 am

Re: Pointer not set for location referenced - MCH3601

Post by Scott Klement »

how can i reproduce the problem?
BAZangare
Posts: 6
Joined: Sun May 26, 2024 1:14 am

Re: Pointer not set for location referenced - MCH3601

Post by BAZangare »

I don't think it would be reproducible on another system. Currently this program also gives me the MCH3601 error when calling from the command line. I removed the parms from the program and in the command line call. It is compiled as an ILE SQL COBOL program. Some other programs are giving me this issue also, which makes me think it might have something to do with either an activation group or something related to the library list. I mentioned the library list because something weird happens when I switch the order of my two libraries. When I use option 4 of a menu that I created, the program for option 5 runs. I checked the call stack for the job and both programs for options 4 and 5 show up. And I've checked to make sure there are no duplicate objects.

Up to a few weeks ago all of the programs ran flawlessly.
Scott Klement
Site Admin
Posts: 693
Joined: Sun Jul 04, 2021 5:12 am

Re: Pointer not set for location referenced - MCH3601

Post by Scott Klement »

MCH3601 is a pointer error. It is not related to activation groups or the library list. You sound like you're just taking guesses at random instead of trying to understand what's happening.

If you want help, we need to understand all of the details. We need to know what line of code is producing the error, and the code that brought us up to that point in the program. Unfortunately, as it stands, we have no information with which to help you.
BAZangare
Posts: 6
Joined: Sun May 26, 2024 1:14 am

Re: Pointer not set for location referenced - MCH3601

Post by BAZangare »

Hi Scott,

I included the code that is part of the CALL that's causing the error and left out the rest. What I'm showing passes parameters. Some of my tests where I removed the parameters also gave me the same MCH3601 error. I made the problem CALL statement bold and marked with an arrow to make it easier to find. I hope it helps give you more clarity of the problem.

Code: Select all

CL program @@MT002CL - START====================================================
   PGM                                                               
                                                                     
   DCL        VAR(&USER) TYPE(*CHAR) LEN(10)                         
                                                                     
   CHGJOB     LOG(4 00) LOGCLPGM(*YES)                               
                                                                     
   OVRDSPF    FILE(MT002DS) TOFILE(@@MT002DS) OVRSCOPE(*JOB)
   OVRDBF     FILE(USRTBL)  TOFILE(@@USRTBL) OVRSCOPE(*JOB) 
   OVRDBF     FILE(MNUHDR)  TOFILE(@@MNUHDR) OVRSCOPE(*JOB) 
   OVRDBF     FILE(USRTYP)  TOFILE(@@USRTYP) OVRSCOPE(*JOB) 
   OVRDBF     FILE(AARDUSR) TOFILE(@@AARDUSR) OVRSCOPE(*JOB)
   OVRDBF     FILE(USRDPT)  TOFILE(@@USRDPT) OVRSCOPE(*JOB) 
                                                                     
   RTVJOBA    USER(&USER)               
                                        
   CALL       PGM(@@MT002CB) PARM(&USER)
                                        
   ENDPGM                               
CL program @@MT002CL - END====================================================

Code: Select all

COBOL program @@MT002CB - START=================================================
.
.
.
 LINKAGE SECTION.                      
*----@@MT002CB call parameters-------  
 COPY MT002CPY              OF QCPYSRC 
     REPLACING                         
         ==(px)==            BY ==LS==.
 01 LS-MT002CB-PARAMETERS.                                        
     05 LS-MT002CB-USER-ID             PIC  X(10).                
.
.
.
*----@@MT011CB call parameters-------  
 COPY MT011CPY              OF QCPYSRC 
     REPLACING                         
         ==(px)==            BY ==WS==.                                                                  
 01 WS-MT011CB-PARAMETERS.                                      
     05 WS-MT011CB-SOURCE-SYSTEM       PIC  X.                  
     05 WS-MT011CB-MENU-ID             PIC S9(5).               
     05 WS-MT011CB-MENU-NAME           PIC  X(25).              
     05 WS-MT011CB-CALL-TYPE-FLAG      PIC  1.                  
         88 RESET-CALL-TYPE                          VALUE B"0".
         88 CALLED-FROM-MENU                         VALUE B"0".
         88 PROMPTED-BY-PREV-PGM                     VALUE B"1".
                                                                         
                                                                  
*=================================================================
 PROCEDURE DIVISION USING LS-MT002CB-PARAMETERS.                  
                                                                  
*------------------------------------                             
.
.
.
                   INITIALIZE WS-MT011CB-PARAMETERS   
                   SET PROMPTED-BY-PREV-PGM    TO TRUE
[b]                   CALL "@@MT011CL"                                                 <---------------------------------------------Statement that causes error.
                       USING WS-MT011CB-PARAMETERS [/b]
COBOL program @@MT002CB -END=================================================

Code: Select all

CL program @@MT011CL - START====================================================
   PGM        PARM(&PARMS)

   DCL        VAR(&PARMS) TYPE(*CHAR) LEN(32)
                                                                    
   OVRDSPF    FILE(MT011DS) TOFILE(@@MT011DS) +            
                OVRSCOPE(*JOB)                                      
   OVRDBF     FILE(MNUHDR)  TOFILE(@@MNUHDR) OVRSCOPE(*JOB)
                                                                    
   CALL       PGM(@@MT011CB) PARM(&PARMS)                           
                                                                    
   ENDPGM                                                           
CL program @@MT011CL - END====================================================

Code: Select all

COBOL program @@MT011CB - START=================================================
.
.
.

 LINKAGE SECTION.                      
*----@@MT011CB call parameters-------  
 COPY MT011CPY              OF QCPYSRC 
     REPLACING                         
         ==(px)==            BY ==LS==.
 01 LS-MT011CB-PARAMETERS.                                        
     05 LS-MT011CB-SOURCE-SYSTEM       PIC  X.                    
     05 LS-MT011CB-MENU-ID             PIC S9(5).                 
     05 LS-MT011CB-MENU-NAME           PIC  X(25).                
     05 LS-MT011CB-CALL-TYPE-FLAG      PIC  1.                    
         88 RESET-CALL-TYPE                          VALUE B"0".  
         88 CALLED-FROM-MENU                         VALUE B"0".  
         88 PROMPTED-BY-PREV-PGM                     VALUE B"1".  
                                                                  
                                                                  
*=================================================================
 PROCEDURE DIVISION USING LS-MT011CB-PARAMETERS.                  
*------------------------------------                                      
                       
COBOL program @@MT011CB - END=================================================
Scott Klement
Site Admin
Posts: 693
Joined: Sun Jul 04, 2021 5:12 am

Re: Pointer not set for location referenced - MCH3601

Post by Scott Klement »

It looks to me like you are defining WS-MT011CB-PARAMETERS (and the sub-fields within it) in the LINKAGE SECTION. This means that memory will not be reserved for it, so when you try to use it, you'll get a pointer error.

Trying moving this definition to your WORKING-STORAGE SECTION.
BAZangare
Posts: 6
Joined: Sun May 26, 2024 1:14 am

Re: Pointer not set for location referenced - MCH3601

Post by BAZangare »

Hi Scott,

It turns out that I had copied and pasted the code incorrectly. Below is the actual way it is in the programs. Sorry for the confusion.

Code: Select all

CL program @@MT002CL - START====================================================
   PGM                                                               
                                                                     
   DCL        VAR(&USER) TYPE(*CHAR) LEN(10)                         
                                                                     
   CHGJOB     LOG(4 00) LOGCLPGM(*YES)                               
                                                                     
   OVRDSPF    FILE(MT002DS) TOFILE(@@MT002DS) OVRSCOPE(*JOB)
   OVRDBF     FILE(USRTBL)  TOFILE(@@USRTBL) OVRSCOPE(*JOB) 
   OVRDBF     FILE(MNUHDR)  TOFILE(@@MNUHDR) OVRSCOPE(*JOB) 
   OVRDBF     FILE(USRTYP)  TOFILE(@@USRTYP) OVRSCOPE(*JOB) 
   OVRDBF     FILE(AARDUSR) TOFILE(@@AARDUSR) OVRSCOPE(*JOB)
   OVRDBF     FILE(USRDPT)  TOFILE(@@USRDPT) OVRSCOPE(*JOB) 
                                                                     
   RTVJOBA    USER(&USER)               
                                        
   CALL       PGM(@@MT002CB) PARM(&USER)
                                        
   ENDPGM                               
CL program @@MT002CL - END====================================================
   
COBOL program @@MT002CB - START=================================================
.
.
.
*----@@MT011CB call parameters-------  
 COPY MT011CPY              OF QCPYSRC 
     REPLACING                         
         ==(px)==            BY ==WS==.                                                                  
 01 WS-MT011CB-PARAMETERS.                                      
     05 WS-MT011CB-SOURCE-SYSTEM       PIC  X.                  
     05 WS-MT011CB-MENU-ID             PIC S9(5).               
     05 WS-MT011CB-MENU-NAME           PIC  X(25).              
     05 WS-MT011CB-CALL-TYPE-FLAG      PIC  1.                  
         88 RESET-CALL-TYPE                          VALUE B"0".
         88 CALLED-FROM-MENU                         VALUE B"0".
         88 PROMPTED-BY-PREV-PGM                     VALUE B"1".
                                                                         
 LINKAGE SECTION.                      
*----@@MT002CB call parameters-------  
 COPY MT002CPY              OF QCPYSRC 
     REPLACING                         
         ==(px)==            BY ==LS==.
 01 LS-MT002CB-PARAMETERS.                                        
     05 LS-MT002CB-USER-ID             PIC  X(10).                
.
.
.
*=================================================================
 PROCEDURE DIVISION USING LS-MT002CB-PARAMETERS.                  
                                                                  
*------------------------------------                             
.
.
.
                   INITIALIZE WS-MT011CB-PARAMETERS   
                   SET PROMPTED-BY-PREV-PGM    TO TRUE
                   CALL "@@MT011CL"                                                          <--------------------------------------------------------
                       USING WS-MT011CB-PARAMETERS    
COBOL program @@MT002CB -END=================================================

CL program @@MT011CL - START====================================================
   PGM        PARM(&PARMS)

   DCL        VAR(&PARMS) TYPE(*CHAR) LEN(32)
                                                                    
   OVRDSPF    FILE(MT011DS) TOFILE(@@MT011DS) +            
                OVRSCOPE(*JOB)                                      
   OVRDBF     FILE(MNUHDR)  TOFILE(@@MNUHDR) OVRSCOPE(*JOB)
                                                                    
   CALL       PGM(@@MT011CB) PARM(&PARMS)                           
                                                                    
   ENDPGM                                                           
CL program @@MT011CL - END====================================================

COBOL program @@MT011CB - START=================================================
.
.
.

 LINKAGE SECTION.                      
*----@@MT011CB call parameters-------  
 COPY MT011CPY              OF QCPYSRC 
     REPLACING                         
         ==(px)==            BY ==LS==.
 01 LS-MT011CB-PARAMETERS.                                        
     05 LS-MT011CB-SOURCE-SYSTEM       PIC  X.                    
     05 LS-MT011CB-MENU-ID             PIC S9(5).                 
     05 LS-MT011CB-MENU-NAME           PIC  X(25).                
     05 LS-MT011CB-CALL-TYPE-FLAG      PIC  1.                    
         88 RESET-CALL-TYPE                          VALUE B"0".  
         88 CALLED-FROM-MENU                         VALUE B"0".  
         88 PROMPTED-BY-PREV-PGM                     VALUE B"1".  
                                                                  
                                                                  
*=================================================================
 PROCEDURE DIVISION USING LS-MT011CB-PARAMETERS.                  
*------------------------------------                                      
                       
COBOL program @@MT011CB - END=================================================
Post Reply