In BS2000 there are two formats for libraries. A 2K-oriented format (NK2 PLAM file) and a 4K-oriented format (NK4 PLAM file). The COPY-LIBRARY statement converts from one format to the other. The user determines the appropriate format with the aid of /ADD-FILE-LINK ...,BUFFER-LENGTH=*STD(1 or 2). LMSCONV supports both library formats. It also supports NK4 disks with the ADD-ELEMENT and EXTRACT-ELEMENT statements.
Adding files with ADD-ELEMENT
Using the ADD-ELEMENT statement, files of any BUFFER-LENGTH can be added to a library.
Outputting files with EXTRACT-ELEMENT
For the EXTRACT-ELEMENT statement, a distinction is made between the following cases:
The member has an attribute record with the original BUFFER-LENGTH specification (e.g. following ADD-ELEMENT with SOURCE-ATTR=*KEEP or for original UPAM files, e.g. also libraries).
A BUFFER-LENGTH value is explicitly preset for the target file, either through an entry in the TASK-FILE-TABLE (TFT) via /ADD-FILE-LINK or directly in the catalog. In this case, the preset value is always used. When the value is transferred, the following problems may occur:
SAM/ISAM file
The member records are too long for the preset BUFFER-LENGTH. A DMS error is then reported.
UPAM file
When creating UPAM files, LMSCONV fills up a logical block (except for the last one) with 2K units and only then outputs it with UPAM.
With BLKCTRL=DATA, every logical block (BUFFER-LENGTH) begins with a 12-byte block control field (CF). If the preset BUFFER-LENGTH does not correspond to the stored value, data can be overwritten with the CF by the DMS. The file is then unusable.
With BLKCTRL=NO, however, unusable files may likewise be generated if the BUFFER-LENGTH is changed (e.g. PLAM files).
This is why LMSCONV generally outputs a warning for different BUFFER-LENGTH values (user specification versus stored value). However, it always attempts to create the file.
No BUFFER-LENGTH value is specified or known for the target file. In this case, the value is taken from the attribute record.
If n in STD(n) is odd, LMSCONV increments to n+1.
The member does not contain any attribute record, e.g. for phase members.
The BUFFER-LENGTH value is specified explicitly for the target disk. Procedure as for 1a above.
When creating phases, specifying BUFFER-LENGTH values not equal to STD(1) or STD(2) produces an error.
No BUFFER-LENGTH value is specified or known for the target file.
For phases, the BUFFER-LENGTH is given by the current environment, i.e. BUFFER-LENGTH=STD(1) on NK2 disks and BUFFER-LENGTH=STD(2) on NK4 disks. The contents of these phases do not differ.
Otherwise, BUFFER-LENGTH is calculated on the basis of the maximum record lengths.
All things considered, the following procedure is recommended if files are to be brought onto an NK4 disk via a library:
Actions on the NK2 disk:
Extract all “critical” members of the library as files. Critical members are “PAM” members under type X, which, as a file, have one of the following characteristics:BUFFER-LENGTH=STD(n), where n is odd
PAM key phases or
2K-oriented PLAM files.
Using PAMCONV, convert all files with an odd BUFFER-LENGTH (except PLAM files) into NK4 files.
Using PAMCONV, convert all PAM key phases into NK phases.
Using the LMSCONV statement COPY-LIBRARY, convert NK2 PLAM files to NK4 PLAM files.
Then use the ADD-ELEMENT statement to add the NK4 files to an NK4 PLAM file and transfer that file to the NK4 disk.