Ch 2_2. ENVIRONMENT DIVISION
Describes the specific computer equipment used by the program.
- CONFIGURATION SECTION: supplies information about the computer
on which the COBOL program will be compiled and executed.
- INPUT-OUTPUT SECTION: describes specific devices or hardware used
in the program, which includes: Disk, Printer, MT, etc.
IDENTIFICATION DIVISION.
PROGRAM-ID. program-name.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. VAX-8800.
OBJECT-COMPUTER. VAX-8800.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT F1 ASSIGN TO DISK 'TST.DAT' ...
SELECT F2 ASSIGN TO DISK 'TST.RES' ...
DATA DIVISION.
FILE SECTION.
FD F1 RECORD CONTATINS 80 CHARACTERS.
...
FD F2 RECORD CONTATINS 80 CHARACTERS.
...
PROCEDURE DIVISION.
OPEN INPUT F1 OUTPUT F2.
...
CLOSE F1 F2.
STOP RUN.