COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Usage Considerations:
TAPE DEFINE Provides the Only Way to Use Labeled Tapes
For details, see Chapter 25: Executing and Debugging HP COBOL Programs (page 820), and
the Guardian User’s Guide.
You Can Use SPOOL DEFINES instead of COBOLSPOOLOPEN
Special DEFAULTS DEFINE: =_DEFAULTS DEFINE
Processes can use the =_DEFAULTS DEFINE without referring to it explicitly. The file system
uses this DEFINE whenever it needs the values stored in the DEFINE’s attributes. You cannot
delete the =_DEFAULTS DEFINE or change its name.
ADD DEFINE Command
Your COBOL program can, in the ASSIGN clause of a file-control entry, associate a DEFINE name
with a COBOL file name, just as it would associate a file-system file name with a COBOL file name.
When the process compiled from that source attempts to open that file, the file system looks for the
stored set of attribute/value pairs and uses them to complete the specification of the file before
making it available to the process. If it cannot make a file available (based on what it finds, or
fails to find), the open operation fails.
To create and name a DEFINE, you use the ADD DEFINE command. Suppose that your current
CLASS attribute has the value MAP. If your COBOL program includes this file-control entry:
SELECT MARKET-ANALYSIS
ASSIGN TO "=MARKT"
ACCESS MODE IS DYNAMIC
RECORD KEY IS PRODUCT-CODE
FILE STATUS IS M-STAT.
Before executing your program, you must issue a command of this form:
>ADD DEFINE =MARKT, FILE \MAG.$EAST.APRIL.SALES
to associate the file SALES in subvolume APRIL on volume $EAST on system \MAG with the name
=MARKT.
Initial State
Every program in a run unit has an initial state in which a process places it at certain times while
the run unit executes.
When a program is in its initial state:
Each data item in the Linkage Section has the value specified by the calling program.
Each Working-Storage or Extended-Storage data item that is described with a VALUE clause
(except level-88 condition-names) has the specified value.
The value of each data item in the Working-Storage Section or the Extended-Storage Section
that is not described with a VALUE clause depends on whether the NOBLANK directive was
active during compilation. If not, each data item has a space character (octal 40) in each
character position or (for a COMPUTATIONAL, COMPUTATIONAL-3, or COMPUTATIONAL-5
data item) a value consisting of a series of space characters interpreted as a binary number.
If the NOBLANK directive was active during compilation, the value of each data item is
unpredictable.
The open mode of each internal file connector is either Closed or Locked. The other dynamic
attributes of the file connector (such as the file position indicator setting) and the contents of
the record area for the file associated with the file connector are undefined.
596 Program Execution