Apart from SAM or ISAM files, PLAM libraries are another important input source for the COBOL2000 compiler.
Characteristics of PLAM libraries
PLAM libraries are PAM files that are processed by using the PLAM (Primary Library Access Method) access method. These libraries can be created and maintained with the help of the LMS utility routine (see “LMS” manual [11]).
The elements of a PLAM library typically include not only compilation units and program segments (COPY elements), but also, for example, modules and executable programs. The individual element types are characterized by different type designations.
Among others, elements of the following types may be stored in a PLAM library:
Type designation | Content of the library elements |
S | compilation units, COPY elements |
R | Object modules or prelinked modules |
C | Executable programs |
J | Procedures |
L | Link-and-load modules (LLMs) |
P | Print-edited data (lists) |
X | REPOSITORY data |
Table 1: PLAM element types
A PLAM library may also contain elements of the same name, provided they can be differentiated by version or type designation.
The advantages of maintaining data in PLAM libraries are listed below:
Up to 30% storage space can be saved by combining different types of elements and by using additional compression techniques.
Access times are shorter for the various types of elements in the same program library as opposed to access times for conventional data maintenance.
The burden on EAM storage space is reduced when link-and-load modules are directly stored as PLAM library elements.
Input into PLAM libraries
PLAM libraries can accept compilation units
from files
from other libraries
via SYSDTA or SYSIPT, i.e. from a terminal or a temporary spoolin file.
The method used to enter a compilation unit into the PLAM library depends on the form in which it exists:
If the compilation unit exists as a cataloged file or as an element of a library, it can be copied to a PLAM library by using the LMS utility routine (see Example 2-1).
When transferring a compilation unit from an ISAM file with LMS, it should be noted that the ISAM key is not copied with PAR KEY=YES and SOURCE-ATTRIBUTES=KEEP. The COBOL2000 compiler cannot process any compilation unit with an ISAM key from a library.If the compilation unit is being entered for the first time, it can also be directly written into a PLAM library (as an element) by using the EDT file editor.
Example 2-1
Transferring a compilation unit from a cataloged file to a PLAM library
/START-LMS——————————————————————————————————————————————————————————————(1) % LMS0310 LMS VERSION '03.3A30' STARTED //OPEN-LIBRARY LIB=PLAM.LIB,MODE=UPDATE(STATE=NEW)——————————————————————(2) //ADD-ELEM FROM-FILE=SOURCE.EINXEINS,TO-E=LIB-ELEM(ELEM=EINXEINS,TYPE=S)(3) //END———————————————————————————————————————————————————————————————————(4) % LMS0311 LMS V03.3A30 TERMINATED NORMALLY
(1) (2) | The LMS utility routine is invoked. PLAM.LIB is defined as the new (STATE=NEW) output library (USAGE=OUT). By default, it is created as a PLAM library by LMS. |
(3) | The compilation unit is transferred from the cataloged file SOURCE.MULTABLE and is included under the name MULTABLE as an S-type element in the PLAM library. |
(4) | The LMS run is terminated; all open files are closed. |