Function
The ASSIGN clause provides the connection between the file control entry and a file. The file can be assigned to a physical file or be contained in memory.
Format
ASSIGN { TO { literal-1
| DATA data-name-1
| data-name-2 LENGTH IS data-name-3 [FOR {ALPHANUMERIC | NATIONAL}]
}
| USING data-name-4
}
Syntax rules
literal-1 must be an alphanumeric literal and may not be a figurative constant.
data-name-1 must be an alphanumeric or national data item.
data-name-2 must be an elementary item of the category data-pointer.
data-name-3 must be an integer, unsigned elementary item whose definition does not contain PICTURE symbol ’P’.
data-name-1, data-name-2 and data-name-3 may not be described in the record description entry of a file with organization XML.
data-name-4 must be an alphanumeric data item and may not be defined within the FILE SECTION.
The DATA or LENGTH phrase may not be specified if OPTIONAL is specified in the associated SELECT clause.
If neither ALPHANUMERIC nor NATIONAL is specified, ALPHANUMERIC is implied.
General rules
If literal-1 or data-name-4 is specified, the XML document is contained in a physical file, otherwise it is contained in memory.
literal-1 or the content of data-name-4 specifies the link name for the file. Only the first 8 characters are used for literal-1. If the eighth character is a hyphen (-), this is replaced by the hash character (#).
An XML document in memory is assigned
directly by the data item with data-name-1 which contains the XML document.
indirectly by a data pointer data-name-2 which points to a memory area containing the XML document. In this case data-name-3 specifies the length of the memory area in characters.
The FOR phrase defines whether the memory area containing the XML document is interpreted as an alphanumeric or national characters.
The address and length of the memory area containing the XML document are evaluated using the OPEN statement. The content of the memory area is only evaluated when the OPEN DOCUMENT statement executes. Modifications made subsequently have no influence on the evaluated address and length or on the content.