ContentsIndexPreviousNext

5.1.6 Large Data Handling

ACUCOBOL-GT normally limits a single data item to 64 kilobytes. It does this because some older machines that run ACUCOBOL-GT have addressing restrictions. As long as the 64K limit is in place, the portability of your ACUCOBOL-GT programs is preserved.

In some programs it may be desirable to use larger data items. The compile-time option "-Zl" allows this to occur, but at the cost of your not being able to run your program on all machines. When you use this option, a data item may be bigger than 64 KB, but the program can be run only on machines that can address more than 64 KB in a single memory segment.

Programs compiled with the "-Zl" option are called "large-model" programs. Generally speaking, any 32-bit machine can run large-model programs. When you specify "-Zl", you can use data items that have more than 64 KB in them. In order to keep the runtime system efficient, there are several constraints on these data items:

1. Any group item or alphanumeric data item may have more than 64 KB in it. Each elementary item that is contained in this item must be smaller than 64 KB. Note that a contained table may be more than 64 KB, but each element of the table must be less than 64 KB.

2. Only data items in Working Storage or in Linkage may be larger than 64 KB.

3. A data item that is larger than 64 KB may be used in only a few circumstances:

a) As the source or destination of a MOVE statement.

b) As the destination of an INITIALIZE statement.

c) In the USING phrase of a CALL statement (but not a CALL RUN or CALL PROGRAM statement).

No other uses are allowed. Note, however, that data items contained in a large group may be used normally. This includes using the SEARCH verb on an enclosed table or any other normal usage.

4. A large data item may not be given a VALUE clause. It is initialized to SPACES automatically. (External data items are initialized to NULLS.) Data items contained in the large item may be given VALUE clauses.

Data items that are larger than 64 KB are given addresses starting at 40000000 (hex). This is done to indicate to the runtime system that large-model addressing needs to be used for them. These addresses do not correspond to actual machine addresses; they are used to indicate which address space (segmented or linear) needs to be used.

Finally, note that any ACUCOBOL-GT compiler can create large-model programs, even compilers running on machines that cannot run large-model programs.