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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COBOL/400 MCH2804 error

Status
Not open for further replies.

Uvaiz

MIS
Jun 13, 2003
38
CA
Hi there!!!

When I compiled my COBOL/400 program the following error message was displayed on the AS400 terminal

50 03/10/20 14:08:56.191152 QLBEXHAN QLBL 00AC QCMD Q
Message . . . . : Message MCH2804 in COBOL compiler.
Cause . . . . . : Message MCH2804 was detected in COBOL compiler phase ENV
module QLBALLOC at instruction X'001F'. The message text for the exception
is:Tried to go larger than storage limit for object
QLB.TEMP.COBOL.WORK.SPACE.. Recovery . . . : Refer to the COBOL/400
User's Guide.

Would appreciate if someone with knowledge on COBOL/400 could help me resolve this problem.

Thanks.
Tony
 
I think it may be user memory/resources limitation. The user may be restricted on the size of resources he/she can allocate.

But I don't have access to a AS400 at the moment, so I can't look at it.

How big is the program?
did it ever compile? or is just giving the error after a few changes you've made?
Does it create a partial listing? If so where does it stop?






Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Frederico Fonseca
SysSoft Integrated Ltd.

Hi Frederico,

Thanks for your input. In reply to your question -

1. No the program did not compile

2. This started at the Procedure Division

* ======================================================= *
PROCEDURE DIISION.
PRINT-CUST-HISTORY.
*
OPEN INPUT CUSTOMER-FILE CUST-HIST-FILE
OUTPUT CUSTOMER-REPORT.
WRITE CUSTOMER-REPORT-REC FROM HEADER-LINE
AFTER ADVANCING PAGE-TOP
* ======== PROGRAM LOGIC ================================ *

The following is the start of the messages.



83 007700 05 FILLER PIC X(07) VALUE "OTHER $". 89/11/30
84 007800 05 FILLER PIC X(34) VALUE SPACES. 89/11/30
007900* 89/11/09
85 008000 01 WORK-FIELDS. 89/11/14
86 008100 05 END-OF-CUST-FILE-SW PIC X VALUE "N". 89/11/17
87 008200 88 END-OF-CUST-FILE VALUE "Y". 89/11/17
88 008300 05 TARGET-YEAR PIC 99 VALUE 90. 91/05/02
008400* 89/11/21
008500 03/10/20
5722WDS V5R1M0 010525 AS/400 COBOL SOURCE XXXXX/XXXX08L DEV01 03/10/20 14:49:03
STMT SEQNBR -A 1 B..+....2....+....3....+....4....+....5....+....6....+....7..IDENTFCN S COPYNAME CHG DATE
* EXCEPTION MCH2804 OCCURRED IN QLBALLOC AT MI INSTRUCTION 31 IN COMPILER PHASE ENV.
* MCH2804 TRIED TO GO LARGER THAN STORAGE LIMIT FOR OBJECT QLB.TEMP.COBOL.WORK.SPACE.
* CURRENT CARD==> PROCEDURE DIVISION.
* XSEMCODE= 20 XSEMPARM= 1
* TOKEN SLOT==> XTOKCODE= 101 XTOKLEN= 6
*** NO SYMBOL TABLE PRESENT ***
DUMP TERMINATED - OBJECT DEFINITION TABLE NOT MATERIALIZABLE
TGET ON ZERO LENGTH ITEXT RECORD, XTXTGPTR=80000000

Thanks for your response.

Tony
 
Apart from speaking with IBM I can only suggest the following (assuming that you can compile a smaller program).

1- First and just to confirm create a very small program (just with the mandatory sections, and just a hardcoded display on the Procedure.

2- Start changing the program you have at the moment.
a- Strip all Procedure division and try compiling
b- If still fails start stripping parts of the WS until you get a compile.

At this stage use compile options *map, *list, *source as I would like you to tell me the size of WS at this stage, along with number of variables.

And did you try and recompile this pgm with a user with *allobj, *IO... (don't remember the remaining), and *secadm?
If not please do just to see if it makes any difference.

I would also see if there are any PTF's that can be applied to your machine.



Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Hi Frederico,

You have indeed been very helpful. As suggested did changes with subroutines and was compiled successfully but not the source under review as listed below.

1. The source that was changed and compiled.

PROCEDURE DIVISION.
MAIN-CONTROL.

PERFORM 1000-INIT THRU 1000-EXIT.
PERFORM 8000-READ-AND-PROCESS THRU 8000-EXIT.
PERFORM UNTIL END-OF-CUST-FILE
PERFORM 3000-ACCUM-TOTALS THRU 3000-EXIT
PERFORM 8500-WRITE-REPORT THRU 8500-EXIT
PERFORM 8000-READ-AND-PROCESS THRU 8000-EXIT
END-PERFORM.
PERFORM 9000-END-PROGRAM THRU 9000-EXIT.
STOP RUN.


2. This is the nested loop that does not compile as discussed previously.

* ======================================================= *
PROCEDURE DIVISION.
PRINT-CUST-HISTORY.
*
OPEN INPUT CUSTOMER-FILE CUST-HIST-FILE
OUTPUT CUSTOMER-REPORT.
WRITE CUSTOMER-REPORT-REC FROM HEADER-LINE
AFTER ADVANCING PAGE-TOP
* ======== PROGRAM LOGIC ================================ *
PERFORM UNTIL END-OF-CUST-FILE
READ CUSTOMER-FILE
AT END SET END-OF-CUST-FILE TO TRUE
NOT AT END
MOVE CUSTNO OF CSTFMT TO CUSTNO OF HSTFMT
MOVE TARGET-YEAR TO HISTYR OF HSTFMT
MOVE 1 TO HISTMO OF HSTFMT
START CUST-HIST-FILE
KEY IS >= EXTERNALLY-DESCRIBED-KEY
INVALID KEY CONTINUE
NOT INVALID KEY
READ CUST-HIST-FILE NEXT
AT END MOVE HIGH-VALUES TO CUSTNO OF HSTFMT
END-READ
PERFORM WITH TEST BEFORE
UNTIL CUSTNO OF HSTFMT > CUSTNO OF CSTFMT
OR HISTYR OF HSTFMT > TARGET-YEAR
MOVE CORRESPONDING CSTFMT TO REPORT-LINE
MOVE CORRESPONDING HSTFMT TO REPORT-LINE
WRITE CUSTOMER-REPORT-REC FROM REPORT-LINE
AFTER ADVANCING 2 LINES
AT END-OF-PAGE
WRITE CUSTOMER-REPORT-REC FROM HEADER-LINE
AFTER ADVANCING 2 LINES
END-WRITE
END-WRITE
READ CUST-HIST-FILE NEXT
AT END MOVE HIGH-VALUES TO CUSTNO OF HSTFMT
END-READ
END-PERFORM
END-START
END-READ
END-PERFORM
Thanks
Tony
 
Arrghh!!.

Please please clean up that code.


Regarding the compile problem remove the two "move corresponding ..." lines and try it again.
If this change does not work then try an remove line by line of the offending code until you find the "bugger".


And the following is how I would code that. Try it just to see if it compiles...
now this isn't even how I would really code it but I did follow your style.

Code:
   PERFORM UNTIL END-OF-CUST-FILE                               
       READ CUSTOMER-FILE                                         
         AT END SET END-OF-CUST-FILE          TO TRUE             
        NOT AT END                                               
            MOVE CUSTNO OF CSTFMT              TO CUSTNO OF HSTFMT
            MOVE TARGET-YEAR                   TO HISTYR OF HSTFMT
            MOVE 1                             TO HISTMO OF HSTFMT
            perform process-cust-hist-file
       END-READ                                                  
   END-PERFORM.

 process-cust-hist-file.
   START CUST-HIST-FILE                                  
     KEY IS >= EXTERNALLY-DESCRIBED-KEY                  
     INVALID KEY CONTINUE                                
     NOT INVALID KEY
         perform process-cust-hist-file-p2                                     
   END-START.

 process-cust-hist-file-p2.
    READ CUST-HIST-FILE NEXT                          
      AT END  MOVE HIGH-VALUES     TO CUSTNO OF HSTFMT
    END-READ                                          
    PERFORM WITH TEST BEFORE                          
      UNTIL CUSTNO OF HSTFMT  >  CUSTNO OF CSTFMT  
      OR    HISTYR OF HSTFMT  >  TARGET-YEAR      
            MOVE CORRESPONDING CSTFMT    TO REPORT-LINE    
            MOVE CORRESPONDING HSTFMT    TO REPORT-LINE    
            WRITE CUSTOMER-REPORT-REC  FROM REPORT-LINE    
                AFTER 2 LINES                      
                AT END-OF-PAGE                               
                  WRITE CUSTOMER-REPORT-REC FROM HEADER-LINE
                        AFTER 2 LINES                  
                 END-WRITE                                  
            END-WRITE                                      
           READ CUST-HIST-FILE NEXT                        
             AT END MOVE HIGH-VALUES    TO CUSTNO OF HSTFMT
           END-READ                                        
   END-PERFORM


Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thank you everyone. This problem has been resolved by IBM with the installation of their latest PTF.

Appreciate for all your efforts.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top