COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-138
OPEN
OPEN
OPEN makes a file accessible for input, output, or both. OPEN associates a COBOL
file name within the program with a file name known to the file system.
The NonStop operating system treats processes as files, so an HP COBOL program
can open a terminal or another process as a file. The mode in which such files are
opened determines how they are treated (see Table 4-4).
file-specification
INPUT
specifies that the file or files in input-file-description are being
opened for reading only.
Example 9-47. MULTIPLY GIVING Statement
03 UNIT-PRICE PICTURE S9(5)V999 COMPUTATIONAL.
03 ORDERED PICTURE S9(5) COMPUTATIONAL.
03 NET-PRICE PICTURE S9(10)V999 COMPUTATIONAL.
03 NET-PRICE-DSP PICTURE $$,$$$,$$$,$$$.99.
...
MULTIPLY UNIT-PRICE BY ORDERED
GIVING NET-PRICE-DSP ROUNDED
NET-PRICE
OPEN file-specification
VST186.vsd
INPUT input-file-description
OUTPUT output-file-description
I-O i-o-file-description
EXTEND extend-file-description
VST187.vsd