Creates one or more new elements in a CMS library from an existing file. Format: CREATE ELEMENT element-expression "remark"
1 – Restrictions
o If you specify the /NOTES qualifier, you must also specify the /POSITION qualifier on the same command line.
2 – Command Parameters
element-expression Specifies one or more elements to be created. If you do not specify the /INPUT qualifier (or if you specify /INPUT without a value), the element name must correspond to an existing file in your current default directory. The name cannot be the same as any existing element name in the library. Do not use the file name 00CMS because this name is reserved for library control files. Generation 1 of the new element is created. An element expression can also be a list of element names separated by commas, or a wildcard expression. remark Specifies a character string for the creation remark of the element to be logged in the history file with this command. The remark is stored with both the element and its first generation. The remark is enclosed in quotation marks. If no remark was entered, a null remark ("") is logged.
3 – Description
The CREATE ELEMENT command creates the first generation of a new element by moving the input file into a CMS library. By default, CMS searches for the file in your current default directory. You can direct CMS to use a file in a different directory by specifying the /INPUT qualifier. After the element is created, CMS deletes all versions of the file used to create the new element. If you specify either the /KEEP or /RESERVE qualifiers, CMS does not delete the file. When you create an element, you can also define the history, concurrent, notes, position, reference copy, and review attributes for the element or establish a reservation. CMS stores the creation date and time, the revision date and time, file attributes, and the file revision number of the file used to create generation 1 of the new element. When you fetch or reserve a generation of an element, CMS restores the times, attributes, and file revision number associated with the file used to create the element generation. You can also display this information by using the SHOW GENERATION/FULL command. To change the creation remark associated with the element or generation 1 of the element, use the MODIFY ELEMENT or MODIFY GENERATION command, respectively.
4 – Qualifiers
4.1 /CONCURRENT (D)
Specifies whether this element can have multiple reservations. After you have created the element, you grant or deny concurrent access by using the MODIFY ELEMENT command.
4.2 /CONFIRM
Controls whether CMS prompts you for confirmation before each transaction. When you specify /CONFIRM and run CMS in interactive mode, CMS prompts you for confirmation. If you type YES, ALL, TRUE, or 1, CMS executes the transaction. If you type NO, QUIT, FALSE, 0, or press RETURN or CTRL/Z, no action is performed. If you type any other character, CMS continues to prompt until you type an acceptable response. CMS does not prompt for confirmation in batch mode.
4.3 /HISTORY="string"
Establishes the history attribute for the element. If an element has the history attribute, its history is included in the file when you retrieve it with the FETCH or RESERVE command. The quoted string specifies the format of the history. The quoted string must contain the characters #H or #B (lowercase is allowed) and can contain other printing characters. To include a quotation mark in the output history string, type it twice (""). To include a number sign (#) in the output history string, type it twice (##).
4.4 /INPUT[=file-specification]
Specifies the file to be used to create the element. When you specify an alternative location for the input file, CMS deletes the file from the alternative location (unless you specify /KEEP or /RESERVE). If you do not specify this qualifier, CMS searches your current default directory for a file with the same name as specified with the element expression parameter on the command line. Wildcards are allowed. CMS must be able to create a unique element for each file in the input file list. Thus, if you use wildcards in the /INPUT file specification to specify more than one input file, you must also use wildcards in the element-name parameter.
4.5 /KEEP
Controls whether CMS deletes all versions of the file used to create the new element. If you specify /KEEP, CMS does not delete the file.
4.6 /LOG (D)
Controls whether CMS displays success and informational messages on the default output device. By default, if the command executes successfully, CMS displays a success message. If you specify /NOLOG, success and informational messages are suppressed. Any warning, error, or fatal error messages are displayed regardless of whether /LOG or /NOLOG is specified.
4.7 /NOTES="string"
Establishes the notes attribute for the element. If an element has the notes attribute, notes are appended to the lines of the file when it is retrieved by the FETCH or RESERVE command. The quoted string specifies the format of the note. The quoted string can contain text or the characters #G (or #g), or both. If you specify /NOTES, you must also specify /POSITION.
4.8 /POSITION=n
Establishes the position attribute; that is, the character position where the note generated by the /NOTES qualifier begins on the line. The value n is required and must be an integer in the range 1 to 511. The /NOTES qualifier is required with the /POSITION qualifier. The note is placed to the right of the text of the line. If the length of the line is less than n, the note appears at position n. If the length of the line is greater than or equal to n, the note is placed at the next tab stop after the end of the line. (Tab stops are at position 9 and every eight characters thereafter.)
4.9 /REFERENCE_COPY
4.10 /NOREFERENCE_COPY
Controls whether CMS maintains a reference copy of the element. You must have established a reference copy directory. The presence of the reference copy attribute for an element is inherited from the library, that is, if a reference copy directory is established for the library, by default, the attribute is enabled for the element. You can override the reference copy attribute by specifying /NOREFERENCE_COPY. If a reference copy directory has been established for the CMS library, CMS creates a reference copy of the new element and updates the reference copy directory each time you create a new main line generation of that element. When CMS places a file in the reference copy directory, it also deletes any earlier versions of that file in the reference copy directory.
4.11 /RESERVE
Controls whether the new element is to be reserved after it is created. When you specify /RESERVE, CMS does not delete the file used to create the element. Generation 1 of the newly created element is automatically reserved. If you omit both the /RESERVE and the /KEEP qualifiers, CMS deletes all versions of the file used to create the element.
4.12 /REVIEW
Specifies that new generations of the element are marked for review. By default, new generations of the element are marked for review only if the reserved generation was either rejected or has a review pending. If you specify CREATE ELEMENT/REVIEW, generation 1 of the element is also marked for review. You can change the review attribute with the MODIFY ELEMENT command.
4.13 /BINARY
Controls whether CMS has to create an element of type binary or text. When you specify this qualifier, CMS creates the element in binary format irrespective of file properties. If you do not specify this qualifier, CMS decides on its own whether to create binary element or text element depending on file properties.
5 – Example
CMS> CREATE ELEMENT INIT.FOR "initialization routines" %CMS-S-CREATED, element DISKX:[PROJECT.CMSLIB]INIT.FOR created This command creates an element named INIT.FOR from a file with the same name in the current default directory, and then deletes all versions of that file in the current default directory.