ADD-ELEMENT adds files as members to a library. The member data is read from SYSDTA as standard. It can, however, also be read from an explicitly specified file or *OMF. The files are always added as a member to a library without a prefix, i.e. without catalog ID or user ID, unless the user has explicitly specified a prefix in the construction specification.
Files cataloged with RECORD-FORMAT=*UNDEFINED can also be incorporated in libraries. Files having RECORD-FORMAT=*FIXED can only be stored using SOURCE-ATTRIBUTES=*KEEP. The record formats FIXED and UNDEFINED are converted into the VARIABLE record format, i.e. are given a 4-byte record header. The record length, including record header, must not exceed 32 Kbytes.
File generation groups can only be incorporated using link names and a valid LMSCONV member designation.
In the case of the ADD-ELEMENT statement, LMSCONV adopts the catalog attribute CCS of the file as a member attribute. If the data is read from SYSDTA, the member generated is given the CCS name set for SYSDTA as an attribute. If the data is read from *OMF, the member is assigned “no code”.
Format
ADD-ELEMENT | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Operands
FROM-FILE = *STD / * SYSDTA(...) / *ALL / <filename 1..80 without-vers with-wild> / *LINK (...) / *OMF
Specifies the file to be added to the library as a member.
FROM-FILE = *STD
Data records are read from the default file, i.e. the system file SYSDTA.
Permissible member types: S, M, P, J, D, X
FROM-FILE = *SYSDTA(...)
The records are read with RDATA from system file SYSDTA. The records must directly follow the ADD-ELEMENT statement.
Permissible member types:S, M, P, J, D, X, R
END = '*END' / <c-string 1..8>
End criterion for the input. The sequence of records must be concluded with “*END” or a user-defined end criterion. If the input data contains no end criterion, reading continues to EOF.
FROM-FILE = <filename 1..80 without-vers with-wild >
The data is read from the specified file.
Permissible member types:S, M, P, J, D, X, R, C
Files of the PAM type can be stored only under the member type X.
FROM-FILE = *LINK(...)
The data is read from the file specified via the link name.
LINK-NAME = <structured-name 1..8>
Link name referencing the file.
FROM-FILE = *OMF
Applies only to R-type members.
The data is read from the OMF file. All modules from the OMF file are incorporated. If the EAM area contains more than one module of the same name, LMSCONV adds the last module processed to the library.
TO-ELEMENT = *LIBRARY-ELEMENT(...)
Specifies the destination and name under which the member is to be added.
LIBRARY = *STD / *LINK(...) / <filename 1..54 without-vers>
Specifies the library to which the member is to be added.
LIBRARY =
*STD
The library opened globally by OPEN-LIBRARY.
LIBRARY = *LINK(...)
The library assigned via a link name.
LINK-NAME = <structured-name 1..8>
Link name of the library.
LIBRARY = <filename 1..54 without-vers>
Name of the library to which the file is to be added as a member.
ELEMENT = *BY-SOURCE(...) /
<composed-name 1..132 with-under with-wildcard-constr>(...)
Name that the new member to be added is to receive. A constructor specification refers to the file name.
ELEMENT = *BY-SOURCE(...)
The member name corresponds to the file name or, in the case of *OMF, to the module name.
VERSION = *DEFAULT / *UPPER-LIMIT / <composed-name 1..24 with-under>Version that the new member to be added is to receive.
VERSION = *DEFAULT
The default value *BY-SOURCE or the current value set MODIFY-DEFAULTS.
VERSION = *UPPER-LIMIT
The highest possible version X'FF' is generated.
VERSION = <composed-name 1..24 with-under>
The text specified here is interpreted as the version designation.
ELEMENT = <composed-name 1..132 with-under with-wildcard-constr>(...)Specifies the name under which the member is stored.
VERSION = *DEFAULT / *UPPER-LIMIT / <composed-name 1..24 with-under>Version that the new member to be added is to receive.
For a description of the operands, see above.
TYPE = *DEFAULT / <alphanum-name 1..8>
Type that the new member to be added is to receive. If the value is *DEFAULT and the current value set with MODIFY-DEFAULTS is *NONE, LMSCONV requires a type specification.
USER-DATE = *TODAY / *BY-SOURCE / <date 8..10 with-compl>
Date given by the user.
USER-DATE = *TODAY
The current date is given.
USER-DATE = *BY-SOURCE
The CHANGE-DATE of the file is taken over.
USER-DATE = <date 8..10 with-compl>
The date must be specified in the form [YY]YY-MM-DD.
ELEMENT-ATTRIBUTES = *DEFAULT / *PARAMETERS(...)
Determines whether the file characteristics and also the ISAM key are incorporated into the output member..
ELEMENT-ATTRIBUTES = *DEFAULT
The member attributes TYPE=*UNDEFINED, VERSION=*BY-SOURCE and SOURCE-ATTRIBUTES=*IGNORE or the current value set with MODIFY-DEFAULTS.
ELEMENT-ATTRIBUTES = *PARAMETERS(...)
SOURCE-ATTRIBUTES = *DEFAULT / *STD / *IGNORE / *KEEP(...)
Stores file attributes. This operand has no effect if the data is read from SYSDTA or *OMF. Original attributes are not stored. If the data is read from a file of the type UPAM, this entry has no effect; it is always as though *KEEP had been specified.
SOURCE-ATTRIBUTES = *DEFAULT
The default value is *IGNORE (see below) or the current value set via MODIFY-DEFAULTS.
SOURCE-ATTRIBUTES = *STD
No file attributes are stored, and neither is an ISAM key. In this case, it is only possible to add ISAM files to the member with KEY-POSITION=5, KEY-LENGTH<= 16 and RECORD-FORMAT=*VARIABLE.
For ISAM files a warning is issued that the ISAM key has not been added.
SOURCE-ATTRIBUTES = *IGNORE
As for SOURCE-ATTRIBUTES=*STD, except that no warning is issued.
SOURCE-ATTRIBUTES = *KEEP(...)
The following file attributes are stored unchanged in the new member being added: ACCESS-METHOD, RECORD-FORMAT, RECORD-SIZE, BUFFER-LENGTH, PERFORMANCE, USAGE, ACCESS and USER-ACCESS. If ACCESS-
METHOD=ISAM is specified, the PADDING-FACTOR, LOGICAL-FLAG-LENGTH, VALUE-FLAG-LENGTH, PROPAGATE-VALUE-FLAG and the ISAM key and information relating to the ISAM secondary key are also stored. For SAM-Node-Files the character code is also stored on Net-Storage (NETCCSN).
KEEP-TYPES = *DEFAULT / *STD / *ALL
Specifies types of members for which file attributes are to be stored.
KEEP-TYPES = *DEFAULT
The default value is *STD (see below) or the current value set with MODIFY-DEFAULTS.
KEEP-TYPES = *STD
Attributes are stored for members of base types S, M, P, D, J, X.
KEEP-TYPES = *ALL
Attributes are stored for members of all base types that are permissible for ADD-ELEMENT.
for PAM members of type X
for members of type C if KEEP-TYPES = *ALL has been specified
DELETE-SOURCE = *DEFAULT / *NO / *YES
Here, the user can specify whether the original file is to be retained or deleted. This operand has no effect if the data is read from SYSDTA or *OMF.
DELETE-SOURCE = *DEFAULT
The default value is *NO (see below) or the current value set with MODIFY-DEFAULTS.
DELETE-SOURCE = *NO
The original file will not be deleted.
DELETE-SOURCE = *YES
The original file will be deleted.
WRITE-MODE = *DEFAULT / *CREATE / *REPALCE / *EXTEND / *ANY
Overwriting of a member having the same name. If the member does not exist under this name, it will be created as a new member.
WRITE-MODE = *DEFAULT
The default value is *CREATE (see below) or the current value set with MODIFY-DEFAULTS.
WRITE-MODE = *CREATE
The target member must not yet exist and is created as a new member.
WRITE-MODE = *REPLACE
A member will only be overwritten if a member having the same name is already present. Otherwise ADD-ELEMENT will be rejected with an error message.
WRITE-MODE = *EXTEND
A member will, however, only be extended if no ISAM keys are stored in the member and the file attributes ACCESS-METHOD, RECORD-FORMAT and RECORD-SIZE stored in the member match the attributes of the file. Otherwise ADD-ELEMENT will be rejected with an error message. *EXTEND is not permitted when input is from SYSDTA.
WRITE-MODE = *ANY
The target member is replaced if it already exists. Otherwise it will be created as a new member.
DIALOG-CONTROL = *DEFAULT / *NO / *YES / *ERROR
This operand specifies whether or not the execution of the statement is carried out interactively with the user.
For more detailed information on dialog control, see the MODIFY-DEFAULTS statement.
DIALOG-CONTROL = *DEFAULT
The default value is *NO or the current value set with MODIFY-DEFAULTS..
DIALOG-CONTROL = *NO
All members are processed without dialog queries, i.e. without the user being able to take control.
Exception: If a member or a library is locked, LMSCONV inquires whether the attempt to access it shall be repeated.
DIALOG-CONTROL = *YES / *ERROR
See the description in the MODIFY-DEFAULTS statement .
Notes
If SOURCE-ATTRIBUTES=*KEEP is specified, the following should be noted: Should any ISAM keys be present, this can impair subsequent processing such as language processing and /CALL-PROCEDURE. This parameter value is particularly suited to archiving.
When temporary files with wildcards are being added, no constructor specification of the target member name is permitted, i.e. only ELEM=*BY-SOURCE is permitted.
When temporary files are being added with ELEM=*BY-SOURCE, the member receives the internal file name. This member cannot be output to a file again under another task without explicit specification of a file name.
Example
Adding a member
The file “testmem” is added to library LIB1 under the same name as the member. The type specification must be specified explicitly here in the ADD-ELEMENT statement since the type is preset to *UNDEFINED as standard.
/start-lmsconv //open-library lib1,*update //add-element from-file=testelem,to-elem=(type=d) . . .