COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
file-type
can be specified in the Guardian environment only. It is a numeric data item whose content,
or a numeric literal whose value, is either 0 (for an unstructured file) or 2 (for an entry-sequenced
file). You can specify file-type only for a file whose organization is sequential. For other
file organizations, the organization determines the file type (relative for ORGANIZATION
RELATIVE and key sequenced for ORGANIZATION INDEXED).
If file-type is omitted, COBOL_ASSIGN_ and does not change the original file type.
error-number
is a numeric data item in which COBOL_ASSIGN_ returns an error code. Possible values for
error-number and their respective meanings are:
MeaningValue
No error occurred.0
system-file-name has invalid syntax or the name has no length (such as a group
containing an OCCURS DEPENDING whose length is 0).
1
system-file-name is open and cannot be changed.2
There is not enough system space to add the new name.4
file-type is not 0 or 2, file-type is specified for a file whose organization is not
sequential, or file-type or file-code is specified for an OSS file.
5
COBOL_ASSIGN_ does not determine whether the assigned file actually exists or is accessible.
This checking is done by the OPEN statement. COBOL_ASSIGN_ can be called repeatedly for
one fd-name.
An attempt to open a file using a dynamically assignable fd-name before COBOL_ASSIGN_ has
been used on it is an attempt to open $volume.#DYNAMIC (where $volume is the default
volume). This causes a run-time error.
A CLOSE LOCK on a file using a dynamic fd-name closes the file but does not lock it. If locking
were allowed, it would only prevent the reuse of the fd-name for the remainder of the run unit’s
existence; the file would still be accessible through another dynamic fd-name.
A command interpreter ASSIGN command cannot designate an fd-name as dynamically
assignable—you must do this in the source program. ASSIGN can, however, assign a default
value to the previously designated dynamic file name. The effect is the same as having an ENTER
COBOL_ASSIGN_ statement as the first statement in the program. See ASSIGN Command
(page 582).
A CRE HP COBOL program can call either COBOL_ASSIGN_ (the COBOL-environment routine)
or COBOL_ASSIGN_ (the equivalent CRE routine). If it calls COBOL_ASSIGN_, it actually calls
COBOL_ASSIGN_ indirectly. There are advantages to calling COBOL_ASSIGN_ directly (see
COBOL_ASSIGN_).
648 Libraries and Utility Routines










