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!

compiler exceeded 32k

Status
Not open for further replies.

Ray40

Programmer
Oct 22, 2001
4
US
We have old (before 1980) programs that use very large record layout in the working storage section. The layout consists of regular fields and multiple tables. When we increase the table size, the program would not compile and error of "32k limit is exceed". Our solution so far is to create two exact record layout with less "occurs" on the tables which prevent from exceding the 32k length of the record. Is there any simpler solution? Programs are running on OS390 using the LE version complier and optimizer.
 
Ray,

An easy and fast way to rummage with your records is to use Easytreave plus. It might offer a solution.

M. BigMag, The Netherlands.
someone@euronet.nl (no kidding!)
 
Thanks for the suggestion. But using Easytrive or DYL280 would mean that we have to rewrite many of these programs. That would not be an easy task since these programs are very long and not structured. They use "fall-through logic", sections and gotos. Not an easy task.
 
Could some of the fields be redefined?

For instance, let's say you have a record like this:

01 LOTS-OF-RECORDS OCCURS 100000000 TIMES.
05 FIELD-1 PIC X(2000).
05 FIELD-2 PIC X(3000).
05 FIELD-3 PIC X(4000).

Could you change this to the following?

01 LOTS-OF-RECORDS OCCURS 1000 TIMES.
05 FIELD-1 PIC X(2000).
05 FIELD-2 PIC X(3000).
05 FIELD-3 PIC X(4000).
01 EVEN-MORE-RECORDS REDEFINES LOTS-OF-RECORDS.
05 SECOND-GROUP-OF-RECORDS OCCURS 1000 TIMES.
10 SECOND-FIELD-1 PIC X(2000).
10 SECOND-FIELD-2 PIC X(3000).
10 SECOND-FIELD-3 PIC X(4000).
01 AND-YET-MORE-RECORDS REDEFINES EVEN-MORE-RECORDS.
05 THIRD-GROUP-OF-RECORDS OCCURS 1000 TIMES.
10 THIRD-FIELD-1 PIC X(2000).
10 THIRD-FIELD-2 PIC X(3000).
10 THIRD-FIELD-3 PIC X(4000).

And so forth, until you get all the records and fields you want.

If your record layout has fields of all sorts of different lengths, you still might be able to do some sort of 'redefines' design.

I'm not sure if this is what you want, but hope it helps.

Nina Too


 
Ray40,

stuffing a table with multiple occurences in one record means only one thing: bad data modelling. The solution you described sounds like the most pragmatic one, albeit quick and dirty, but a definitive solution can only be redesigning and remodelling it.

Regards,
Ronald.
 
Hi,

Here are some IBM compiler limits. Perhaps this gives you a clue.

Regards,

Crox

Code:
³---------------------------------------------------------------------------³
³ Table 55. Compiler Limits                                                 ³
³---------------------------------------------³-----------------------------³
³ Language Element                            ³ Compiler Limit              ³
³---------------------------------------------³-----------------------------³
³ Size of program                             ³ 999,999 lines               ³
³---------------------------------------------³-----------------------------³
³ Size of file record size (AIX, OS/2, and    ³ 64K                         ³
³ Windows)                                    ³                             ³
³---------------------------------------------³-----------------------------³
³ Number of literals                          ³ 4,194,303(1)                ³
³---------------------------------------------³-----------------------------³
³ Total length of literals                    ³ 4,194,303 bytes(1)          ³
³---------------------------------------------³-----------------------------³
³ Reserved Word Table entries                 ³ 1536                        ³
³---------------------------------------------³-----------------------------³
³ COPY REPLACING ... BY ... (items per COPY   ³ No limit                    ³
³ statement)                                  ³                             ³
³---------------------------------------------³-----------------------------³
³ Number of COPY libraries                    ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ Block size of COPY library                  ³ 32,767 bytes                ³
³---------------------------------------------³-----------------------------³
³ Identification Division                     ³                             ³
³---------------------------------------------³-----------------------------³
³ Environment Division                        ³                             ³
³---------------------------------------------³-----------------------------³
³ Configuration Section                       ³                             ³
³---------------------------------------------³-----------------------------³
³ SPECIAL-NAMES paragraph                     ³                             ³
³---------------------------------------------³-----------------------------³
³ function-name IS                            ³ 18                          ³
³---------------------------------------------³-----------------------------³
³ UPSI-n ... (switches)                       ³ 0-7                         ³
³---------------------------------------------³-----------------------------³
³ alphabet-name IS ...                        ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ literal THRU/ALSO ...                       ³ 256                         ³
³---------------------------------------------³-----------------------------³
³ Input-Output Section                        ³                             ³
³---------------------------------------------³-----------------------------³
³ FILE-CONTROL paragraph                      ³                             ³
³---------------------------------------------³-----------------------------³
³ SELECT file-name ...                        ³ 65,535                      ³
³---------------------------------------------³-----------------------------³
³ ASSIGN system-name ...                      ³ No limit(2)                 ³
³---------------------------------------------³-----------------------------³
³ ALTERNATE RECORD KEY data-name ...          ³ 253                         ³
³---------------------------------------------³-----------------------------³
³ RECORD KEY length                           ³ No limit(3)                 ³
³---------------------------------------------³-----------------------------³
³ RESERVE integer (buffers)                   ³ 255(4)                      ³
³---------------------------------------------³-----------------------------³
³ I-O-CONTROL paragraph                       ³                             ³
³---------------------------------------------³-----------------------------³
³ RERUN ON system-name ...                    ³ 32,767                      ³
³---------------------------------------------³-----------------------------³
³     integer RECORDS                         ³ 16,777,215                  ³
³---------------------------------------------³-----------------------------³
³ SAME RECORD AREA                            ³ 255                         ³
³---------------------------------------------³-----------------------------³
³     FOR file-name ...                       ³ 255                         ³
³---------------------------------------------³-----------------------------³
³ SAME SORT/MERGE AREA                        ³ No limit(2)                 ³
³---------------------------------------------³-----------------------------³
³ MULTIPLE FILE ... file-name                 ³ No limit(2)                 ³
³---------------------------------------------³-----------------------------³
³ Data Division                               ³                             ³
³---------------------------------------------³-----------------------------³
³ File Section                                ³                             ³
³---------------------------------------------³-----------------------------³
³ FD file-name ...                            ³ 65,535                      ³
³---------------------------------------------³-----------------------------³
³     LABEL data-name ... (if no optional     ³ 255                         ³
³ clauses)                                    ³                             ³
³---------------------------------------------³-----------------------------³
³     Label record length                     ³ 80 bytes                    ³
³---------------------------------------------³-----------------------------³
³     DATA RECORD dnm ...                     ³ No limit(2)                 ³
³---------------------------------------------³-----------------------------³
³     BLOCK CONTAINS integer                  ³ 1,048,575(5)                ³
³---------------------------------------------³-----------------------------³
³     RECORD CONTAINS integer                 ³ 1,048,575(5)                ³
³---------------------------------------------³-----------------------------³
³     Item length                             ³ 1,048,575 bytes(5)          ³
³---------------------------------------------³-----------------------------³
³     LINAGE clause values                    ³ 2**32 (4-byte binary        ³
³                                             ³ numbers)                    ³
³---------------------------------------------³-----------------------------³
³ SD file-name ...                            ³ 65,535                      ³
³---------------------------------------------³-----------------------------³
³     DATA RECORD dnm ...                     ³ No limit(2)                 ³
³---------------------------------------------³-----------------------------³
³     Sort record length                      ³ 32,751 bytes                ³
³---------------------------------------------³-----------------------------³
³ Working-Storage Section                                                   ³
³---------------------------------------------³-----------------------------³
³ Items without the EXTERNAL attribute        ³ 134,217,727 bytes           ³
³---------------------------------------------³-----------------------------³
³ Items with the EXTERNAL attribute           ³ 134,217,727 bytes           ³
³---------------------------------------------³-----------------------------³
³ 77 data-names                               ³ 16,777,215 bytes            ³
³---------------------------------------------³-----------------------------³
³ 01-49 data-names                            ³ 16,777,215 bytes            ³
³---------------------------------------------³-----------------------------³
³ 88 condition-name ...                       ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ VALUE literal ...                           ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ 66 RENAMES ...                              ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ PICTURE character-string                    ³ 30                          ³
³---------------------------------------------³-----------------------------³
³     Numeric item digit positions            ³ 18                          ³
³---------------------------------------------³-----------------------------³
³     Numeric-edited character positions      ³ 249                         ³
³---------------------------------------------³-----------------------------³
³ PICTURE replication (   )                   ³ 16,777,215                  ³
³---------------------------------------------³-----------------------------³
³ PIC repl (editing)                          ³ 32,767                      ³
³---------------------------------------------³-----------------------------³
³ DBCS Picture replication (   )              ³ 8,388,607                   ³
³---------------------------------------------³-----------------------------³
³ Group item size: File Section               ³ 1,048,575 bytes             ³
³---------------------------------------------³-----------------------------³
³ Elementary item size                        ³ 16,777,215 bytes            ³
³---------------------------------------------³-----------------------------³
³ VALUE initialization (Total length of all   ³ 16,777,215 bytes            ³
³ value literals)                             ³                             ³
³---------------------------------------------³-----------------------------³
³ OCCURS integer                              ³ 16,777,215                  ³
³---------------------------------------------³-----------------------------³
³     Total number of ODOs                    ³ 4,194,303(1)                ³
³---------------------------------------------³-----------------------------³
³     Table size                              ³ 16,777,215 bytes            ³
³---------------------------------------------³-----------------------------³
³     Table element size                      ³ 8,388,607 bytes             ³
³---------------------------------------------³-----------------------------³
³     ASC/DES KEY ... (per OCCURS clause)     ³ 12 KEYS                     ³
³---------------------------------------------³-----------------------------³
³     Total length                            ³ 256 bytes                   ³
³---------------------------------------------³-----------------------------³
³     INDEXED BY ... (index names) (per       ³ 12                          ³
³ OCCURS clause)                              ³                             ³
³---------------------------------------------³-----------------------------³
³     Total num of indexes (index names)      ³ 65,535                      ³
³---------------------------------------------³-----------------------------³
³     Size of relative index                  ³ 32,765                      ³
³---------------------------------------------³-----------------------------³
³ Linkage Section                             ³ 134,217,727 bytes           ³
³---------------------------------------------³-----------------------------³
³ Total 01 + 77 (data items)                  ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ Procedure Division                          ³                             ³
³---------------------------------------------³-----------------------------³
³ Procedure + constant area                   ³ 4,194,303 bytes(1)          ³
³---------------------------------------------³-----------------------------³
³     USING identifier ...                    ³ 32,767                      ³
³---------------------------------------------³-----------------------------³
³ Procedure-names                             ³ 1,048,575(1)                ³
³---------------------------------------------³-----------------------------³
³     Subscripted data-names per verb         ³ 32,767                      ³
³---------------------------------------------³-----------------------------³
³     Verbs per line (TEST)                   ³ 7                           ³
³---------------------------------------------³-----------------------------³
³ ADD identifier ...                          ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ ALTER pn1 TO pn2 ...                        ³ 4,194,303(1)                ³
³---------------------------------------------³-----------------------------³
³ CALL ... BY CONTENT id                      ³ 2,147,483,647 bytes         ³
³---------------------------------------------³-----------------------------³
³ CALL id/lit USING id/lit...                 ³ 16380 (OS/390 and VM) 500   ³
³                                             ³ (AIX, OS/2, and Windows)    ³
³---------------------------------------------³-----------------------------³
³ CALL literal ...                            ³ 4,194,303(1)                ³
³---------------------------------------------³-----------------------------³
³     Active programs in run unit             ³ 32,767                      ³
³---------------------------------------------³-----------------------------³
³     Number of names called (DYN)            ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ CANCEL id/lit ...                           ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ CLOSE file-name ...                         ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ COMPUTE identifier ...                      ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ DISPLAY id/lit ...                          ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ DIVIDE identifier ...                       ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ ENTRY USING id/lit ...                      ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ EVALUATE ... subjects                       ³ 64                          ³
³---------------------------------------------³-----------------------------³
³ EVALUATE ... WHEN clauses                   ³ 256                         ³
³---------------------------------------------³-----------------------------³
³ GO pn ... DEPENDING                         ³ 255                         ³
³---------------------------------------------³-----------------------------³
³ INSPECT TALLY/REPL clauses                  ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ MERGE file-name ASC/DES KEY ...             ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³     Total key length                        ³ 4,092 bytes(6)              ³
³---------------------------------------------³-----------------------------³
³     USING file-name ...                     ³ 16(7)                       ³
³---------------------------------------------³-----------------------------³
³ MOVE id/lit TO id ...                       ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ MULTIPLY identifier ...                     ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ OPEN file-name                              ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ PERFORM                                     ³ 4,194,303                   ³
³---------------------------------------------³-----------------------------³
³ SEARCH ... WHEN ...                         ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ SET index/id ... TO                         ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ SET index ... UP/DOWN                       ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ SORT file-name  ASC/DES KEY                 ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³     Total key length                        ³ 4,092 bytes(6)              ³
³---------------------------------------------³-----------------------------³
³     USING file-name ...                     ³ 16(7)                       ³
³---------------------------------------------³-----------------------------³
³ STRING identifier ...                       ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³     DELIMITED id/lit ...                    ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ UNSTRING DELIMITED id/lit OR id/lit ...     ³ 255                         ³
³---------------------------------------------³-----------------------------³
³ UNSTRING INTO id/lit ...                    ³ No limit                    ³
³---------------------------------------------³-----------------------------³
³ USE ... ON file-name ...                    ³ No limit                    ³
³---------------------------------------------³-----------------------------³
                                                                             
Table Notes (OS/390 and VM Only):                                            
                                                                             
(1) Items included in 4,194,303 byte limit for procedure plus constant       
   area.                                                                     
(2) Treated as comment; there is no limit.                                   
(3) No compiler limit, but VSAM limits it to 255 bytes.                      
(4)  QSAM                                                                    
(5) Compiler limit shown, but QSAM limits it to 32,767 bytes.                
(6)  For QSAM and VSAM, the limit is 4088 bytes if EQUALS is coded on the    
   OPTION control statement.                                                 
(7)  SORT limit for QSAM and VSAM.


 
Hi,

a trick:

If you let the compiler not test for subscriptrange, you can just walk out of your table....

But know what you do!

In the 'old OSVS days' we dit those things. I thought that it was not necessairy anymore nowadays..... ???? :)

Regards,

Crox
 
Crox,

I'm suprised.
Is that really you??

M.
BigMag, The Netherlands.
someone@euronet.nl (no kidding!)
 
If you have numbers in your table try packing the numbers in comp-3 fields. Depends if you have packed them already or not. It is a pain to pack and unpack but at least it is a viable option. If you do not like my post feel free to point out your opinion or my errors.
 
Hi BigMag,

Yeah, it is really me! In the old ages at a certain company that you know, we had tables which were bigger than 300k in OSVS COBOL. Although it didn't deserve the beauty-price, it was the best way to do it.

By the way the subscript-range-check from the COBOL compiler is always throwing away computer cycles because you have to program the control on the limits of your table anyway.

So be smarter than your compiler!

:)

Regards,

Crox
 
Thank you for all your responses. The limit of the compiler is exceeded and there is no simple solution to solve the problem. I know the programs should not have been written that way but probably it was the most efficient at that time. In addition, it was simple since just load the table from a file and search its contents. But as the users' requirements over the span of 20 years increases the program limitation exceeded. Sorry I should have included the sample but here it is:

01 TABLE-1.
03 F-ENTRY OCCURS 1 TO 55 TIMES.
05 F-CODE PIC X(3).
05 P-CODE PIC X(3) OCCURS 192 TIMES.

Increasing the table prevents the program from compiling. The solution so far is to create two tables.
 
Hi Ray,

If I understand the problem correctly, this is a data record intended to be written to a file (you mentioned record layout). If this is correct the limit you're reaching is not the table limit (LE COBOL has a tbl limit much higher than 32K) but the rec size limit (32K). If that's the case I don't think splitting the tbl up will help, since the rec size will still be > 32K.

Regards, Jack.
 
This is a P.S. to my prev post.

Although I've never used it, spanned recs my be the solution to your problem. It sounds like it allows sizes > 32K that are segmented into 32K chunks. It's all automatic, so far as I can tell. You might want to give it a shot.

Jack
 
HI Jack,
Sorry for the confusion but the table is not written to a file. I don't know exactly the code how to load the table but here is the main idea:
1. The user update a file through TSO before monthly
processing. The file is 80 characters long. (See
how tedious this can be.)
2. The program then reads the updated file and load it into
the table.
3. The program then reads another file, searches the table
then process each record. This is not a simple search.
There are "rollovers" from one number to another. It's
accounting stuff and its not easy to explain how it's
done.
I hope this give more clarification.
Thanks
Ray

P.S.
Hi Crox,
Can you tell me more about the tricks of bypassing the subscript check? It sounds like a good idea.

Thanks,
Ray
 
Hi Ray,

If you're using LE COBOL, the table size limit is well above 32K. So I'm puzzled about your problem. Are you sure about that? Are you executing the right compiler?
The best thing to do is to show us the JCL you use to compile and the source code for the pgm. If the pgm is too big, cut & paste the parts that are relevant.

If the code doesn't align properly, click the "Preview Post" button below and read the comments on how to use the "code" feature.

Regards, Jack.
 
Bypassing the subscript check:

insert the following lines in your COBOL source before the IDENTIFICATION DIVISION:


Code:
000100     CBL TRUNC(OPT)
000200     CBL NOSSRANGE

The trunc(opt) let you handle the binairy subscriptors in a better way. You can also defini your subscriptors as COMP-5.

The NOSSRANGE means: no subscribt range, so the compiler does not generate instructions to see if your subscriptor is going out of range. So in fact you can walk through your working-storage until you get a S0C4 abend.... so be aware what you are doing!

Also a negative subscriptor is going in the upwards direction. This can be used with variable records to get the recordlength.

I hope this is helpful!

Regards,

Crox

PS: The 32767 limit, sounds like a maximum record length for variable records, not for a table limit. See also the limits for the S390 compiler.
 
A caution -

The method of concatenating WS entries with large occurs so you can "walk out of the table" is not a good idea with modern IBM compilers. There is no guarentee that the data items will remain next to each other in storage.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top