.. |_| unicode:: 0xA0 :trim: .. role:: small-caps :class: small-caps .. include:: .. index:: single:ENVIRONMENT DIVISION Syntax .. _ENVIRONMENTADIVISIONASyntax: 3 ENVIRONMENT DIVISION Syntax ============================= .. index:: single:ENVIRONMENT DIVISION Syntax ENVIRONMENT DIVISION Syntax --------------------------- :: ENVIRONMENT DIVISION. ~~~~~~~~~~~ ~~~~~~~~ [ CONFIGURATION SECTION. ] ~~~~~~~~~~~~~ ~~~~~~~~ [ SOURCE-COMPUTER. Compilation-Computer-Specification . ] ~~~~~~~~~~~~~~~ [ OBJECT-COMPUTER. Execution-Computer-Specification . ] ~~~~~~~~~~~~~~~ [ SPECIAL-NAMES. Program-Configuration-Specification . ] ~~~~~~~~~~~~~ [ REPOSITORY. Function-Specification... . ] ~~~~~~~~~~ [ INPUT-OUTPUT SECTION. ] ~~~~~~~~~~~~ ~~~~~~~ [ FILE-CONTROL. General-File-Description... . ] ~~~~~~~~~~~~ [ I-O-CONTROL. File-Buffering Specification... . ] ~~~~~~~~~~~ .. index:: single:CONFIGURATION SECTION Syntax CONFIGURATION SECTION Syntax ---------------------------- :: CONFIGURATION SECTION. ~~~~~~~~~~~~~ ~~~~~~~ [ SOURCE-COMPUTER. Compilation-Computer-Specification . ] ~~~~~~~~~~~~~~~ [ OBJECT-COMPUTER. Execution-Computer-Specification . ] ~~~~~~~~~~~~~~~ [ SPECIAL-NAMES. Program-Configuration-Specification . ] ~~~~~~~~~~~~~ [ REPOSITORY. Function-Specification... . ] ~~~~~~~~~~ .. index:: single:SOURCE-COMPUTER Syntax SOURCE-COMPUTER Syntax ---------------------- :: SOURCE-COMPUTER. computer-name [ WITH DEBUGGING MODE ] . ~~~~~~~~~~~~~~~ ~~~~~~~~~ ~~~~ .. index:: single:OBJECT-COMPUTER Syntax OBJECT-COMPUTER Syntax ---------------------- :: OBJECT-COMPUTER. [ computer-name ] ~~~~~~~~~~~~~~~ [ MEMORY SIZE IS integer-1 WORDS|CHARACTERS ] ~~~~~~ ~~~~ ~~~~~ ~~~~~~~~~~ [ PROGRAM COLLATING SEQUENCE IS alphabet-name-1 ] ~~~~~~~~~ [ SEGMENT-LIMIT IS integer-2 ] ~~~~~~~~~~~~~ [ CHARACTER CLASSIFICATION IS { locale-name-1 } ] ~~~~~~~~~~~~~~ { LOCALE } { ~~~~~~ } { USER-DEFAULT } { ~~~~~~~~~~~~ } { SYSTEM-DEFAULT } ~~~~~~~~~~~~~~ . .. index:: single:SEGMENT-LIMIT .. index:: single:MEMORY SIZE The \ \ :code:`MEMORY SIZE`\ and \ \ :code:`SEGMENT-LIMIT`\ clauses are syntactically recognized but are otherwise non-functional. .. index:: single:SPECIAL-NAMES Syntax SPECIAL-NAMES Syntax -------------------- :: SPECIAL-NAMES. ~~~~~~~~~~~~~ [ CALL-CONVENTION integer-1 IS mnemonic-name-1 ] ~~~~~~~~~~~~~~~ [ CONSOLE IS CRT ] ~~~~~~~ ~~~ [ CRT STATUS IS identifier-1 ] ~~~ ~~~~~~ [ CURRENCY SIGN IS literal-1 ] ~~~~~~~~ ~~~~ [ CURSOR IS identifier-2 ] ~~~~~~ [ DECIMAL-POINT IS COMMA ] ~~~~~~~~~~~~~ ~~~~~ [ EVENT STATUS IS identifier-3 ] ~~~~~ ~~~~~~ [ LOCALE locale-name-1 IS literal-2 ]... ~~~~~~ [ NUMERIC SIGN IS TRAILING SEPARATE ] ~~~~~~~ ~~~~ ~~~~~~~~ ~~~~~~~~ [ SCREEN CONTROL IS identifier-4 ] ~~~~~~ ~~~~~~~ [ device-name-1 IS mnemonic-name-2 ]... [ feature-name-1 IS mnemonic-name-3 ]... [ Alphabet-Clause ]... [ Class-Definition-Clause ]... [ Switch-Definition-Clause ]... [ Symbolic-Characters-Clause ]... . .. index:: single:SCREEN CONTROL .. index:: single:EVENT STATUS The \ \ :code:`EVENT STATUS`\ and \ \ :code:`SCREEN CONTROL`\ clauses are syntactically recognized but are otherwise non-functional. .. index:: single:REPOSITORY Syntax REPOSITORY Syntax ----------------- :: REPOSITORY. ~~~~~~~~~~ FUNCTION { function-prototype-name-1 [ AS literal-1 ] }... ~~~~~~~~ { ~~ } { intrinsic-function-name-1 [ AS literal-2 ] } { ~~ } { intrinsic-function-name-2 INTRINSIC } { ALL INTRINSIC ~~~~~~~~~ } ~~~ ~~~~~~~~~ .. index:: single:SPECIAL-NAMES Alphabet-Clause Syntax SPECIAL-NAMES Alphabet-Clause Syntax ------------------------------------ :: ALPHABET alphabet-name-1 IS { ASCII } ~~~~~~~~ { ~~~~~ } { EBCDIC } { ~~~~~~ } { NATIVE } { ~~~~~~ } { STANDARD-1 } { ~~~~~~~~~~ } { STANDARD-2 } { ~~~~~~~~~~ } { Literal-Clause... } .. index:: single:SPECIAL-NAMES ALPHABET Literal-Clause Syntax SPECIAL-NAMES ALPHABET Literal-Clause Syntax -------------------------------------------- :: literal-1 [ { THRU|THROUGH literal-2 } ] { ~~~~ ~~~~~~~ } { {ALSO literal-3}... } ~~~~ .. index:: single:SPECIAL-NAMES Class-Definition-Clause Syntax SPECIAL-NAMES Class-Definition-Clause Syntax -------------------------------------------- :: CLASS class-name-1 IS { literal-1 [ THRU|THROUGH literal-2 ] }... ~~~~~ ~~~~ ~~~~~~~ .. index:: single:SPECIAL-NAMES Switch-Definition-Clause Syntax SPECIAL-NAMES Switch-Definition-Clause Syntax --------------------------------------------- :: switch-name-1 [ IS mnemonic-name-1 ] [ ON STATUS IS condition-name-1 ] ~~ [ OFF STATUS IS condition-name-2 ] ~~~ .. index:: single:SPECIAL-NAMES-Symbolic-Characters-Clause Syntax SPECIAL-NAMES-Symbolic-Characters-Clause Syntax ----------------------------------------------- :: SYMBOLIC CHARACTERS ~~~~~~~~ { symbolic-character-1... IS|ARE integer-1... }... [ IN alphabet-name-1 ] ~~ .. index:: single:INPUT-OUTPUT SECTION Syntax INPUT-OUTPUT SECTION Syntax --------------------------- :: [ INPUT-OUTPUT SECTION. ] ~~~~~~~~~~~~ ~~~~~~~ [ FILE-CONTROL. ] ~~~~~~~~~~~~ [ SELECT-Statement... ] [ I-O-CONTROL. ] ~~~~~~~~~~~ [ MULTIPLE-FILE-Statement ] [ SAME-RECORD-Statement ] .. index:: single:I-O-CONTROL MULTIPLE FILE Syntax I-O-CONTROL MULTIPLE FILE Syntax -------------------------------- :: MULTIPLE FILE TAPE CONTAINS ~~~~~~~~ { file-name-1 [ POSITION integer-1 ] }... ~~~~~~~~ . The \ :code:`MULTIPLE FILE TAPE`\ clause is obsolete and is therefore recognized but not functional. .. index:: single:I-O-CONTROL SAME AREA Syntax I-O-CONTROL SAME AREA Syntax ---------------------------- :: SAME { SORT-MERGE } AREA FOR file-name-1... . ~~~~ { ~~~~~~~~~~ } { SORT } { ~~~~ } { RECORD } ~~~~~~ .. index:: single:SAME SORT .. index:: single:SAME SORT-MERGE The \ \ :code:`SAME SORT-MERGE`\ and \ \ :code:`SAME SORT`\ clauses are syntactically recognized but are otherwise non-functional. .. index:: single:SELECT Statement Syntax SELECT Statement Syntax ----------------------- :: SELECT [ [ NOT ] OPTIONAL ] file-name-1 ~~~~~~ ~~~ ~~~~~~~~ [ ASSIGN { TO } [{ EXTERNAL }] [{ DISC|DISK }] [{ identifier-1 }] ] ~~~~~~ { USING } { ~~~~~~~~ } { ~~~~ ~~~~ } { word-1 } { DYNAMIC } { DISPLAY } { literal-1 } ~~~~~~~ { ~~~~~~~ } { KEYBOARD } { ~~~~~~~~ } { LINE ADVANCING } { ~~~~ ~~~~~~~~~ } { PRINTER } { ~~~~~~~ } { RANDOM } { ~~~~~~ } { TAPE } ~~~~ [ COLLATING SEQUENCE IS alphabet-name-1 ] ~~~~~~~~~ [ FILE|SORT ] STATUS IS identifier-2 [ identifier-3 ] ] ~~~~ ~~~~ ~~~~~~ [ LOCK MODE IS { MANUAL|AUTOMATIC } ] ~~~~ { ~~~~~~ ~~~~~~~~~ } { EXCLUSIVE [ WITH { LOCK ON MULTIPLE RECORDS } ] } ~~~~~~~~~ { ~~~~ ~~ ~~~~~~~~ ~~~~~~~ } { LOCK ON RECORD } { ~~~~ ~~ ~~~~~~ } { ROLLBACK } { ~~~~~~~~ } [ ORGANIZATION Clause ] ~~~~~~~~~~~~ [ ORGANISATION Clause ] ~~~~~~~~~~~~ [ RECORD DELIMITER IS STANDARD-1 ] ~~~~~~ ~~~~~~~~~ ~~~~~~~~~~ [ RESERVE integer-1 AREAS ] ~~~~~~~ [ SHARING WITH { ALL OTHER } ] ~~~~~~~ { ~~~ } { NO OTHER } { ~~ } { READ ONLY } ~~~~ ~~~~ .. index:: single:ALL OTHER .. index:: single:RESERVE .. index:: single:RECORD DELIMITER .. index:: single:COLLATING SEQUENCE The \ \ :code:`COLLATING SEQUENCE`\ , \ \ :code:`RECORD DELIMITER`\ , \ \ :code:`RESERVE`\ and \ \ :code:`ALL OTHER`\ clauses are syntactically recognized but are otherwise non-functional. .. index:: single:ORGANIZATION SEQUENTIAL Clause Syntax ORGANIZATION SEQUENTIAL Clause Syntax ------------------------------------- :: [ ORGANIZATION|ORGANISATION IS ] RECORD BINARY SEQUENTIAL ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~~~~ [ ACCESS MODE IS SEQUENTIAL ] ~~~~~~ ~~~~~~~~~~ .. index:: single:ORGANIZATION LINE SEQUENTIAL Clause Syntax ORGANIZATION LINE SEQUENTIAL Clause Syntax ------------------------------------------ :: [ ORGANIZATION|ORGANISATION IS ] LINE SEQUENTIAL ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~ ~~~~~~~~~~ [ ACCESS MODE IS SEQUENTIAL ] ~~~~~~ ~~~~~~~~~~ [ PADDING CHARACTER IS literal-1 | identifier-1 ] ~~~~~~~ The \ :code:`PADDING CHARACTER`\ clause is syntactically recognized but is otherwise non-functional. .. index:: single:ORGANIZATION RELATIVE Clause Syntax ORGANIZATION RELATIVE Clause Syntax ----------------------------------- :: [ ORGANIZATION|ORGANISATION IS ] RELATIVE ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~~ [ ACCESS MODE IS { SEQUENTIAL } ] ~~~~~~ { ~~~~~~~~~~ } { DYNAMIC } { ~~~~~~~ } { RANDOM } ~~~~~~ [ RELATIVE KEY IS identifier-1 ] ~~~~~~~~ .. index:: single:ORGANIZATION INDEXED Clause Syntax ORGANIZATION INDEXED Clause Syntax ---------------------------------- :: [ ORGANIZATION|ORGANISATION IS ] INDEXED ~~~~~~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~ [ ACCESS MODE IS { SEQUENTIAL } ] ~~~~~~ { ~~~~~~~~~ } { DYNAMIC } { ~~~~~~~ } { RANDOM } ~~~~~~ [ RECORD KEY IS { [ data-name-1 ] ~~~~~~ { [ record-key-name-1 ] [ =|{SOURCE IS} data-name-2 ] ... ] } ~~~~~~ [ ALTERNATE RECORD KEY IS { [ data-name-3 ] ~~~~~~~~~ ~~~~~~ { [ record-key-name-2 ] [ =|{SOURCE IS} data-name-4 ] ... ] } ~~~~~~ [ WITH DUPLICATES ] ]... ~~~~~~~~~~ [ SUPPRESS WHEN ALL literal ] ~~~~~~~~~~~~~~~~~ [ SUPPRESS WHEN SPACES | ZEROES ] ~~~~~~~~~~~~~~~~~~~~ ~~~~~~