|
Fkolmann, Thanks for your tip to convert this program to an ILE source member. Your suggestion sounds like an excellent long-term solution. I am happy to get your answer from Australia! This monster program is a JD Edwards Sales Order Entry program, and our custom mods have maxed it to the RPG limit. We have removed code from the program in the past to get it to compile. I have received responses from several people, and am including one for you and others to see. My thanks to all! Eric Lehti =================== Richard Jackson response ============= Here is what the RPG manual has to say about your problem: "It is unlikely that the system internal size limits for a program will be exceeded. However, if these limits are exceeded, the program must be rewritten, usually as multiple programs." The thing that you are probably overflowing is called the ODT - object definition template. It contains one entry for every named "thing" in the program. This includes MI or RPG statement labels (you get one or two for every DO loop and one to three for every IF block), database field names, data structure names and data structure field names, array names (but it doesn't count each element), generated data structures, generated exception descriptions, internal fields created for RPG CLEAR and RESET operations, literals and constants, variables defined in the C-specs, and at least half a dozen other things that don't come to mind at 10 PM while drinking a Guinness. All of those * 7031 unreferenced fields are already left out - this is a count of the things that you are actually using. The reason that the number is 32767 is: the size for the ODT field in OPM programs is 2 bytes long and the value is stored in hex. The decimal value for x'FFFF' is 65,535. But, you lose one bit for sign so the max number of ODT entries is 32K - 1. If you want the problem to go away, the MI code allows you to see the best opportunities but you can probably do everything that you need just by looking at the RPG code. [BEWARE: trying to look at a 20,000 page generated MI listing will give you irreparable brain damage] Comment out unused code or take a section of the program that uses a lot of fields, make it into a subprogram that returns with LR off, and call it when you need it. Some comments about this sentence: 1. Don't pick a section of code that will be called a lot. OPM calls still take hundreds to thousands of instructions and that is bad for performance. Don't pick a subroutine that will be called once or many times per SO line. However, something called once per SO or even once per enter key would be fine so long as it ends with LR off and doesn't do anything else stupi ... er, inefficient. And, you don't have 500 people doing heads-down SO entry. 2. A thing that uses a lot of fields might be S998. Unfortunately, the fields still have to be defined in P4211 so you don't get anything out of moving that. 3. Find subroutines in the program that you don't use. Blast in * in column 7 for all the lines then compile and test. You may be able to lose some file specs and data structure definitions if you are lucky. From the sound of it, you don't need to comment out very many declarations. 4. Moving things into copy books doesn't do anything. This error is created after the entire program has been read in and "compiled" (syntax and semantic checked). All the copy books are embedded in the source before "compiling" starts. The compiler has generated the program in MI form and has called the PRM - I'll bet that the message was sent to QPRPHxx01 (Dang it, I can't remember the PRM phase names! PRM stands for "program resolution monitor"). That is PRM phase 1 where it is reading in the MI program and creating the program template. I think that PRM phase 2 contains the CRTPG MI instruction - the one that actually creates the program. I think that the error happens when it tries to add something that it found in the MI program source to the ODT and fails. 5. It seems to me that constants and literals also generate ODTs and also OES entries. OES stands for "object extension specification" it is used to hold information that won't fit in the ODT. It is possible that you overflowed the OES but the PRM wasn't clever enough to recognize the difference so you got a message about the ODT. This seem highly unlikely to me and without seeing the IRP listing I don't know how to tell. (DO NOT EVEN THINK OF SENDING IT TO ME!) Comment out some code and try it again. With all that code, there just has to be a few thousand lines you can comment out :) Richard Jackson ====== End of Richard Jackson response =============== -----Original Message----- From: fkolmann@revlon.com.au [mailto:fkolmann@revlon.com.au] Sent: Wednesday, February 23, 2000 10:06 PM To: RPG400-L@midrange.com Subject: Re: RPG Compile error: --> CPD6311 message: 'Label on statement caused more than 32,767 objects ' Happens with AS/SET code , (big programs like ORD701B PUR550B2). One option is to do a CVTRPGSRC to an ILE source. Then compile. Otherwise you will need to remove bits of code you dont need cause you got too many fields. AS/SET has a habit of duplicating sub-routines if you access the same file with a different field NAME but same attributes. eg Order Header by ORDER and somewhere else by ORDNO. Use a work field to do the file I/O and move ORDER and/or ORDNO to the work field. "Lehti, Eric" wrote: > When my RPG compile is submitted with the GENOPT(*LIST) parameter, I get the > message: CPD6311: 'Label on statement caused more than 32,767 objects to > be defined' > > The compile joblog shows message CPF6301: Intermediate representation of > program (IRP ) contains 30 errors. Probable compiler error. > > My question to you is: > - What are these 32,767 objects? Are they: > - Field names in program? > - Array elements? > - Files and field names defined? > - All the afore-mentioned? > > This arbitrary limit in RPG gives us a headache every time we try to add a > few lines of code to this program. I will appreciate any suggestions you > can provide. > Thanks > Eric W. Lehti > Fike Corporation > Blue Springs, Missouri > mailto:Eric.Lehti@fike.com +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.