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

DEFINE Names
A DEFINE name begins with an equal sign (=) followed by a letter and up to 22 additional
characters, which can be letters, digits, hyphens (-), underscores (_), and circumflexes (^).
Example 258 DEFINE Names
=NEWFILE
=FILE25
=TAPE-FILE
=FTEST_RESULTS
=JEFFS^FILE
DEFINE Attributes
Every DEFINE has a CLASS attribute, which determines its other attributes. For details, see the
section of this manual that explains input-output for the system file that you want to associate with
the DEFINE name:
Section Number and NameSystem file is a ...
Chapter 27: Tape Input and Output (page 838)Tape file
Chapter 28: Disk Input and Output (page 856)Disk file
Chapter 29: Terminal Input and Output (page 889)Terminal
Chapter 30: Printer and Spooler Output (page 899)Printer or spooler
Overriding File Assignments Made at Compilation Time
To override a file assignment made at compile time—an assignment of a COBOL file name to a
system file name—you use an ASSIGN command.
Suppose that your program, PROG1, assigns the COBOL file name MAJORACCT to the system
file name \AKRON.$SLB.MAJ.ACC with this SELECT clause:
SELECT MAJORACCT ASSIGN TO "\AKRON.$SLB.MAJ.ACC"
When you execute PROG1 and it opens MAJORACCT, the file it actually opens is
\AKRON.$SLB.MAJ.ACC. Suppose that you want MAJORACCT to be another file,
\NICE.$FRNC.SIGNIF.CUST, instead. You can override the original file assignment before executing
PROG1 with the command:
ASSIGN PROG1.MAJORACCT,\NICE.$FRNC.SIGNIF.CUST
When you execute PROG1 and it opens MAJORACCT, the file it actually opens is
\NICE.$FRNC.SIGNIF.CUST rather than \AKRON.$SLB.MAJ.ACC.
The number of ASSIGN commands the command interpreter can store is limited by the amount of
memory allocated to the command interpreter. The default amount of memory allocated to the
command interpreter is 8 pages, which accommodates up to 19 ASSIGN commands. To allocate
more memory to the command interpreter, use the MEM option in the RUN command that you use
to run the command interpreter. Each additional page of memory allocated to the command
interpreter accommodates an additional 19 ASSIGN commands.
Specifying Characteristics of Files That a Program Creates
If your program is to create a file, you can specify these characteristics of that file with an ASSIGN
command:
The actual file name with which the COBOL file name is to be associated
The size of the file (extent size)
Preparing to Execute an HP COBOL Program 821