GDDM V3R2 Base Application Programming Reference
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


Overlaying application data areas

GDDM V3R2 Base Application Programming Reference
SC33-0868-02



Sometimes, for programming reasons such as conserving storage, it is convenient to overlay the storage used by one of several application data structures. Generally, the structures are not the same length. In this situation, COBOL requires that the longest record description occurs first. To avoid needing to know in advance which record is the longest, you can specify


     LARGE STRUCTURE ===> YES

in frame 3.0 of the generation step of GDDM-IMD. This causes GDDM-IMD to generate an additional structure in a file with the same name as the mapgroup containing a single data item of length equal to that of the largest record.

The following code in the relevant section of the COBOL program then creates the necessary overlaid record descriptions:


     01 MAPGRP.
        COPY MAPGRP.
     01 HEADER REDEFINES MAPGRP.
        COPY HEADER.
     01 DATAREC REDEFINES MAPGRP.
        COPY DATAREC.
     01 TRAILER REDEFINES MAPGRP.
        COPY TRAILER.

COBOL also has the restriction on the placement of declarations using REDEFINES. To satisfy this restriction GDDM-IMD does not generate variables initialized to the application structure length, if you request


     LARGE STRUCTURE=YES

Note: If one of the maps has a name that is the same as the mapgroup name, the application data structure for that map is expanded by a dummy data item (if necessary) to make it as long as the longest application data structure.

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012