Software Sue

Link to Simply Sue
Link to Sustainability Sue
location: software/COBOL environment division Skip navigation : Home  

COBOL Environment Division


The Environment Division is optional, but usually present. It describes the computer system upon which the COBOL program is to be run. Contents vary from manufacturer to manufacturer, and from installation to installation.

The Configuration Section describes the make and model compiling and running the program.

The INPUT-OUTPUT section gives the relationships between the hardware devices (e.g. magnetic disk) and the attributes of the files using the devices.


[ ] denotes an optional element within a statement.

| denotes either/or.

{ } means select one.

In SPECIAL NAMES, implementor_name can be PRINTER, SYSIN, SYSOUT, SYSPUNCH, CONSOLE, READER, PUNCH or 'character'.


1 2 3 4 5 6 7 8
1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890
Seq.No-ABIdent
   ENVIRONMENT DIVISION. 
   CONFIGURATION SECTION. 
   SOURCE-COMPUTER. computer_name [WITH DEBUGGING MODE]. 
   OBJECT-COMPUTER. computer_name 
    [MEMORY SIZE integer (words | characters | modules)] 
    [PROGRAM COLLATING SEQUENCE IS alphabet_name] 
    [SEGMENT-LIMIT IS segment_number]. 
   SPECIAL-NAMES. 
    [{PRINTER | SYSIN | SYSOUT | SYSPUNCH | CONSOLE | READER | PUNCH | character} IS mnemonic_name  
         [ON STATUS IS condition_name] 
         [OFF STATUS IS condition_name]] 
    [alphabet_name IS STANDARD-1 | NATIVE | implementor_name | literal  
         [ALSO literal THROUGH | THRU literal]] 
    [CURRENCY SIGN IS literal] 
    [DECIMAL-POINT IS COMMA]. 
   INPUT-OUTPUT SECTION. 
   FILE-CONTROL. 
    SELECT [OPTIONAL] file_name  
         ASSIGN TO external_name [{DIRECT-ACCESS | UTILITY | UNIT-RECORD} device_name {UNIT | UNITS}]  
         [RESERVE {NO | integer} [ALTERNATIVE] {AREA | AREAS}] 
         [ORGANIZATION [IS] {SEQUENTIAL | DIRECT}] 
         [ACCESS [MODE IS] {SEQUENTIAL | RANDOM | DYNAMIC}] 
         [FILE STATUS IS data_name] 
         [SYMBOLIC KEY IS data_name] 
         [RECORD [KEY IS] dataname] 
         [ALTERNATE RECORD [KEY IS] dataname] 
         [ACTUAL [KEY IS] dataname] 
         [FILE-LIMIT [IS] integer TRACKS] 
         [FILE STATUS IS data_name]. 
   I-O-CONTROL. 
    SAME [AREA FOR] filename[,] filename ... 
         RERUN ON external_name  
         [EVERY END OF] {REEL | UNIT} integer [RECORDS OF] file_name ] 
         [ORGANIZATION [IS] {SEQUENTIAL | DIRECT}] 
    APPLY {RESTRICTED SEARCH [OF integer TRACKS] ON filename |  
         Condition_name [TO] FORM-VERFLOW ON filename | 
         WRITE-ONLY ON filename}