VS COBOL II grammar Version 1.0.4

Copyright (C) 1999-2003 Ralf Lämmel & Chris Verhoef (Vrije Universiteit, Amsterdam)

This grammar has been been recovered from IBM's VS COBOL II Reference Summary (Document Number: SX26-3721-05) in a semi-automatic, formal process. In this unique process, many problems in the IBM document have been detected and fixed in a traceable way. The process is described by the authors of the grammar in the paper Semi-automatic Grammar Recovery. The grammar should be regarded as a specification (of context-free syntax + lexical syntax) rather than a realistic parser + scanner description. So, for example, issues usually handled by a pre-processor are not covered by the formal definition. Also, the grammar specification is still ambigious. However, from this grammar we automatically derived a prototype parser. The grammar has been tested for large test sets of COBOL code: 8 test sets from different countries with 1.819.765 LOC (before preprocessing: 1.631.825) or 109.697.736 BYTES (before preprocessing: 113.481.950).

If you have any remark or a question, contact the authors of this grammar: Ralf Lämmel (Email: ralf@cwi.nl) & Chris Verhoef (Email: x@cs.vu.nl); Vrije Universiteit, Amsterdam. This is Version 1.0.4 of the grammar. It has been released on April 29, 2003. Version 1.0 (i.e., the first version) of the grammar has been released on December, 3rd, 1999. Refer to the ChangeLog for details. This document is maintained by Ralf Lämmel.

Acknowledgement
Many thanks to Bob Diertens for helping us with preprocessing the test sets. Many thanks to Peter Aarnoutse for the answers to our COBOL questions. The system LDL supporting language-centric software protoyping has been used for all aspects of specification/implementation in this project, namely grammar recovery, parsing test sets, generation of the actual browsable grammar.


Contents


Summary


Context-free syntax

The following rules define the context-free syntax of VS COBOL II using a variant of EBNF (Extended Backus Naur Form). Details of the notation (such as the special infix operator "||" for permutation phrases) are explained elsewhere. The start symbol of the context-free grammar is cobol-source-program. All sorts on right-hand sides are linked to the corresponding definitions, whereas the sorts on the left-hand sides are linked to the table of all sorts which is useful to navigate to the use sites of a sort.

cobol-source-program = ( "IDENTIFICATION" | "ID" ) "DIVISION" ".program-id-cobol-source-program
identification-division-content ]
[ "ENVIRONMENT" "DIVISION" ".environment-division-content ]
[ "DATA" "DIVISION" ".data-division-content ]
procedure-division ]
[ { nested-cobol-source-program }* "END" "PROGRAMprogram-name "." ]

Diagrams  Uses  Top  Help

program-id-cobol-source-program = "PROGRAM-ID" [ "." ] program-name
[ [ "IS" ] "INITIAL" [ "PROGRAM" ] ] [ "." ]

Diagrams  Uses  Top  Help

nested-cobol-source-program = ( "IDENTIFICATION" | "ID" ) "DIVISION" ".program-id-nested-cobol-source-program
identification-division-content ]
[ "ENVIRONMENT" "DIVISION" ".environment-division-content ]
[ "DATA" "DIVISION" ".data-division-content ]
procedure-division ]
nested-cobol-source-program }* "END" "PROGRAMprogram-name "."

Diagrams  Uses  Top  Help

program-id-nested-cobol-source-program = "PROGRAM-ID" [ "." ] program-name
[ [ "IS" ] ( "COMMON" [ "INITIAL" ] | "INITIAL" [ "COMMON" ] ) [ "PROGRAM" ] ] [ "." ]

Diagrams  Uses  Top  Help

identification-division-content = ( [ "AUTHOR" [ "." ] { comment-entry }* ]
|| [ "INSTALLATION" [ "." ] { comment-entry }* ]
|| [ "DATE-WRITTEN" [ "." ] { comment-entry }* ]
|| [ "DATE-COMPILED" [ "." ] { comment-entry }* ]
|| [ "SECURITY" [ "." ] { comment-entry }* ] )

Diagrams  Uses  Top  Help

environment-division-content = configuration-section ] [ input-output-section ]

Diagrams  Uses  Top  Help

configuration-section = "CONFIGURATION" "SECTION" ".configuration-section-paragraphs

Diagrams  Uses  Top  Help

configuration-section-paragraphs = source-computer-paragraph ] [ object-computer-paragraph ]
special-names-paragraph ]

Diagrams  Uses  Top  Help

source-computer-paragraph = "SOURCE-COMPUTER" "."
computer-name [ [ "WITH" ] "DEBUGGING" "MODE" ] "." ]

Diagrams  Uses  Top  Help

object-computer-paragraph = "OBJECT-COMPUTER" "."
computer-name [ "MEMORY" [ "SIZE" ] integer ( "WORDS" | "CHARACTERS" | "MODULES" ) ] object-computer-paragraph-sequence-phrase "." ]

Diagrams  Uses  Top  Help

object-computer-paragraph-sequence-phrase = [ [ "PROGRAM" ] [ "COLLATING" ] "SEQUENCE" [ "IS" ] alphabet-name ]
[ "SEGMENT-LIMIT" [ "IS" ] priority-number ]

Diagrams  Uses  Top  Help

special-names-paragraph = "SPECIAL-NAMES" "." { ( environment-name [ "IS" ] mnemonic-name | environment-name ( [ "IS" ] mnemonic-name [ special-names-paragraph-status-phrase ] | special-names-paragraph-status-phrase ) ) }*
special-names-paragraph-clauses [ "." ]

Diagrams  Uses  Top  Help

special-names-paragraph-clauses = ( { alphabet-clause }*
|| { symbolic-characters-clause }*
|| { class-clause }*
|| [ currency-sign-clause ]
|| [ decimal-point-clause ] )

Diagrams  Uses  Top  Help

alphabet-clause = "ALPHABETalphabet-name [ "IS" ] ( "STANDARD-1" | "STANDARD-2" | "NATIVE" | "EBCDIC" | { literal [ ( ( "THROUGH" | "THRU" ) literal | { "ALSOliteral }+ ) ] }+ )

Diagrams  Uses  Top  Help

symbolic-characters-clause = "SYMBOLIC" [ "CHARACTERS" ] { { symbolic-character }+ [ ( "ARE" | "IS" ) ] { integer }+ }+ [ "INalphabet-name ]

Diagrams  Uses  Top  Help

class-clause = "CLASSclass-name [ "IS" ] { literal [ ( "THROUGH" | "THRU" ) literal ] }+

Diagrams  Uses  Top  Help

currency-sign-clause = "CURRENCY" [ "SIGN" ] [ "IS" ] literal

Diagrams  Uses  Top  Help

decimal-point-clause = "DECIMAL-POINT" [ "IS" ] "COMMA"

Diagrams  Uses  Top  Help

special-names-paragraph-status-phrase = ( "ON" [ "STATUS" ] [ "IS" ] condition [ "OFF" [ "STATUS" ] [ "IS" ] condition ] | "OFF" [ "STATUS" ] [ "IS" ] condition [ "ON" [ "STATUS" ] [ "IS" ] condition ] )

Diagrams  Uses  Top  Help

input-output-section = "INPUT-OUTPUT" "SECTION" "." [ file-control-paragraph ]
i-o-control-paragraph ]

Diagrams  Uses  Top  Help

file-control-paragraph = "FILE-CONTROL" "."
file-control-entry }*

Diagrams  Uses  Top  Help

file-control-entry = select-clause assign-clause
( [ reserve-clause ]
|| [ [ "ORGANIZATION" [ "IS" ] ] "SEQUENTIAL" ]
|| [ padding-character-clause ]
|| [ record-delimiter-clause ]
|| [ "ACCESS" [ "MODE" ] [ "IS" ] "SEQUENTIAL" ]
|| [ password-clause ]
|| [ file-status-clause ] ) "."

file-control-entry = select-clause assign-clause
( [ reserve-clause ]
|| [ "ORGANIZATION" [ "IS" ] ] "RELATIVE"
|| [ "ACCESS" [ "MODE" ] [ "IS" ] ( "SEQUENTIAL" [ relative-key-clause ] | ( "RANDOM" | "DYNAMIC" ) relative-key-clause ) ]
|| [ password-clause ]
|| [ file-status-clause ] ) "."

file-control-entry = select-clause assign-clause
( [ reserve-clause ]
|| [ "ORGANIZATION" [ "IS" ] ] "INDEXED"
|| [ "ACCESS" [ "MODE" ] [ "IS" ] ( "SEQUENTIAL" | "RANDOM" | "DYNAMIC" ) ]
|| record-key-clause
|| [ password-clause ]
|| { alternate-record-key-clause }*
|| [ file-status-clause ] ) "."

Diagrams  Uses  Top  Help

select-clause = "SELECT" [ "OPTIONAL" ] file-name

Diagrams  Uses  Top  Help

assign-clause = "ASSIGN" [ "TO" ] { ( assignment-name | literal ) }+

Diagrams  Uses  Top  Help

reserve-clause = "RESERVEinteger [ ( "AREA" | "AREAS" ) ]

Diagrams  Uses  Top  Help

padding-character-clause = "PADDING" [ "CHARACTER" ] [ "IS" ] ( qualified-data-name | literal )

Diagrams  Uses  Top  Help

record-delimiter-clause = "RECORD" "DELIMITER" [ "IS" ] ( "STANDARD-1" | assignment-name )

Diagrams  Uses  Top  Help

record-key-clause = "RECORD" [ "KEY" ] [ "IS" ] qualified-data-name

Diagrams  Uses  Top  Help

alternate-record-key-clause = "ALTERNATE" [ "RECORD" ] [ "KEY" ] [ "IS" ] qualified-data-name
password-clause ] [ [ "WITH" ] "DUPLICATES" ]

Diagrams  Uses  Top  Help

relative-key-clause = "RELATIVE" [ "KEY" ] [ "IS" ] qualified-data-name

Diagrams  Uses  Top  Help

password-clause = "PASSWORD" [ "IS" ] data-name

Diagrams  Uses  Top  Help

file-status-clause = [ "FILE" ] "STATUS" [ "IS" ] qualified-data-name [ qualified-data-name ]

Diagrams  Uses  Top  Help

i-o-control-paragraph = "I-O-CONTROL" "." [ { ( qsam-or-sam-i-o-control-entries | vsam-i-o-control-entries ) }+ "." ]
sort-merge-i-o-control-entries "." ]

Diagrams  Uses  Top  Help

qsam-or-sam-i-o-control-entries = ( "RERUN" "ON" ( assignment-name | file-name ) [ "EVERY" ] ( integer "RECORDS" | "END" [ "OF" ] ( "REEL" | "UNIT" ) ) [ "OF" ] file-name | "SAME" [ "RECORD" ] [ "AREA" ] [ "FOR" ] file-name { file-name }+ | "MULTIPLE" "FILE" [ "TAPE" ] [ "CONTAINS" ] { file-name [ "POSITIONinteger ] }+ | "APPLY" "WRITE-ONLY" [ "ON" ] { file-name }+ )

Diagrams  Uses  Top  Help

vsam-i-o-control-entries = ( "RERUN" "ON" ( assignment-name | file-name ) [ "EVERY" ] integer "RECORDS" [ "OF" ] file-name | "SAME" [ "RECORD" ] [ "AREA" ] [ "FOR" ] file-name { file-name }+ )

Diagrams  Uses  Top  Help

sort-merge-i-o-control-entries = [ "RERUN" "ONassignment-name ]
{ "SAME" ( "RECORD" | "SORT" | "SORT-MERGE" ) [ "AREA" ] [ "FOR" ] file-name { file-name }+ }+

Diagrams  Uses  Top  Help

data-division-content = [ "FILE" "SECTION" "." { file-and-sort-description-entry { record-description-entry }+ }* ]
[ "WORKING-STORAGE" "SECTION" "." { ( record-description-entry | data-item-description-entry ) }* ]
[ "LINKAGE" "SECTION" "." { ( record-description-entry | data-item-description-entry ) }* ]

Diagrams  Uses  Top  Help

data-item-description-entry = data-description-entry

Diagrams  Uses  Top  Help

record-description-entry = data-description-entry

Diagrams  Uses  Top  Help

file-and-sort-description-entry = ( "FD" | "SD" ) file-name file-and-sort-description-entry-clauses "."

Diagrams  Uses  Top  Help

file-and-sort-description-entry-clauses = ( [ external-clause ]
|| [ global-clause ]
|| [ block-contains-clause ]
|| [ record-clause ]
|| [ label-records-clause ]
|| [ value-of-clause ]
|| [ data-records-clause ]
|| [ linage-clause ]
|| [ recording-mode-clause ]
|| [ code-set-clause ] )

Diagrams  Uses  Top  Help

external-clause = [ "IS" ] "EXTERNAL"

Diagrams  Uses  Top  Help

global-clause = [ "IS" ] "GLOBAL"

Diagrams  Uses  Top  Help

block-contains-clause = "BLOCK" [ "CONTAINS" ] [ ( integer | zero ) "TO" ] ( integer | zero ) [ ( "CHARACTERS" | "RECORDS" ) ]

Diagrams  Uses  Top  Help

record-clause = "RECORD"
( [ "CONTAINS" ] ( integer | zero ) [ "CHARACTERS" ]
| [ "CONTAINS" ] ( integer | zero ) "TO" ( integer | zero ) [ "CHARACTERS" ]
record-varying-phrase [ "DEPENDING" [ "ON" ] data-name ]
)

Diagrams  Uses  Top  Help

record-varying-phrase = [ "IS" ] "VARYING" [ "IN" ] [ "SIZE" ] [ [ "FROM" ] integer ] [ "TOinteger ] [ "CHARACTERS" ]

Diagrams  Uses  Top  Help

label-records-clause = "LABEL" ( "RECORD" [ "IS" ] | "RECORDS" [ "ARE" ] ) ( "STANDARD" | "OMITTED" | { data-name }+ )

Diagrams  Uses  Top  Help

value-of-clause = "VALUE" "OF" { system-name [ "IS" ] ( qualified-data-name | literal ) }+

Diagrams  Uses  Top  Help

data-records-clause = "DATA" ( "RECORD" [ "IS" ] | "RECORDS" [ "ARE" ] ) { data-name }+

Diagrams  Uses  Top  Help

linage-clause = "LINAGE" [ "IS" ] ( data-name | integer ) [ "LINES" ] linage-footing-phrase

Diagrams  Uses  Top  Help

linage-footing-phrase = [ [ "WITH" ] "FOOTING" [ "AT" ] ( data-name | integer ) ] [ [ "LINES" ] [ "AT" ] "TOP" ( data-name | integer ) ]
[ [ "LINES" ] [ "AT" ] "BOTTOM" ( data-name | integer ) ]

Diagrams  Uses  Top  Help

recording-mode-clause = "RECORDING" [ "MODE" ] [ "IS" ] mode

Diagrams  Uses  Top  Help

code-set-clause = "CODE-SET" [ "IS" ] alphabet-name

Diagrams  Uses  Top  Help

data-description-entry = level-number [ ( data-name | "FILLER" ) ] data-description-entry-clauses "."

data-description-entry = "66data-name renames-clause "."

data-description-entry = "88condition-name condition-value-clause "."

Diagrams  Uses  Top  Help

data-description-entry-clauses = ( [ redefines-clause ]
|| [ blank-when-zero-clause ]
|| [ external-clause ]
|| [ global-clause ]
|| [ justified-clause ]
|| [ occurs-clause ]
|| [ picture-clause ]
|| [ sign-clause ]
|| [ synchronized-clause ]
|| [ usage-clause ]
|| [ data-value-clause ] )

Diagrams  Uses  Top  Help

redefines-clause = "REDEFINESdata-name

Diagrams  Uses  Top  Help

blank-when-zero-clause = "BLANK" [ "WHEN" ] ( "ZERO" | "ZEROS" | "ZEROES" )

Diagrams  Uses  Top  Help

justified-clause = ( "JUSTIFIED" | "JUST" ) [ "RIGHT" ]

Diagrams  Uses  Top  Help

occurs-clause = "OCCURSinteger [ "TIMES" ]
{ ( "ASCENDING" | "DESCENDING" ) [ "KEY" ] [ "IS" ] { qualified-data-name }+ }*
[ "INDEXED" [ "BY" ] { index-name }+ ]

occurs-clause = "OCCURS" [ ( integer | zero ) "TO" ] integer [ "TIMES" ] "DEPENDING"
[ "ON" ] qualified-data-name
{ ( "ASCENDING" | "DESCENDING" ) [ "KEY" ] [ "IS" ] { qualified-data-name }+ }*
[ "INDEXED" [ "BY" ] { index-name }+ ]

Diagrams  Uses  Top  Help

picture-clause = ( "PICTURE" | "PIC" ) [ "IS" ] picture-string

Diagrams  Uses  Top  Help

sign-clause = [ "SIGN" [ "IS" ] ] ( "LEADING" | "TRAILING" ) [ "SEPARATE" [ "CHARACTER" ] ]

Diagrams  Uses  Top  Help

synchronized-clause = ( "SYNCHRONIZED" | "SYNC" ) [ ( "LEFT" | "RIGHT" ) ]

Diagrams  Uses  Top  Help

usage-clause = [ "USAGE" [ "IS" ] ] ( "BINARY" | "COMP" | "COMP-1" | "COMP-2" | "COMP-3" | "COMP-4" | "COMPUTATIONAL" | "COMPUTATIONAL-1" | "COMPUTATIONAL-2" | "COMPUTATIONAL-3" | "COMPUTATIONAL-4" | "DISPLAY" | "DISPLAY-1" | "INDEX" | "PACKED-DECIMAL" | "POINTER" )

Diagrams  Uses  Top  Help

condition-value-clause = ( "VALUE" [ "IS" ] | "VALUES" [ "ARE" ] ) { literal [ ( "THROUGH" | "THRU" ) literal ] }+

Diagrams  Uses  Top  Help

data-value-clause = "VALUE" [ "IS" ] literal

Diagrams  Uses  Top  Help

renames-clause = "RENAMESqualified-data-name [ ( "THROUGH" | "THRU" ) qualified-data-name ]

Diagrams  Uses  Top  Help

procedure-division = "PROCEDURE" "DIVISION" [ "USING" { data-name }+ ] "."
[ "DECLARATIVES" "." { section-header ".use-statement ".paragraphs }+ "END" "DECLARATIVES" "." ]
sections

procedure-division = "PROCEDURE" "DIVISION" [ "USING" { data-name }+ ] "."
paragraphs

Diagrams  Uses  Top  Help

sections = paragraphs { section-header ".paragraphs }*

Diagrams  Uses  Top  Help

section-header = section-name "SECTION" [ priority-number ]

Diagrams  Uses  Top  Help

paragraphs = sentence }* { paragraph }*

Diagrams  Uses  Top  Help

paragraph = paragraph-name "." { sentence }*

paragraph = altered-goto

Diagrams  Uses  Top  Help

sentence = statement-list "."

Diagrams  Uses  Top  Help

statement-list = statement }+

Diagrams  Uses  Top  Help

statement = accept-statement
add-statement
alter-statement
call-statement
cancel-statement
close-statement
compute-statement
continue-statement
delete-statement
display-statement
divide-statement
entry-statement
evaluate-statement
exit-statement
exit-program-statement
goback-statement
go-to-statement
if-statement
initialize-statement
inspect-statement
merge-statement
move-statement
multiply-statement
open-statement
perform-statement
read-statement
release-statement
return-statement
rewrite-statement
search-statement
set-statement
sort-statement
start-statement
stop-statement
string-statement
subtract-statement
unstring-statement
write-statement )

Diagrams  Uses  Top  Help

accept-statement = "ACCEPTidentifier [ "FROM" ( mnemonic-name | environment-name ) ]

accept-statement = "ACCEPTidentifier "FROM" ( "DATE" | "DAY" | "DAY-OF-WEEK" | "TIME" )

Diagrams  Uses  Top  Help

add-statement = "ADD" { ( identifier | literal ) }+ "TO" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-ADD" ]

add-statement = "ADD" { ( identifier | literal ) }+ [ "TO" ] ( identifier | literal )
"GIVING" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-ADD" ]

add-statement = "ADD" ( "CORRESPONDING" | "CORR" ) identifier "TOidentifier
[ "ROUNDED" ] [ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-ADD" ]

Diagrams  Uses  Top  Help

alter-statement = "ALTER"
procedure-name "TO" [ "PROCEED" "TO" ] procedure-name }+

Diagrams  Uses  Top  Help

call-statement = "CALL" ( identifier | literal )
[ "USING" { ( [ [ "BY" ] "REFERENCE" ] { ( identifier | "ADDRESS" "OFidentifier | file-name ) }+ | [ "BY" ] "CONTENT" { ( [ "LENGTH" "OF" ] identifier | "ADDRESS" "OFidentifier | literal ) }+ ) }+ ]
[ [ "ON" ] "OVERFLOWstatement-list ] [ "END-CALL" ]

call-statement = "CALL" ( identifier | literal )
[ "USING" { ( [ [ "BY" ] "REFERENCE" ] { ( identifier | "ADDRESS" "OFidentifier | file-name ) }+ | [ "BY" ] "CONTENT" { ( [ "LENGTH" "OF" ] identifier | "ADDRESS" "OFidentifier | literal ) }+ ) }+ ]
[ [ "ON" ] "EXCEPTIONstatement-list ]
[ "NOT" [ "ON" ] "EXCEPTIONstatement-list ] [ "END-CALL" ]

Diagrams  Uses  Top  Help

cancel-statement = "CANCEL" { ( identifier | literal ) }+

Diagrams  Uses  Top  Help

close-statement = "CLOSE"
file-name [ ( ( "REEL" | "UNIT" ) [ ( [ "FOR" ] "REMOVAL" | [ "WITH" ] "NO" "REWIND" ) ] | [ "WITH" ] ( "NO" "REWIND" | "LOCK" ) ) ] }+

close-statement = "CLOSE" { file-name [ [ "WITH" ] "LOCK" ] }+

Diagrams  Uses  Top  Help

compute-statement = "COMPUTE" { identifier [ "ROUNDED" ] }+ ( "=" | "EQUAL" )
arithmetic-expression
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-COMPUTE" ]

Diagrams  Uses  Top  Help

continue-statement = "CONTINUE"

Diagrams  Uses  Top  Help

delete-statement = "DELETEfile-name [ "RECORD" ]
[ "INVALID" [ "KEY" ] statement-list ]
[ "NOT" "INVALID" [ "KEY" ] statement-list ]
[ "END-DELETE" ]

Diagrams  Uses  Top  Help

display-statement = "DISPLAY" { ( identifier | literal ) }+
[ "UPON" ( mnemonic-name | environment-name ) ]
[ [ "WITH" ] "NO" "ADVANCING" ]

Diagrams  Uses  Top  Help

divide-statement = "DIVIDE" ( identifier | literal ) "INTO" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-DIVIDE" ]

divide-statement = "DIVIDE" ( identifier | literal ) "INTO" ( identifier | literal )
"GIVING" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-DIVIDE" ]

divide-statement = "DIVIDE" ( identifier | literal ) "BY" ( identifier | literal )
"GIVING" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-DIVIDE" ]

divide-statement = "DIVIDE" ( identifier | literal ) "INTO" ( identifier | literal )
"GIVINGidentifier [ "ROUNDED" ] "REMAINDERidentifier
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-DIVIDE" ]

divide-statement = "DIVIDE" ( identifier | literal ) "BY" ( identifier | literal )
"GIVINGidentifier [ "ROUNDED" ] "REMAINDERidentifier
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-DIVIDE" ]

Diagrams  Uses  Top  Help

entry-statement = "ENTRYliteral [ "USING" { data-name }+ ]

Diagrams  Uses  Top  Help

evaluate-statement = "EVALUATE" ( identifier | literal | arithmetic-expression | condition | "TRUE" | "FALSE" ) { "ALSO" ( identifier | literal | arithmetic-expression | condition | "TRUE" | "FALSE" ) }*
{ { "WHENevaluate-phrase { "ALSOevaluate-phrase }* }+ statement-list }+
[ "WHEN" "OTHERstatement-list ] [ "END-EVALUATE" ]

Diagrams  Uses  Top  Help

evaluate-phrase = ( "ANY" | condition | "TRUE" | "FALSE" | [ "NOT" ] ( identifier | literal | arithmetic-expression ) [ ( "THROUGH" | "THRU" ) ( identifier | literal | arithmetic-expression ) ] )

Diagrams  Uses  Top  Help

exit-statement = "EXIT"

Diagrams  Uses  Top  Help

exit-program-statement = "EXIT" "PROGRAM"

Diagrams  Uses  Top  Help

goback-statement = "GOBACK"

Diagrams  Uses  Top  Help

go-to-statement = "GO" [ "TO" ] procedure-name

go-to-statement = "GO" [ "TO" ] "MORE-LABELS"

go-to-statement = "GO" [ "TO" ] { procedure-name }+ "DEPENDING" [ "ON" ]
identifier

Diagrams  Uses  Top  Help

altered-goto = paragraph-name "." "GO" [ "TO" ] "."

Diagrams  Uses  Top  Help

if-statement = "IFcondition [ "THEN" ] ( { statement }+ | "NEXT" "SENTENCE" )
[ "ELSE" ( { statement }+ | "NEXT" "SENTENCE" ) ] [ "END-IF" ]

Diagrams  Uses  Top  Help

initialize-statement = "INITIALIZE" { identifier }+
[ "REPLACING" { ( "ALPHABETIC" | "ALPHANUMERIC" | "NUMERIC" | "ALPHANUMERIC-EDITED" | "NUMERIC-EDITED" | "DBCS" | "EGCS" ) [ "DATA" ] "BY" ( identifier | literal ) }+ ]

Diagrams  Uses  Top  Help

inspect-statement = "INSPECTidentifier "TALLYING"
identifier "FOR" { ( "CHARACTERS" { before-after-phrase }* | ( "ALL" | "LEADING" ) { ( identifier | literal ) { before-after-phrase }* }+ ) }+ }+

inspect-statement = "INSPECTidentifier "CONVERTING" ( identifier | literal ) "TO"
identifier | literal ) { before-after-phrase }*

inspect-statement = "INSPECTidentifier "TALLYING"
identifier "FOR" { ( "CHARACTERS" { before-after-phrase }* | ( "ALL" | "LEADING" ) { ( identifier | literal ) { before-after-phrase }* }+ ) }+ }+ "REPLACING"
{ ( "CHARACTERS" "BY" ( identifier | literal ) { before-after-phrase }* | ( "ALL" | "LEADING" | "FIRST" ) { ( identifier | literal ) "BY" ( identifier | literal ) { before-after-phrase }* }+ ) }+

inspect-statement = "INSPECTidentifier "REPLACING"
{ ( "CHARACTERS" "BY" ( identifier | literal ) { before-after-phrase }* | ( "ALL" | "LEADING" | "FIRST" ) { ( identifier | literal ) "BY" ( identifier | literal ) { before-after-phrase }* }+ ) }+

Diagrams  Uses  Top  Help

before-after-phrase = ( "BEFORE" | "AFTER" ) [ "INITIAL" ] ( identifier | literal )

Diagrams  Uses  Top  Help

merge-statement = "MERGEfile-name { [ "ON" ] ( "ASCENDING" | "DESCENDING" ) [ "KEY" ] { qualified-data-name }+ }+
[ [ "COLLATING" ] "SEQUENCE" [ "IS" ] alphabet-name ] "USINGfile-name { file-name }+
( "OUTPUT" "PROCEDURE" [ "IS" ] procedure-name [ ( "THROUGH" | "THRU" ) procedure-name ] | "GIVING" { file-name }+ )

Diagrams  Uses  Top  Help

move-statement = "MOVE" ( identifier | literal ) "TO" { identifier }+

move-statement = "MOVE" ( "CORRESPONDING" | "CORR" ) identifier "TO" { identifier }+

Diagrams  Uses  Top  Help

multiply-statement = "MULTIPLY" ( identifier | literal ) "BY" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-MULTIPLY" ]

multiply-statement = "MULTIPLY" ( identifier | literal ) "BY" ( identifier | literal )
"GIVING" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-MULTIPLY" ]

Diagrams  Uses  Top  Help

open-statement = "OPEN" { ( "INPUT" { file-name [ ( "REVERSED" | [ "WITH" ] "NO" "REWIND" ) ] }+ | "OUTPUT" { file-name [ [ "WITH" ] "NO" "REWIND" ] }+ | "I-O" { file-name }+ | "EXTEND" { file-name }+ ) }+

open-statement = "OPEN" { ( "INPUT" { file-name }+ | "OUTPUT" { file-name }+ | "I-O" { file-name }+ | "EXTEND" { file-name }+ ) }+

Diagrams  Uses  Top  Help

perform-statement = "PERFORM"
procedure-name [ ( "THROUGH" | "THRU" ) procedure-name ] | statement-list "END-PERFORM" )

perform-statement = "PERFORM" ( procedure-name [ ( "THROUGH" | "THRU" ) procedure-name ] perform-varying-phrase perform-after-phrase | perform-varying-phrase statement-list "END-PERFORM" )

perform-statement = "PERFORM" ( procedure-name [ ( "THROUGH" | "THRU" ) procedure-name ] ( identifier | integer ) "TIMES" | ( identifier | integer ) "TIMESstatement-list "END-PERFORM" )

perform-statement = "PERFORM"
procedure-name [ ( "THROUGH" | "THRU" ) procedure-name ] perform-until-phrase | perform-until-phrase statement-list "END-PERFORM" )

Diagrams  Uses  Top  Help

perform-until-phrase = [ [ "WITH" ] "TEST" ( "BEFORE" | "AFTER" ) ] "UNTILcondition

Diagrams  Uses  Top  Help

perform-varying-phrase = [ [ "WITH" ] "TEST" ( "BEFORE" | "AFTER" ) ] "VARYING" ( identifier | index-name ) "FROM" ( identifier | index-name | literal ) "BY" ( identifier | literal ) "UNTIL"
condition

Diagrams  Uses  Top  Help

perform-after-phrase = { "AFTER" ( identifier | index-name ) "FROM" ( identifier | index-name | literal ) "BY" ( identifier | literal ) "UNTILcondition }*

Diagrams  Uses  Top  Help

read-statement = "READfile-name [ "NEXT" ] [ "RECORD" ]
[ "INTOidentifier ]
[ [ "AT" ] "ENDstatement-list ]
[ "NOT" [ "AT" ] "ENDstatement-list ] [ "END-READ" ]

read-statement = "READfile-name [ "RECORD" ] [ "INTOidentifier ]
[ "KEY" [ "IS" ] qualified-data-name ]
[ "INVALID" [ "KEY" ] statement-list ]
[ "NOT" "INVALID" [ "KEY" ] statement-list ] [ "END-READ" ]

Diagrams  Uses  Top  Help

release-statement = "RELEASErecord-name [ "FROMidentifier ]

Diagrams  Uses  Top  Help

return-statement = "RETURNfile-name [ "RECORD" ] [ "INTOidentifier ]
[ "AT" ] "ENDstatement-list
[ "NOT" [ "AT" ] "ENDstatement-list ] [ "END-RETURN" ]

Diagrams  Uses  Top  Help

rewrite-statement = "REWRITErecord-name [ "FROMidentifier ]
[ "INVALID" [ "KEY" ] statement-list ]
[ "NOT" "INVALID" [ "KEY" ] statement-list ]
[ "END-REWRITE" ]

Diagrams  Uses  Top  Help

search-statement = "SEARCHidentifier [ "VARYING" ( identifier | index-name ) ]
[ [ "AT" ] "ENDstatement-list ]
{ "WHENcondition ( statement-list | "NEXT" "SENTENCE" ) }+
[ "END-SEARCH" ]

search-statement = "SEARCH" "ALLidentifier [ [ "AT" ] "ENDstatement-list ]
"WHEN" ( qualified-data-name [ "IS" ] ( "EQUAL" [ "TO" ] | "=" ) ( identifier | literal | arithmetic-expression ) | condition-name-reference )
{ "AND" ( qualified-data-name [ "IS" ] ( "EQUAL" [ "TO" ] | "=" ) ( identifier | literal | arithmetic-expression ) | condition-name-reference ) }*
statement-list | "NEXT" "SENTENCE" ) [ "END-SEARCH" ]

Diagrams  Uses  Top  Help

set-statement = "SET" { ( index-name | identifier ) }+ "TO" ( index-name | identifier | integer )

set-statement = "SET" { index-name }+ ( "UP" "BY" | "DOWN" "BY" ) ( identifier | integer )

set-statement = "SET" { { mnemonic-name }+ "TO" ( "ON" | "OFF" ) }+

set-statement = "SET" { condition-name-reference }+ "TO" "TRUE"

set-statement = "SET" { ( identifier | "ADDRESS" "OFidentifier ) }+
"TO" ( identifier | "ADDRESS" "OFidentifier | "NULL" | "NULLS" )

Diagrams  Uses  Top  Help

sort-statement = "SORTfile-name { [ "ON" ] ( "ASCENDING" | "DESCENDING" ) [ "KEY" ] { qualified-data-name }+ }+
[ [ "WITH" ] "DUPLICATES" [ "IN" ] [ "ORDER" ] ]
[ [ "COLLATING" ] "SEQUENCE" [ "IS" ] alphabet-name ]
( "USING" { file-name }+ | "INPUT" "PROCEDURE" [ "IS" ] procedure-name [ ( "THROUGH" | "THRU" ) procedure-name ] )
( "GIVING" { file-name }+ | "OUTPUT" "PROCEDURE" [ "IS" ] procedure-name [ ( "THROUGH" | "THRU" ) procedure-name ] )

Diagrams  Uses  Top  Help

start-statement = "STARTfile-name
[ "KEY" [ "IS" ] ( "EQUAL" [ "TO" ] | "=" | "GREATER" [ "THAN" ] | ">" | "NOT" "LESS" [ "THAN" ] | "NOT" "<" | "GREATER" [ "THAN" ] "OR" "EQUAL" [ "TO" ] | ">=" ) qualified-data-name ]
[ "INVALID" [ "KEY" ] statement-list ]
[ "NOT" "INVALID" [ "KEY" ] statement-list ] [ "END-START" ]

Diagrams  Uses  Top  Help

stop-statement = "STOP" ( "RUN" | literal )

Diagrams  Uses  Top  Help

string-statement = "STRING"
{ { ( identifier | literal ) }+ "DELIMITED" [ "BY" ] ( identifier | literal | "SIZE" ) }+
"INTOidentifier [ [ "WITH" ] "POINTERidentifier ]
[ [ "ON" ] "OVERFLOWstatement-list ]
[ "NOT" [ "ON" ] "OVERFLOWstatement-list ]
[ "END-STRING" ]

Diagrams  Uses  Top  Help

subtract-statement = "SUBTRACT" { ( identifier | literal ) }+ "FROM"
identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-SUBTRACT" ]

subtract-statement = "SUBTRACT" { ( identifier | literal ) }+ "FROM" ( identifier | literal )
"GIVING" { identifier [ "ROUNDED" ] }+
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-SUBTRACT" ]

subtract-statement = "SUBTRACT" ( "CORRESPONDING" | "CORR" ) identifier "FROM"
identifier [ "ROUNDED" ]
[ [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "NOT" [ "ON" ] "SIZE" "ERRORstatement-list ]
[ "END-SUBTRACT" ]

Diagrams  Uses  Top  Help

unstring-statement = "UNSTRINGidentifier
[ "DELIMITED" [ "BY" ] [ "ALL" ] ( identifier | literal ) { "OR" [ "ALL" ] ( identifier | literal ) }* ] "INTO"
identifier [ "DELIMITER" [ "IN" ] identifier ] [ "COUNT" [ "IN" ] identifier ] }+
[ [ "WITH" ] "POINTERidentifier ] [ "TALLYING" [ "IN" ] identifier ]
[ [ "ON" ] "OVERFLOWstatement-list ] [ "NOT" [ "ON" ] "OVERFLOWstatement-list ]
[ "END-UNSTRING" ]

Diagrams  Uses  Top  Help

write-statement = "WRITErecord-name [ "FROMidentifier ]
( [ ( "BEFORE" | "AFTER" ) [ "ADVANCING" ] ( ( identifier | integer ) [ ( "LINE" | "LINES" ) ] | mnemonic-name | "PAGE" ) ] write-statement-phrase | [ "INVALID" [ "KEY" ] statement-list ] [ "NOT" "INVALID" [ "KEY" ] statement-list ] ) [ "END-WRITE" ]

write-statement = "WRITErecord-name [ "FROMidentifier ]
[ "INVALID" [ "KEY" ] statement-list ]
[ "NOT" "INVALID" [ "KEY" ] statement-list ]
[ "END-WRITE" ]

write-statement = "WRITErecord-name [ "FROMidentifier ] [ "END-WRITE" ]

Diagrams  Uses  Top  Help

write-statement-phrase = [ [ "AT" ] ( "END-OF-PAGE" | "EOP" ) statement-list ] [ "NOT" [ "AT" ] ( "END-OF-PAGE" | "EOP" ) statement-list ]

Diagrams  Uses  Top  Help

compiler-directing-statement = basis-statement
cbl-process-statement
control-cbl-statement
copy-statement
delete-compiler-directing-statement
eject-statement
enter-statement
insert-statement
ready-or-reset-trace-statement
replace-statement
replace-statement
service-label-statement
service-reload-statement
| skip1-2-3-statement
title-statement
use-statement )

Diagrams  Uses  Top  Help

basis-statement = sequence-number ] "BASIS" ( basis-name | literal )

Diagrams  Uses  Top  Help

cbl-process-statement = ( "CBL" | "PROCESS" ) [ options-list ]

Diagrams  Uses  Top  Help

control-cbl-statement = ( "*CONTROL" | "*CBL" ) { ( "SOURCE" | "NOSOURCE" | "LIST" | "NOLIST" | "MAP" | "NOMAP" ) }+ [ "." ]

Diagrams  Uses  Top  Help

copy-statement = "COPY" ( text-name | literal ) [ ( "OF" | "IN" ) ( library-name | literal ) ]
[ "SUPPRESS" ]
[ "REPLACING" { copy-operand "BYcopy-operand }+ ] "."

Diagrams  Uses  Top  Help

delete-compiler-directing-statement = sequence-number ] "DELETEsequence-number-field

Diagrams  Uses  Top  Help

eject-statement = "EJECT" [ "." ]

Diagrams  Uses  Top  Help

enter-statement = "ENTERlanguage-name [ routine-name ] "."

Diagrams  Uses  Top  Help

insert-statement = sequence-number ] "INSERTsequence-number-field

Diagrams  Uses  Top  Help

ready-or-reset-trace-statement = ( "READY" | "RESET" ) "TRACE" "."

Diagrams  Uses  Top  Help

replace-statement = "REPLACE" { quoted-pseudo-text "BYquoted-pseudo-text }+ "."

replace-statement = "REPLACE" "OFF" "."

Diagrams  Uses  Top  Help

service-label-statement = "SERVICE" "LABEL"

Diagrams  Uses  Top  Help

service-reload-statement = "SERVICE" "RELOADidentifier

Diagrams  Uses  Top  Help

skip-statement = ( "SKIP1" | "SKIP2" | "SKIP3" ) [ "." ]

Diagrams  Uses  Top  Help

title-statement = "TITLEliteral [ "." ]

Diagrams  Uses  Top  Help

use-statement = "USE" [ "GLOBAL" ] "AFTER" [ "STANDARD" ] ( "EXCEPTION" | "ERROR" ) "PROCEDURE"
[ "ON" ] ( { file-name }+ | "INPUT" | "OUTPUT" | "I-O" | "EXTEND" )

use-statement = "USE" [ "GLOBAL" ] "AFTER" [ "STANDARD" ] [ ( "BEGINNING" | "ENDING" ) ]
[ ( "FILE" | "REEL" | "UNIT" ) ] "LABEL" "PROCEDURE" [ "ON" ] ( { file-name }+ | "INPUT" | "OUTPUT" | "I-O" | "EXTEND" )

use-statement = "USE" [ "FOR" ] "DEGUGGING" [ "ON" ] ( { procedure-name }+ | "ALL" "PROCEDURES" )

Diagrams  Uses  Top  Help

condition = combinable-condition
combined-conditions )

Diagrams  Uses  Top  Help

combinable-condition = simple-condition
negated-simple-conditions
abbreviated-combined-relation-conditions )

Diagrams  Uses  Top  Help

simple-condition = class-condition
condition-name-condition
relation-condition
sign-condition
switch-status-condition
| "(condition ")" )

Diagrams  Uses  Top  Help

class-condition = identifier [ "IS" ] [ "NOT" ] ( "NUMERIC" | "ALPHABETIC" | "ALPHABETIC-LOWER" | "ALPHABETIC-UPPER" | class-name | "DBCS" | "KANJI" )

Diagrams  Uses  Top  Help

condition-name-condition = condition-name-reference

Diagrams  Uses  Top  Help

relation-condition = arithmetic-expression relational-operator
arithmetic-expression

Diagrams  Uses  Top  Help

relational-operator = [ "IS" ]
( [ "NOT" ] ( "GREATER" [ "THAN" ] | ">" | "LESS" [ "THAN" ] | "<" | "EQUAL" [ "TO" ] | "=" )
| "GREATER" [ "THAN" ] "OR" "EQUAL" [ "TO" ]
| ">="
| "LESS" [ "THAN" ] "OR" "EQUAL" [ "TO" ]
| "<" "=" )

Diagrams  Uses  Top  Help

sign-condition = arithmetic-expression [ "IS" ] [ "NOT" ] ( "POSITIVE" | "NEGATIVE" | "ZERO" )

Diagrams  Uses  Top  Help

switch-status-condition = condition-name-reference

Diagrams  Uses  Top  Help

negated-simple-conditions = "NOTcondition

Diagrams  Uses  Top  Help

abbreviated-combined-relation-conditions = relation-condition
abbreviation-rest

abbreviated-combined-relation-conditions = arithmetic-expression relational-operator
"(" [ "NOT" ] arithmetic-expression abbreviation-rest ")"

abbreviated-combined-relation-conditions = arithmetic-expression "(" [ "NOT" ] relational-operator arithmetic-expression abbreviation-rest ")"

Diagrams  Uses  Top  Help

abbreviation-rest = { ( "AND" | "OR" ) [ "NOT" ] [ relational-operator ] abbreviation-leaf }+

Diagrams  Uses  Top  Help

abbreviation-leaf = arithmetic-expression | "(arithmetic-expression abbreviation-rest ")" )

Diagrams  Uses  Top  Help

combined-conditions = combinable-condition { ( "AND" | "OR" ) combinable-condition }+

Diagrams  Uses  Top  Help

procedure-name = paragraph-name [ ( "IN" | "OF" ) section-name ]

procedure-name = section-name

Diagrams  Uses  Top  Help

identifier = qualified-data-name { "(subscript ")" }*
[ "(leftmost-character-position ":" [ length ] ")" ]

identifier = "LINAGE-COUNTER" [ ( "IN" | "OF" ) file-name ]

Diagrams  Uses  Top  Help

qualified-data-name = data-name { ( "IN" | "OF" ) data-name }* [ ( "IN" | "OF" ) file-name ]

qualified-data-name = special-register

Diagrams  Uses  Top  Help

length = arithmetic-expression

Diagrams  Uses  Top  Help

leftmost-character-position = arithmetic-expression

Diagrams  Uses  Top  Help

condition-name-reference = condition-name { ( "IN" | "OF" ) data-name }*
[ ( "IN" | "OF" ) file-name ] { "(subscript ")" }*

condition-name-reference = condition-name { ( "IN" | "OF" ) mnemonic-name }*

Diagrams  Uses  Top  Help

subscript = { ( integer | qualified-data-name [ ( "+" | "-" ) integer ] | index-name [ ( "+" | "-" ) integer ] ) }+

Diagrams  Uses  Top  Help

arithmetic-expression = times-div { ( "+" | "-" ) times-div }*

Diagrams  Uses  Top  Help

times-div = power { ( "*" | "/" ) power }*

Diagrams  Uses  Top  Help

power = [ ( "+" | "-" ) ] basis { "**basis }*

Diagrams  Uses  Top  Help

basis = identifier | literal | "(arithmetic-expression ")" )

Diagrams  Uses  Top  Help

copy-operand = quoted-pseudo-text | identifier | literal | cobol-word )

Diagrams  Uses  Top  Help

mode = ( "F" | "V" | "U" | "S" )

Diagrams  Uses  Top  Help

alphabet-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

class-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

condition-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

data-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

file-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

index-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

mnemonic-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

record-name = qualified-data-name

Diagrams  Uses  Top  Help

routine-name = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

symbolic-character = alphabetic-user-defined-word

Diagrams  Uses  Top  Help

library-name = user-defined-word

Diagrams  Uses  Top  Help

program-name = user-defined-word

Diagrams  Uses  Top  Help

text-name = user-defined-word

Diagrams  Uses  Top  Help

paragraph-name = user-defined-word

Diagrams  Uses  Top  Help

section-name = user-defined-word

Diagrams  Uses  Top  Help

computer-name = system-name

Diagrams  Uses  Top  Help

language-name = system-name

Diagrams  Uses  Top  Help

environment-name = system-name

Diagrams  Uses  Top  Help

assignment-name = system-name

Diagrams  Uses  Top  Help

basis-name = program-name

Diagrams  Uses  Top  Help

figurative-constant = ( "ZERO" | "ZEROS" | "ZEROES"
| "SPACE" | "SPACES"
| "HIGH-VALUE" | "HIGH-VALUES"
| "LOW-VALUE" | "LOW-VALUES"
| "QUOTE" | "QUOTES"
| "ALLliteral
| "NULL" | "NULLS" )

Diagrams  Uses  Top  Help

literal = nonnumeric | numeric | dbcs | figurative-constant )

Diagrams  Uses  Top  Help

special-register = ( "ADDRESS" "OFdata-name
| "DEBUG-ITEM"
| "LENGTH" "OFidentifier
| "RETURN-CODE"
| "SHIFT-OUT"
| "SHIFT-IN"
| "SORT-CONTROL"
| "SORT-CORE-SIZE"
| "SORT-FILE-SIZE"
| "SORT-MESSAGE"
| "SORT-MODE-SIZE"
| "SORT-RETURN"
| "TALLY"
| "WHEN-COMPILED" )

Diagrams  Uses  Top  Help


Lexical syntax

Disclaimer

The following lexical definition serves as a tendentious description of the terminals in the context-free syntax. It has been derived manually from IBM's VS COBOL II Application Programming Language Reference (Document Number: GC26-4047-07). Note that this lexical definition is not claimed to reflect the actual scanner we use to test the grammar. Note also that preprocessing issues (e.g., continuation lines and copy book expansion) are not addressed by this definition. This lexical definition is written using some standard notation for regular expressions in the spirit of the LEX notation. Details of the notation are explained elsewhere.

/*
 Some kinds of user-defined words are required to contain at least one
 alphabetic. A corresponding class of character-strings is defined below.
*/

alphabetic-user-defined-word = ([0-9]+ [\-]*)* [0-9]* [A-Za-z] [A-Za-z0-9]* ([\-]+ [A-Za-z0-9]+)*

Uses  Top  Help

/*
 From the reference:
;  A COBOL word is a character-string of not more than 30 characters which
;  forms a user-defined word, a system-name, or a reserved word.  Except for
;  arithmetic operators and relation characters, each character of a COBOL
;  word is selected from the set of letters, digits, and the hyphen; the
;  hyphen cannot appear as the first or last character in such words.  Each
;  lowercase letter is considered to be equivalent to its corresponding
;  uppercase letter.
 We do not enforce the constraint on the maximum length of COBOL words.
*/

cobol-word = [A-Za-z0-9]+ ([\-]+ [A-Za-z0-9]+)*

Uses  Top  Help

/*
 From the reference:
;  A comment is a character-string that can contain any combination of
;  characters from the character set of the computer.
 We do not provide a lexical definition because we prefer to regard the
 problem of recognizing comment entries as a preprocessing issue.
*/

comment-entry = ...

Uses  Top  Help

/*
 DBCS literals are not specified in this version.
*/

dbcs = ...

Uses  Top  Help

/*
 From the reference:
;  In this manual, the word integer appearing in a format represents a
;  numeric literal of nonzero value that contains no sign and no decimal
;  point; any other restrictions are included with the description of the
;  format.
 It is actually questionable, if we should forbid nonzero values at the
 lexical level. Moreover, for some uses of integer, zero is actually allowed
 in contrast to the above rule.
*/

integer = [0]* [1-9] [0-9]*

Uses  Top  Help

/*
 From the reference:
;  Level-numbers: 01-49,66,77,88.
;  Each word must be a 1-digit or 2-digit integer.
*/

level-number = 

 ( [0]? [1-9]

 | [1-4] [0-9]

 | "66"

 | "77"

 | "88" )

Uses  Top  Help

/*
 From the reference:
;  A nonnumeric literal is a character-string enclosed in quotation marks 
;  ("), and can contain any allowable character from the character set of the 
;  computer.  The maximum length of a nonnumeric literal is 160 characters. 

;  The enclosing quotation marks are excluded from the literal when the 
;  program is compiled.  An embedded quotation mark must be represented by a 
;  pair of quotation marks ("").  For example,      "THIS ISN""T WRONG" 

;x A nonnumeric literal can be enclosed in apostrophes (').  If the APOST 
;x option is specified, these apostrophes are excluded from the literal when 
;x the program is compiled.  An embedded apostrophe must be represented by a 
;x pair of apostrophes ('').  For example,     'THIS ISN''T WRONG'  

 ...

;x Hexadecimal notation can be used for nonnumeric literals.  This 
;x hexadecimal notation has the following format: 

;x  ___ Hexadecimal Notation Format for Nonnumeric Literals ________________  
;  |                                                                        | 
;x | X"hexadecimal_digits"                                                  | 
;  |                                                                        | 
;  |________________________________________________________________________| 

;x X" 
;x     The opening delimiter for hexadecimal notation of a nonnumeric literal 
;x     (If the compiler option APOST is specified, the opening delimiter is 
;x     X'.) 

;x " 
;x     The closing delimiter for the hexadecimal notation of a nonnumeric 
;x     literal.  (If the compiler option APOST is specified, the closing 
;x     delimiter is '.) 

 Nonnumeric literals with double-byte characters are not supported in this
 version of this lexical definition.
*/

nonnumeric = 

 ( [\"] (~[\"] | [\"] [\"])* [\"]

 | [\'] (~[\'] | [\'] [\'])* [\']

 | [Xx] [\"] hexdigits [\"]

 | [Xx] [\'] hexdigits [\'] )

auxiliaries

 begin

  hexdigits = [0-9A-Fa-f]+

 end

Uses  Top  Help

/*
 From the reference:
;  A numeric literal is a character-string whose characters are selected from 
;  the digits 0 through 9, a sign character (+ or -), and the decimal point. 
;  If the literal contains no decimal point, it is an integer.  (In this 
;  manual, the word integer appearing in a format represents a numeric 
;  literal of nonzero value that contains no sign and no decimal point; any 
;  other restrictions are included with the description of the format.)  The 
;  following rules apply: 

;  o   One through 18 digits are allowed. 

;  o   Only one sign character is allowed.  If included, it must be the 
;      leftmost character of the literal.  If the literal is unsigned, it is 
;      positive in value. 

;  o   Only one decimal point is allowed.  If a decimal point is included, it 
;      is treated as an assumed decimal point (that is, as not taking up a 
;      character position in the literal).  The decimal point can appear 
;      anywhere within the literal except as the rightmost character.

 We do not enforce the constraint on the length of numeric literals in the
 definition below. We omit a definition of floating-point literal values
 available as an IBM extension.
*/

numeric = [\+\-]? ([0-9]* [\.] [0-9]+ | [0-9]+)

Uses  Top  Help

/*
 options-list is meant to model compiler options for the CBL (PROCESS)
 Statement. We consider this compiler directing statement as a preprocessing
 problem. Thus, we omit a definition.
*/

options-list = ...

Uses  Top  Help

/*
 From the reference:
;  A PICTURE character-string is composed of the currency symbol and certain 
;  combinations of characters in the COBOL character set.  PICTURE 
;  character-strings are delimited only by the separator space, separator 
;  comma, separator semicolon, or separator period. 

;  Any punctuation character that appears as part of the specification of a 
;  PICTURE character-string is not considered as a punctuation character, but 
;  rather as a symbol used in the specification of that PICTURE 
;  character-string.
 There are various rules on the order and the valid combination of
 characters. We do not enforce these constraints in the following
 simplified definition. The definition of picture character-strings is
 definitely subject to improvement.
*/

picture-string = currency? (piccharrepeat?)+ (punctuation (piccharrepeat?)+)*

auxiliaries

 begin

  currency = ~[0-9ABCDPRSVXZa-z\*\+\-\/\,\.\;\(\)\=\'\"\ \n]

  picchar = 

   ( [ABEGPSVXZabegpsvxz90\+\-\*\$]

   | "CR"

   | "DB" )

  repeat = "(" [0-9]+ ")"

  punctuation = [\/\,\.\:]

 end

Uses  Top  Help

/*
 From the reference:
   Priority-numbers:  00-99
   Each word must be a 1-digit or 2-digit integer.
*/

priority-number = [0-9] [0-9]

Uses  Top  Help

/*
 From the reference:
;  pseudo-text 
;      A sequence of character-strings and/or separators bounded by, but not 
;      including, pseudo-text-1 delimiters (==).  Both characters of each 
;      pseudo-text-1 delimiter must appear on one line; however, 
;      character-strings within pseudo-text-1 can be continued.
*/

quoted-pseudo-text = "==" ~[\=]* "=="

Uses  Top  Help

/*
 Sequence numbers are needed for compiler-directing statements.
 These preprocessing issues are not addressed in the version.
*/

sequence-number = ...

Uses  Top  Help

/*
 See sequence-number.
*/

sequence-number-field = ...

Uses  Top  Help

/*
 From the reference:
 
;  A system-name is a character string that is defined by IBM to have a 
;  specific meaning to the system.  There are three types of system-names: 

;| o   computer-name 
;| o   language-name 
;| o   implementor-name. 

;  There are two types of implementor-names: 

;| o   environment-name 
;| o   assignment-name. 

 If we abstract from the problem to reject reserved words as user-defined
 words, user-defined words are COBOL words.
*/

system-name = cobol-word

Uses  Top  Help

/*
 From the reference:

;| Within a source program the following rules apply for all COBOL words: 

;| o   A reserved word cannot be used as a user-defined word or as a 
;|     system-name. 

;| o   The same COBOL word, however, can be used as both a user-defined word 
;|     and as a system-name.  The classification of a specific occurrence of 
;|     a COBOL word is determined by the context of the clause or phrase in 
;|     which it occurs. 

 If we abstract from the problem to reject reserved words as user-defined
 words, user-defined words are COBOL words. 
*/

user-defined-word = cobol-word

Uses  Top  Help

/*
 The class zero were introduced by us in the context of correcting the
 uses of the sort integer. The reference constrains integer to be a nonzero
 value, whereas some use sites allow zero. We relaxed those use sites from
 integer to (integer|zero). Now we have to define the trivial class zero.
*/

zero = [0]+

Uses  Top  Help


All sorts

In the table below all the sorts of the grammar are listed in alphabetical order. For each sort all the use sites are listed. There are sorts without any use site --- the so-called top sorts. The navigation bar below allows you to go directly to those sorts starting with a certain letter. There are no sorts starting with h, k, x and y.

[a] [b] [c] [d] [e] [f] [g] h [i] [j] k [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] x y [z] 

abbreviated-combined-relation-conditions combinable-condition
abbreviation-leaf abbreviation-rest
abbreviation-rest
accept-statement statement
add-statement statement
alphabet-clause special-names-paragraph-clauses
alphabet-name
alphabetic-user-defined-word
alter-statement statement
altered-goto paragraph
alternate-record-key-clause file-control-entry
arithmetic-expression
assign-clause file-control-entry
assignment-name
basis power
basis-name basis-statement
basis-statement compiler-directing-statement
before-after-phrase inspect-statement
blank-when-zero-clause data-description-entry-clauses
block-contains-clause file-and-sort-description-entry-clauses
call-statement statement
cancel-statement statement
cbl-process-statement compiler-directing-statement
class-clause special-names-paragraph-clauses
class-condition simple-condition
class-name
close-statement statement
cobol-source-program -
cobol-word copy-operand
code-set-clause file-and-sort-description-entry-clauses
combinable-condition
combined-conditions condition
comment-entry identification-division-content
compiler-directing-statement -
compute-statement statement
computer-name
condition
condition-name
condition-name-condition simple-condition
condition-name-reference
condition-value-clause data-description-entry
configuration-section environment-division-content
configuration-section-paragraphs configuration-section
continue-statement statement
control-cbl-statement compiler-directing-statement
copy-operand copy-statement
copy-statement compiler-directing-statement
currency-sign-clause special-names-paragraph-clauses
data-description-entry
data-description-entry-clauses data-description-entry
data-division-content
data-item-description-entry data-division-content
data-name
data-records-clause file-and-sort-description-entry-clauses
data-value-clause data-description-entry-clauses
dbcs literal
decimal-point-clause special-names-paragraph-clauses
delete-compiler-directing-statement compiler-directing-statement
delete-statement statement
display-statement statement
divide-statement statement
eject-statement compiler-directing-statement
enter-statement compiler-directing-statement
entry-statement statement
environment-division-content
environment-name
evaluate-phrase evaluate-statement
evaluate-statement statement
exit-program-statement statement
exit-statement statement
external-clause
figurative-constant literal
file-and-sort-description-entry data-division-content
file-and-sort-description-entry-clauses file-and-sort-description-entry
file-control-entry file-control-paragraph
file-control-paragraph input-output-section
file-name
file-status-clause file-control-entry
global-clause
go-to-statement statement
goback-statement statement
i-o-control-paragraph input-output-section
identification-division-content
identifier
if-statement statement
index-name
initialize-statement statement
input-output-section environment-division-content
insert-statement compiler-directing-statement
inspect-statement statement
integer
justified-clause data-description-entry-clauses
label-records-clause file-and-sort-description-entry-clauses
language-name enter-statement
leftmost-character-position identifier
length identifier
level-number data-description-entry
library-name copy-statement
linage-clause file-and-sort-description-entry-clauses
linage-footing-phrase linage-clause
literal
merge-statement statement
mnemonic-name
mode recording-mode-clause
move-statement statement
multiply-statement statement
negated-simple-conditions combinable-condition
nested-cobol-source-program
nonnumeric literal
numeric literal
object-computer-paragraph configuration-section-paragraphs
object-computer-paragraph-sequence-phrase object-computer-paragraph
occurs-clause data-description-entry-clauses
open-statement statement
options-list cbl-process-statement
padding-character-clause file-control-entry
paragraph paragraphs
paragraph-name
paragraphs
password-clause
perform-after-phrase perform-statement
perform-statement statement
perform-until-phrase perform-statement
perform-varying-phrase perform-statement
picture-clause data-description-entry-clauses
picture-string picture-clause
power times-div
priority-number
procedure-division
procedure-name
program-id-cobol-source-program cobol-source-program
program-id-nested-cobol-source-program nested-cobol-source-program
program-name
qsam-or-sam-i-o-control-entries i-o-control-paragraph
qualified-data-name
quoted-pseudo-text
read-statement statement
ready-or-reset-trace-statement compiler-directing-statement
record-clause file-and-sort-description-entry-clauses
record-delimiter-clause file-control-entry
record-description-entry data-division-content
record-key-clause file-control-entry
record-name
record-varying-phrase record-clause
recording-mode-clause file-and-sort-description-entry-clauses
redefines-clause data-description-entry-clauses
relation-condition
relational-operator
relative-key-clause file-control-entry
release-statement statement
renames-clause data-description-entry
replace-statement compiler-directing-statement
reserve-clause file-control-entry
return-statement statement
rewrite-statement statement
routine-name enter-statement
search-statement statement
section-header
section-name
sections procedure-division
select-clause file-control-entry
sentence
sequence-number
sequence-number-field
service-label-statement compiler-directing-statement
service-reload-statement compiler-directing-statement
set-statement statement
sign-clause data-description-entry-clauses
sign-condition simple-condition
simple-condition combinable-condition
skip-statement -
skip1-2-3-statement compiler-directing-statement
sort-merge-i-o-control-entries i-o-control-paragraph
sort-statement statement
source-computer-paragraph configuration-section-paragraphs
special-names-paragraph configuration-section-paragraphs
special-names-paragraph-clauses special-names-paragraph
special-names-paragraph-status-phrase special-names-paragraph
special-register qualified-data-name
start-statement statement
statement
statement-list
stop-statement statement
string-statement statement
subscript
subtract-statement statement
switch-status-condition simple-condition
symbolic-character symbolic-characters-clause
symbolic-characters-clause special-names-paragraph-clauses
synchronized-clause data-description-entry-clauses
system-name
text-name copy-statement
times-div arithmetic-expression
title-statement compiler-directing-statement
unstring-statement statement
usage-clause data-description-entry-clauses
use-statement
user-defined-word
value-of-clause file-and-sort-description-entry-clauses
vsam-i-o-control-entries i-o-control-paragraph
write-statement statement
write-statement-phrase write-statement
zero


Top sorts

There are two top sorts. cobol-source-program is the actual start symbol of the grammar, whereas compiler-directing-statement is the top rule for compiler directing statement such as the COPY statement. The latter top sort is not eliminated because we assume that compiler directing statements are handled during preprocessing anyway and there is no sensible way to connect compiler directing statements with the actual context-free syntax of COBOL programs. Details of the terminology used (top sorts, bottom sorts etc.) are explained elsewhere.


Bottom sorts

There are no bottom sorts because we eliminated them in a process of completing and correcting. We eliminated all bottom sorts by connecting used and defined sorts, by providing context-free or lexical productions. Details of the terminology used (top sorts, bottom sorts etc.) are explained elsewhere.

skip1-2-3-statement compiler-directing-statement


Keywords

In the table below all the keywords used in the grammar are listed in alphabetical order. For each keyword all the use sites are listed. Note that most but not all keywords are reserved words in the sense of COBOL. The navigation bar below allows you to go directly to those keywords starting with a certain letter. There are no keywords starting with X and Y. Tokens which do not start with a letter are listed at the beginning of the table.

[A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] X Y [Z] 

a b c d e f g h i j k l m n o p q r s t u v w x y z 

(
)
* times-div
** power
*CBL control-cbl-statement
*CONTROL control-cbl-statement
+
-
.
/ times-div
66 data-description-entry
88 data-description-entry
: identifier
<
=
>
>=
ACCEPT accept-statement
ACCESS file-control-entry
ADD add-statement
ADDRESS
ADVANCING
AFTER
ALL
ALPHABET alphabet-clause
ALPHABETIC
ALPHABETIC-LOWER class-condition
ALPHABETIC-UPPER class-condition
ALPHANUMERIC initialize-statement
ALPHANUMERIC-EDITED initialize-statement
ALSO
ALTER alter-statement
ALTERNATE alternate-record-key-clause
AND
ANY evaluate-phrase
APPLY qsam-or-sam-i-o-control-entries
ARE
AREA
AREAS reserve-clause
ASCENDING
ASSIGN assign-clause
AT
AUTHOR identification-division-content
BASIS basis-statement
BEFORE
BEGINNING use-statement
BINARY usage-clause
BLANK blank-when-zero-clause
BLOCK block-contains-clause
BOTTOM linage-footing-phrase
BY
CALL call-statement
CANCEL cancel-statement
CBL cbl-process-statement
CHARACTER
CHARACTERS
CLASS class-clause
CLOSE close-statement
CODE-SET code-set-clause
COLLATING
COMMA decimal-point-clause
COMMON program-id-nested-cobol-source-program
COMP usage-clause
COMP-1 usage-clause
COMP-2 usage-clause
COMP-3 usage-clause
COMP-4 usage-clause
COMPUTATIONAL usage-clause
COMPUTATIONAL-1 usage-clause
COMPUTATIONAL-2 usage-clause
COMPUTATIONAL-3 usage-clause
COMPUTATIONAL-4 usage-clause
COMPUTE compute-statement
CONFIGURATION configuration-section
CONTAINS
CONTENT call-statement
CONTINUE continue-statement
CONVERTING inspect-statement
COPY copy-statement
CORR
CORRESPONDING
COUNT unstring-statement
CURRENCY currency-sign-clause
DATA
DATE accept-statement
DATE-COMPILED identification-division-content
DATE-WRITTEN identification-division-content
DAY accept-statement
DAY-OF-WEEK accept-statement
DBCS
DEBUG-ITEM special-register
DEBUGGING source-computer-paragraph
DECIMAL-POINT decimal-point-clause
DECLARATIVES procedure-division
DEGUGGING use-statement
DELETE
DELIMITED
DELIMITER
DEPENDING
DESCENDING
DISPLAY
DISPLAY-1 usage-clause
DIVIDE divide-statement
DIVISION
DOWN set-statement
DUPLICATES
DYNAMIC file-control-entry
EBCDIC alphabet-clause
EGCS initialize-statement
EJECT eject-statement
ELSE if-statement
END
END-ADD add-statement
END-CALL call-statement
END-COMPUTE compute-statement
END-DELETE delete-statement
END-DIVIDE divide-statement
END-EVALUATE evaluate-statement
END-IF if-statement
END-MULTIPLY multiply-statement
END-OF-PAGE write-statement-phrase
END-PERFORM perform-statement
END-READ read-statement
END-RETURN return-statement
END-REWRITE rewrite-statement
END-SEARCH search-statement
END-START start-statement
END-STRING string-statement
END-SUBTRACT subtract-statement
END-UNSTRING unstring-statement
END-WRITE write-statement
ENDING use-statement
ENTER enter-statement
ENTRY entry-statement
ENVIRONMENT
EOP write-statement-phrase
EQUAL
ERROR
EVALUATE evaluate-statement
EVERY
EXCEPTION
EXIT
EXTEND
EXTERNAL external-clause
F mode
FALSE
FD file-and-sort-description-entry
FILE
FILE-CONTROL file-control-paragraph
FILLER data-description-entry
FIRST inspect-statement
FOOTING linage-footing-phrase
FOR
FROM
GIVING
GLOBAL
GO
GOBACK goback-statement
GREATER
HIGH-VALUE figurative-constant
HIGH-VALUES figurative-constant
I-O
I-O-CONTROL i-o-control-paragraph
ID
IDENTIFICATION
IF if-statement
IN
INDEX usage-clause
INDEXED
INITIAL
INITIALIZE initialize-statement
INPUT
INPUT-OUTPUT input-output-section
INSERT insert-statement
INSPECT inspect-statement
INSTALLATION identification-division-content
INTO
INVALID
IS
JUST justified-clause
JUSTIFIED justified-clause
KANJI class-condition
KEY
LABEL
LEADING
LEFT synchronized-clause
LENGTH
LESS
LINAGE linage-clause
LINAGE-COUNTER identifier
LINE write-statement
LINES
LINKAGE data-division-content
LIST control-cbl-statement
LOCK close-statement
LOW-VALUE figurative-constant
LOW-VALUES figurative-constant
MAP control-cbl-statement
MEMORY object-computer-paragraph
MERGE merge-statement
MODE
MODULES object-computer-paragraph
MORE-LABELS go-to-statement
MOVE move-statement
MULTIPLE qsam-or-sam-i-o-control-entries
MULTIPLY multiply-statement
NATIVE alphabet-clause
NEGATIVE sign-condition
NEXT
NO
NOLIST control-cbl-statement
NOMAP control-cbl-statement
NOSOURCE control-cbl-statement
NOT
NULL
NULLS
NUMERIC
NUMERIC-EDITED initialize-statement
OBJECT-COMPUTER object-computer-paragraph
OCCURS occurs-clause
OF
OFF
OMITTED label-records-clause
ON
OPEN open-statement
OPTIONAL select-clause
OR
ORDER sort-statement
ORGANIZATION file-control-entry
OTHER evaluate-statement
OUTPUT
OVERFLOW
PACKED-DECIMAL usage-clause
PADDING padding-character-clause
PAGE write-statement
PASSWORD password-clause
PERFORM perform-statement
PIC picture-clause
PICTURE picture-clause
POINTER
POSITION qsam-or-sam-i-o-control-entries
POSITIVE sign-condition
PROCEDURE
PROCEDURES use-statement
PROCEED alter-statement
PROCESS cbl-process-statement
PROGRAM
PROGRAM-ID
QUOTE figurative-constant
QUOTES figurative-constant
RANDOM file-control-entry
READ read-statement
READY ready-or-reset-trace-statement
RECORD
RECORDING recording-mode-clause
RECORDS
REDEFINES redefines-clause
REEL
REFERENCE call-statement
RELATIVE
RELEASE release-statement
RELOAD service-reload-statement
REMAINDER divide-statement
REMOVAL close-statement
RENAMES renames-clause
REPLACE replace-statement
REPLACING
RERUN
RESERVE reserve-clause
RESET ready-or-reset-trace-statement
RETURN return-statement
RETURN-CODE special-register
REVERSED open-statement
REWIND
REWRITE rewrite-statement
RIGHT
ROUNDED
RUN stop-statement
S mode
SAME
SD file-and-sort-description-entry
SEARCH search-statement
SECTION
SECURITY identification-division-content
SEGMENT-LIMIT object-computer-paragraph-sequence-phrase
SELECT select-clause
SENTENCE
SEPARATE sign-clause
SEQUENCE
SEQUENTIAL file-control-entry
SERVICE
SET set-statement
SHIFT-IN special-register
SHIFT-OUT special-register
SIGN
SIZE
SKIP1 skip-statement
SKIP2 skip-statement
SKIP3 skip-statement
SORT
SORT-CONTROL special-register
SORT-CORE-SIZE special-register
SORT-FILE-SIZE special-register
SORT-MERGE sort-merge-i-o-control-entries
SORT-MESSAGE special-register
SORT-MODE-SIZE special-register
SORT-RETURN special-register
SOURCE control-cbl-statement
SOURCE-COMPUTER source-computer-paragraph
SPACE figurative-constant
SPACES figurative-constant
SPECIAL-NAMES special-names-paragraph
STANDARD
STANDARD-1
STANDARD-2 alphabet-clause
START start-statement
STATUS
STOP stop-statement
STRING string-statement
SUBTRACT subtract-statement
SUPPRESS copy-statement
SYMBOLIC symbolic-characters-clause
SYNC synchronized-clause
SYNCHRONIZED synchronized-clause
TALLY special-register
TALLYING
TAPE qsam-or-sam-i-o-control-entries
TEST
THAN
THEN if-statement
THROUGH
THRU
TIME accept-statement
TIMES
TITLE title-statement
TO
TOP linage-footing-phrase
TRACE ready-or-reset-trace-statement
TRAILING sign-clause
TRUE
U mode
UNIT
UNSTRING unstring-statement
UNTIL
UP set-statement
UPON display-statement
USAGE usage-clause
USE use-statement
USING
V mode
VALUE
VALUES condition-value-clause
VARYING
WHEN
WHEN-COMPILED special-register
WITH
WORDS object-computer-paragraph
WORKING-STORAGE data-division-content
WRITE write-statement
WRITE-ONLY qsam-or-sam-i-o-control-entries
ZERO
ZEROES
ZEROS


Diagrams

The diagrams below visualize the context-free syntax using a variant of syntax diagrams. Details of this notation are explained elsewhere. We just want to point out that there is a special notation for permutation phrases in order to express that order is immaterial. Therefore, phrases are stacked using vertical lines based on double bars ("||"). All sorts in the diagrams are linked to the corresponding definitions, whereas the section headers (i.e., the sorts defined by the actual diagrams) are linked to the table of all sorts which is useful to navigate to the use sites of a sort.


cobol-source-program

 _____________________________________________________________________________________ 
|                                                                                     |
| >>_____IDENTIFICATION_____DIVISION__.__program-id-cobol-source-program____________> |
|     |__ID______________|                                                            |
| >_________________________________________________________________________________> |
|     |__identification-division-content__|                                           |
| >_________________________________________________________________________________> |
|     |__ENVIRONMENT__DIVISION__.__environment-division-content__|                    |
| >_________________________________________________________________________________> |
|     |__DATA__DIVISION__.__data-division-content__|                                  |
| >_________________________________________________________________________________> |
|     |__procedure-division__|                                                        |
| >________________________________________________________________________________>< |
|     |__________________________________________END__PROGRAM__program-name__.__|     |
|        |  <______________________________   |                                       |
|        |____nested-cobol-source-program__|__|                                       |
|_____________________________________________________________________________________|

EBNF    Uses    Top    Help

program-id-cobol-source-program

 _________________________________________________________ 
|                                                         |
| >>__PROGRAM-ID___________program-name_________________> |
|                 |__.__|                                 |
| >____________________________________________________>< |
|     |____________INITIAL_________________|  |__.__|     |
|        |__IS__|           |__PROGRAM__|                 |
|_________________________________________________________|

EBNF    Uses    Top    Help

nested-cobol-source-program

 ___________________________________________________________________________________ 
|                                                                                   |
| >>_____IDENTIFICATION_____DIVISION__.__program-id-nested-cobol-source-program___> |
|     |__ID______________|                                                          |
| >_______________________________________________________________________________> |
|     |__identification-division-content__|                                         |
| >_______________________________________________________________________________> |
|     |__ENVIRONMENT__DIVISION__.__environment-division-content__|                  |
| >_______________________________________________________________________________> |
|     |__DATA__DIVISION__.__data-division-content__|                                |
| >_______________________________________________________________________________> |
|     |__procedure-division__|                                                      |
| >___________________________________________END__PROGRAM__program-name__.______>< |
|     |  <______________________________   |                                        |
|     |____nested-cobol-source-program__|__|                                        |
|___________________________________________________________________________________|

EBNF    Uses    Top    Help

program-id-nested-cobol-source-program

 _____________________________________________________________________________ 
|                                                                             |
| >>__PROGRAM-ID___________program-name_____________________________________> |
|                 |__.__|                                                     |
| >________________________________________________________________________>< |
|     |_______________COMMON___________________________________|  |__.__|     |
|        |__IS__|  |          |__INITIAL__|  |  |__PROGRAM__|                 |
|                  |__INITIAL________________|                                |
|                              |__COMMON__|                                   |
|_____________________________________________________________________________|

EBNF    Uses    Top    Help

identification-division-content

 ________________________________________________________________________ 
|                                                                        |
| >>__________________________________________________________________>< |
|     ||  |__AUTHOR_____________________________________|         ||     |
|     ||             |__.__|  |  <________________   |            ||     |
|     ||                      |____comment-entry__|__|            ||     |
|     ||__________________________________________________________||     |
|     ||  |__INSTALLATION_____________________________________|   ||     |
|     ||                   |__.__|  |  <________________   |      ||     |
|     ||                            |____comment-entry__|__|      ||     |
|     ||__________________________________________________________||     |
|     ||  |__DATE-WRITTEN_____________________________________|   ||     |
|     ||                   |__.__|  |  <________________   |      ||     |
|     ||                            |____comment-entry__|__|      ||     |
|     ||__________________________________________________________||     |
|     ||  |__DATE-COMPILED_____________________________________|  ||     |
|     ||                    |__.__|  |  <________________   |     ||     |
|     ||                             |____comment-entry__|__|     ||     |
|     ||__________________________________________________________||     |
|         |__SECURITY_____________________________________|              |
|                      |__.__|  |  <________________   |                 |
|                               |____comment-entry__|__|                 |
|________________________________________________________________________|

EBNF    Uses    Top    Help

environment-division-content

 _________________________________________________________________ 
|                                                                 |
| >>___________________________________________________________>< |
|     |__configuration-section__|  |__input-output-section__|     |
|_________________________________________________________________|

EBNF    Uses    Top    Help

configuration-section

 _____________________________________________________________________ 
|                                                                     |
| >>__CONFIGURATION__SECTION__.__configuration-section-paragraphs__>< |
|_____________________________________________________________________|

EBNF    Uses    Top    Help

configuration-section-paragraphs

 __________________________________________________________________________ 
|                                                                          |
| >>_____________________________________________________________________> |
|     |__source-computer-paragraph__|  |__object-computer-paragraph__|     |
| >_____________________________________________________________________>< |
|     |__special-names-paragraph__|                                        |
|__________________________________________________________________________|

EBNF    Uses    Top    Help

source-computer-paragraph

 ___________________________________________________________________ 
|                                                                   |
| >>__SOURCE-COMPUTER__.__________________________________________> |
| >______________________________________________________________>< |
|     |__computer-name_____________________________________.__|     |
|                       |______________DEBUGGING__MODE__|           |
|                          |__WITH__|                               |
|___________________________________________________________________|

EBNF    Uses    Top    Help

object-computer-paragraph

 ________________________________________________________________________________________________________________________________ 
|                                                                                                                                |
| >>__OBJECT-COMPUTER__._______________________________________________________________________________________________________> |
| >___________________________________________________________________________________________________________________________>< |
|     |__computer-name_______________________________________________________object-computer-paragraph-sequence-phrase__.__|     |
|                       |__MEMORY______________integer_____WORDS__________|                                                      |
|                                  |__SIZE__|           |__CHARACTERS__|                                                         |
|                                                       |__MODULES_____|                                                         |
|________________________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

object-computer-paragraph-sequence-phrase

 _________________________________________________________________________________ 
|                                                                                 |
| >>____________________________________________________________________________> |
|     |__________________________________SEQUENCE____________alphabet-name__|     |
|        |__PROGRAM__|  |__COLLATING__|            |__IS__|                       |
| >____________________________________________________________________________>< |
|     |__SEGMENT-LIMIT____________priority-number__|                              |
|                       |__IS__|                                                  |
|_________________________________________________________________________________|

EBNF    Uses    Top    Help

special-names-paragraph

 _________________________________________________________________________________________________________________________________________ 
|                                                                                                                                         |
| >>__SPECIAL-NAMES__.__________________________________________________________________________________________________________________> |
|                       |  <_____________________________________________________________________________________________________   |     |
|                       |_______environment-name____________mnemonic-name________________________________________________________|__|     |
|                            |                    |__IS__|                                                                    |           |
|                            |__environment-name_______________mnemonic-name__________________________________________________|           |
|                                                 |  |__IS__|                 |__special-names-paragraph-status-phrase__|  |              |
|                                                 |__special-names-paragraph-status-phrase_________________________________|              |
| >___special-names-paragraph-clauses__________________________________________________________________________________________________>< |
|                                      |__.__|                                                                                            |
|_________________________________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

special-names-paragraph-clauses

 _______________________________________________________ 
|                                                       |
| >>_________________________________________________>< |
|     ||  |  <__________________   |             ||     |
|     ||  |____alphabet-clause__|__|             ||     |
|     ||_________________________________________||     |
|     ||  |  <_____________________________   |  ||     |
|     ||  |____symbolic-characters-clause__|__|  ||     |
|     ||_________________________________________||     |
|     ||  |  <_______________   |                ||     |
|     ||  |____class-clause__|__|                ||     |
|     ||_________________________________________||     |
|     ||  |__currency-sign-clause__|             ||     |
|     ||_________________________________________||     |
|         |__decimal-point-clause__|                    |
|_______________________________________________________|

EBNF    Uses    Top    Help

alphabet-clause

 ___________________________________________________________________________________________________ 
|                                                                                                   |
| >>__ALPHABET__alphabet-name_______________STANDARD-1___________________________________________>< |
|                              |__IS__|  |__STANDARD-2________________________________________|     |
|                                        |__NATIVE____________________________________________|     |
|                                        |__EBCDIC____________________________________________|     |
|                                        |  <______________________________________________   |     |
|                                        |____literal______________________________________|__|     |
|                                                      |________THROUGH_____literal_____|           |
|                                                         |  |__THRU_____|           |              |
|                                                         |  <________________       |              |
|                                                         |____ALSO__literal__|______|              |
|___________________________________________________________________________________________________|

EBNF    Uses    Top    Help

symbolic-characters-clause

 __________________________________________________________________________________________________________________________ 
|                                                                                                                          |
|                                 <_________________________________________________________                               |
|                                   <_____________________                    <__________   |                              |
| >>__SYMBOLIC________________________symbolic-character__|_____________________integer__|__|___________________________>< |
|               |__CHARACTERS__|                             |_____ARE_____|                   |__IN__alphabet-name__|     |
|                                                               |__IS___|                                                  |
|__________________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

class-clause

 _________________________________________________________________________________ 
|                                                                                 |
|                                  <________________________________________      |
| >>__CLASS__class-name______________literal________________________________|__>< |
|                        |__IS__|             |_____THROUGH_____literal__|        |
|                                                |__THRU_____|                    |
|_________________________________________________________________________________|

EBNF    Uses    Top    Help

currency-sign-clause

 _________________________________________________ 
|                                                 |
| >>__CURRENCY________________________literal__>< |
|               |__SIGN__|  |__IS__|              |
|_________________________________________________|

EBNF    Uses    Top    Help

decimal-point-clause

 ________________________________________ 
|                                        |
| >>__DECIMAL-POINT____________COMMA__>< |
|                    |__IS__|            |
|________________________________________|

EBNF    Uses    Top    Help

special-names-paragraph-status-phrase

 ___________________________________________________________________________________________________ 
|                                                                                                   |
| >>_____ON__________________________condition___________________________________________________>< |
|     |      |__STATUS__|  |__IS__|             |__OFF__________________________condition__|  |     |
|     |                                                 |__STATUS__|  |__IS__|                |     |
|     |__OFF__________________________condition_______________________________________________|     |
|             |__STATUS__|  |__IS__|             |__ON__________________________condition__|        |
|                                                       |__STATUS__|  |__IS__|                      |
|___________________________________________________________________________________________________|

EBNF    Uses    Top    Help

input-output-section

 ________________________________________________________________ 
|                                                                |
| >>__INPUT-OUTPUT__SECTION__._________________________________> |
|                               |__file-control-paragraph__|     |
| >___________________________________________________________>< |
|     |__i-o-control-paragraph__|                                |
|________________________________________________________________|

EBNF    Uses    Top    Help

file-control-paragraph

 _______________________________________ 
|                                       |
| >>__FILE-CONTROL__._________________> |
| >__________________________________>< |
|     |  <_____________________   |     |
|     |____file-control-entry__|__|     |
|_______________________________________|

EBNF    Uses    Top    Help

file-control-entry

 ___________________________________________________________________ 
|                                                                   |
| >>__select-clause__assign-clause________________________________> |
| >___________________________________________________________.__>< |
|     ||  |__reserve-clause__|                            ||        |
|     ||__________________________________________________||        |
|     ||  |________________________________SEQUENTIAL__|  ||        |
|     ||     |__ORGANIZATION____________|                 ||        |
|     ||                      |__IS__|                    ||        |
|     ||__________________________________________________||        |
|     ||  |__padding-character-clause__|                  ||        |
|     ||__________________________________________________||        |
|     ||  |__record-delimiter-clause__|                   ||        |
|     ||__________________________________________________||        |
|     ||  |__ACCESS________________________SEQUENTIAL__|  ||        |
|     ||             |__MODE__|  |__IS__|                 ||        |
|     ||__________________________________________________||        |
|     ||  |__password-clause__|                           ||        |
|     ||__________________________________________________||        |
|         |__file-status-clause__|                                  |
|___________________________________________________________________|

 ____________________________________________________________________________________________________ 
|                                                                                                    |
| >>__select-clause__assign-clause_________________________________________________________________> |
| >____________________________________________________________________________________________.__>< |
|     ||  |__reserve-clause__|                                                             ||        |
|     ||________________________________RELATIVE___________________________________________||        |
|     ||  |__ORGANIZATION____________|                                                     ||        |
|     ||                   |__IS__|                                                        ||        |
|     ||___________________________________________________________________________________||        |
|     ||  |__ACCESS___________________________SEQUENTIAL________________________________|  ||        |
|     ||             |__MODE__|  |__IS__|  |              |__relative-key-clause__|  |     ||        |
|     ||                                   |_____RANDOM______relative-key-clause_____|     ||        |
|     ||                                      |__DYNAMIC__|                                ||        |
|     ||___________________________________________________________________________________||        |
|     ||  |__password-clause__|                                                            ||        |
|     ||___________________________________________________________________________________||        |
|         |__file-status-clause__|                                                                   |
|____________________________________________________________________________________________________|

 _________________________________________________________________________ 
|                                                                         |
| >>__select-clause__assign-clause______________________________________> |
| >_________________________________________________________________.__>< |
|     ||  |__reserve-clause__|                                  ||        |
|     ||________________________________INDEXED_________________||        |
|     ||  |__ORGANIZATION____________|                          ||        |
|     ||                   |__IS__|                             ||        |
|     ||________________________________________________________||        |
|     ||  |__ACCESS___________________________SEQUENTIAL_____|  ||        |
|     ||             |__MODE__|  |__IS__|  |__RANDOM______|     ||        |
|     ||                                   |__DYNAMIC_____|     ||        |
|     ||__record-key-clause_____________________________________||        |
|     ||________________________________________________________||        |
|     ||  |__password-clause__|                                 ||        |
|     ||________________________________________________________||        |
|     ||  |  <______________________________   |                ||        |
|     ||  |____alternate-record-key-clause__|__|                ||        |
|     ||________________________________________________________||        |
|         |__file-status-clause__|                                        |
|_________________________________________________________________________|

EBNF    Uses    Top    Help

select-clause

 ___________________________________________ 
|                                           |
| >>__SELECT__________________file-name__>< |
|             |__OPTIONAL__|                |
|___________________________________________|

EBNF    Uses    Top    Help

assign-clause

 ______________________________________________________ 
|                                                      |
|                       <________________________      |
| >>__ASSIGN_________________assignment-name_____|__>< |
|             |__TO__|    |__literal__________|        |
|______________________________________________________|

EBNF    Uses    Top    Help

reserve-clause

 _____________________________________________ 
|                                             |
| >>__RESERVE__integer_____________________>< |
|                       |_____AREA______|     |
|                          |__AREAS__|        |
|_____________________________________________|

EBNF    Uses    Top    Help

padding-character-clause

 _______________________________________________________________________ 
|                                                                       |
| >>__PADDING________________________________qualified-data-name_____>< |
|              |__CHARACTER__|  |__IS__|  |__literal______________|     |
|_______________________________________________________________________|

EBNF    Uses    Top    Help

record-delimiter-clause

 ____________________________________________________________ 
|                                                            |
| >>__RECORD__DELIMITER_______________STANDARD-1__________>< |
|                        |__IS__|  |__assignment-name__|     |
|____________________________________________________________|

EBNF    Uses    Top    Help

record-key-clause

 __________________________________________________________ 
|                                                          |
| >>__RECORD_______________________qualified-data-name__>< |
|             |__KEY__|  |__IS__|                          |
|__________________________________________________________|

EBNF    Uses    Top    Help

alternate-record-key-clause

 ___________________________________________________________________________ 
|                                                                           |
| >>__ALTERNATE_____________________________________qualified-data-name___> |
|                |__RECORD__|  |__KEY__|  |__IS__|                          |
| >______________________________________________________________________>< |
|     |__password-clause__|  |______________DUPLICATES__|                   |
|                               |__WITH__|                                  |
|___________________________________________________________________________|

EBNF    Uses    Top    Help

relative-key-clause

 ____________________________________________________________ 
|                                                            |
| >>__RELATIVE_______________________qualified-data-name__>< |
|               |__KEY__|  |__IS__|                          |
|____________________________________________________________|

EBNF    Uses    Top    Help

password-clause

 _______________________________________ 
|                                       |
| >>__PASSWORD____________data-name__>< |
|               |__IS__|                |
|_______________________________________|

EBNF    Uses    Top    Help

file-status-clause

 ______________________________________________________________________________________ 
|                                                                                      |
| >>______________STATUS____________qualified-data-name_____________________________>< |
|     |__FILE__|          |__IS__|                       |__qualified-data-name__|     |
|______________________________________________________________________________________|

EBNF    Uses    Top    Help

i-o-control-paragraph

 _____________________________________________________________________________ 
|                                                                             |
| >>__I-O-CONTROL__.________________________________________________________> |
|                     |  <________________________________________      |     |
|                     |_______qsam-or-sam-i-o-control-entries_____|__.__|     |
|                          |__vsam-i-o-control-entries_________|              |
| >________________________________________________________________________>< |
|     |__sort-merge-i-o-control-entries__.__|                                 |
|_____________________________________________________________________________|

EBNF    Uses    Top    Help

qsam-or-sam-i-o-control-entries

 ___________________________________________________________________________________________________________________ 
|                                                                                                                   |
| >>_____RERUN__ON_____assignment-name_____________________integer__RECORDS________________________file-name_____>< |
|     |             |__file-name________|  |__EVERY__|  |__END_______________REEL_____|  |__OF__|             |     |
|     |                                                         |__OF__|  |__UNIT__|                          |     |
|     |                                                        <____________                                  |     |
|     |__SAME_______________________________________file-name____file-name__|_________________________________|     |
|     |        |__RECORD__|  |__AREA__|  |__FOR__|                                                            |     |
|     |                                              <_____________________________________                   |     |
|     |__MULTIPLE__FILE________________________________file-name___________________________|__________________|     |
|     |                  |__TAPE__|  |__CONTAINS__|               |__POSITION__integer__|                     |     |
|     |                               <____________                                                           |     |
|     |__APPLY__WRITE-ONLY______________file-name__|__________________________________________________________|     |
|                           |__ON__|                                                                                |
|___________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

vsam-i-o-control-entries

 ____________________________________________________________________________________________________ 
|                                                                                                    |
| >>_____RERUN__ON_____assignment-name__________________integer__RECORDS____________file-name_____>< |
|     |             |__file-name________|  |__EVERY__|                    |__OF__|             |     |
|     |                                                        <____________                   |     |
|     |__SAME_______________________________________file-name____file-name__|__________________|     |
|              |__RECORD__|  |__AREA__|  |__FOR__|                                                   |
|____________________________________________________________________________________________________|

EBNF    Uses    Top    Help

sort-merge-i-o-control-entries

 _______________________________________________________________________________________ 
|                                                                                       |
| >>__________________________________________________________________________________> |
|     |__RERUN__ON__assignment-name__|                                                  |
|     <___________________________________________________________________________      |
|                                                                 <____________   |     |
| >_____SAME_____RECORD________________________________file-name____file-name__|__|__>< |
|             |__SORT________|  |__AREA__|  |__FOR__|                                   |
|             |__SORT-MERGE__|                                                          |
|_______________________________________________________________________________________|

EBNF    Uses    Top    Help

data-division-content

 ___________________________________________________________________________________________________________ 
|                                                                                                           |
| >>______________________________________________________________________________________________________> |
|     |__FILE__SECTION__._____________________________________________________________________________|     |
|                          |  <_________________________________________________________________   |        |
|                          |                                     <___________________________   |  |        |
|                          |____file-and-sort-description-entry____record-description-entry__|__|__|        |
| >_______________________________________________________________________________________________________> |
|     |__WORKING-STORAGE__SECTION__.________________________________________________|                       |
|                                     |  <____________________________________   |                          |
|                                     |_______record-description-entry________|__|                          |
|                                          |__data-item-description-entry__|                                |
| >______________________________________________________________________________________________________>< |
|     |__LINKAGE__SECTION__.________________________________________________|                               |
|                             |  <____________________________________   |                                  |
|                             |_______record-description-entry________|__|                                  |
|                                  |__data-item-description-entry__|                                        |
|___________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

data-item-description-entry

 ________________________________ 
|                                |
| >>__data-description-entry__>< |
|________________________________|

EBNF    Uses    Top    Help

record-description-entry

 ________________________________ 
|                                |
| >>__data-description-entry__>< |
|________________________________|

EBNF    Uses    Top    Help

file-and-sort-description-entry

 _________________________________________________________________________ 
|                                                                         |
| >>_____FD_____file-name__file-and-sort-description-entry-clauses__.__>< |
|     |__SD__|                                                            |
|_________________________________________________________________________|

EBNF    Uses    Top    Help

file-and-sort-description-entry-clauses

 _____________________________________________ 
|                                             |
| >>_______________________________________>< |
|     ||  |__external-clause__|        ||     |
|     ||_______________________________||     |
|     ||  |__global-clause__|          ||     |
|     ||_______________________________||     |
|     ||  |__block-contains-clause__|  ||     |
|     ||_______________________________||     |
|     ||  |__record-clause__|          ||     |
|     ||_______________________________||     |
|     ||  |__label-records-clause__|   ||     |
|     ||_______________________________||     |
|     ||  |__value-of-clause__|        ||     |
|     ||_______________________________||     |
|     ||  |__data-records-clause__|    ||     |
|     ||_______________________________||     |
|     ||  |__linage-clause__|          ||     |
|     ||_______________________________||     |
|     ||  |__recording-mode-clause__|  ||     |
|     ||_______________________________||     |
|         |__code-set-clause__|               |
|_____________________________________________|

EBNF    Uses    Top    Help

external-clause

 ____________________________ 
|                            |
| >>____________EXTERNAL__>< |
|     |__IS__|               |
|____________________________|

EBNF    Uses    Top    Help

global-clause

 __________________________ 
|                          |
| >>____________GLOBAL__>< |
|     |__IS__|             |
|__________________________|

EBNF    Uses    Top    Help

block-contains-clause

 _______________________________________________________________________________________________ 
|                                                                                               |
| >>__BLOCK______________________________________________integer_____________________________>< |
|            |__CONTAINS__|  |_____integer_____TO__|  |__zero_____|  |_____CHARACTERS_____|     |
|                               |__zero_____|                           |__RECORDS_____|        |
|_______________________________________________________________________________________________|

EBNF    Uses    Top    Help

record-clause

 ____________________________________________________________________________________ 
|                                                                                    |
| >>__RECORD_______________________________________________________________________> |
| >_________________________integer_______________________________________________>< |
|     |  |__CONTAINS__|  |__zero_____|  |__CHARACTERS__|                       |     |
|     |_____________________integer_____TO_____integer_________________________|     |
|     |  |__CONTAINS__|  |__zero_____|      |__zero_____|  |__CHARACTERS__|    |     |
|     |__record-varying-phrase_________________________________________________|     |
|                               |__DEPENDING____________data-name__|                 |
|                                             |__ON__|                               |
|____________________________________________________________________________________|

EBNF    Uses    Top    Help

record-varying-phrase

 _________________________________________________________________________________________________________________ 
|                                                                                                                 |
| >>____________VARYING________________________________________________________________________________________>< |
|     |__IS__|           |__IN__|  |__SIZE__|  |______________integer__|  |__TO__integer__|  |__CHARACTERS__|     |
|                                                 |__FROM__|                                                      |
|_________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

label-records-clause

 _______________________________________________________________ 
|                                                               |
| >>__LABEL_____RECORD____________________STANDARD___________>< |
|            |          |__IS__|    |  |__OMITTED_________|     |
|            |__RECORDS_____________|  |  <____________   |     |
|                        |__ARE__|     |____data-name__|__|     |
|_______________________________________________________________|

EBNF    Uses    Top    Help

value-of-clause

 __________________________________________________________________________ 
|                                                                          |
|                <___________________________________________________      |
| >>__VALUE__OF____system-name_______________qualified-data-name_____|__>< |
|                               |__IS__|  |__literal______________|        |
|__________________________________________________________________________|

EBNF    Uses    Top    Help

data-records-clause

 ________________________________________________________ 
|                                                        |
|                                     <____________      |
| >>__DATA_____RECORD___________________data-name__|__>< |
|           |          |__IS__|    |                     |
|           |__RECORDS_____________|                     |
|                       |__ARE__|                        |
|________________________________________________________|

EBNF    Uses    Top    Help

linage-clause

 _______________________________________________________________________________ 
|                                                                               |
| >>__LINAGE_______________data-name__________________linage-footing-phrase__>< |
|             |__IS__|  |__integer____|  |__LINES__|                            |
|_______________________________________________________________________________|

EBNF    Uses    Top    Help

linage-footing-phrase

 _________________________________________________________________________________________________________________ 
|                                                                                                                 |
| >>____________________________________________________________________________________________________________> |
|     |______________FOOTING_______________data-name_____|  |_________________________TOP_____data-name_____|     |
|        |__WITH__|           |__AT__|  |__integer____|        |__LINES__|  |__AT__|       |__integer____|        |
| >____________________________________________________________________________________________________________>< |
|     |_________________________BOTTOM_____data-name_____|                                                        |
|        |__LINES__|  |__AT__|          |__integer____|                                                           |
|_________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

recording-mode-clause

 _______________________________________________ 
|                                               |
| >>__RECORDING________________________mode__>< |
|                |__MODE__|  |__IS__|           |
|_______________________________________________|

EBNF    Uses    Top    Help

code-set-clause

 ___________________________________________ 
|                                           |
| >>__CODE-SET____________alphabet-name__>< |
|               |__IS__|                    |
|___________________________________________|

EBNF    Uses    Top    Help

data-description-entry

 ________________________________________________________________________________ 
|                                                                                |
| >>__level-number_________________________data-description-entry-clauses__.__>< |
|                   |_____data-name_____|                                        |
|                      |__FILLER_____|                                           |
|________________________________________________________________________________|

 __________________________________________ 
|                                          |
| >>__66__data-name__renames-clause__.__>< |
|__________________________________________|

 _______________________________________________________ 
|                                                       |
| >>__88__condition-name__condition-value-clause__.__>< |
|_______________________________________________________|

EBNF    Uses    Top    Help

data-description-entry-clauses

 ______________________________________________ 
|                                              |
| >>________________________________________>< |
|     ||  |__redefines-clause__|        ||     |
|     ||________________________________||     |
|     ||  |__blank-when-zero-clause__|  ||     |
|     ||________________________________||     |
|     ||  |__external-clause__|         ||     |
|     ||________________________________||     |
|     ||  |__global-clause__|           ||     |
|     ||________________________________||     |
|     ||  |__justified-clause__|        ||     |
|     ||________________________________||     |
|     ||  |__occurs-clause__|           ||     |
|     ||________________________________||     |
|     ||  |__picture-clause__|          ||     |
|     ||________________________________||     |
|     ||  |__sign-clause__|             ||     |
|     ||________________________________||     |
|     ||  |__synchronized-clause__|     ||     |
|     ||________________________________||     |
|     ||  |__usage-clause__|            ||     |
|     ||________________________________||     |
|         |__data-value-clause__|              |
|______________________________________________|

EBNF    Uses    Top    Help

redefines-clause

 ______________________________ 
|                              |
| >>__REDEFINES__data-name__>< |
|______________________________|

EBNF    Uses    Top    Help

blank-when-zero-clause

 _________________________________________ 
|                                         |
| >>__BLANK_________________ZERO_______>< |
|            |__WHEN__|  |__ZEROS___|     |
|                        |__ZEROES__|     |
|_________________________________________|

EBNF    Uses    Top    Help

justified-clause

 ______________________________________ 
|                                      |
| >>_____JUSTIFIED__________________>< |
|     |__JUST_______|  |__RIGHT__|     |
|______________________________________|

EBNF    Uses    Top    Help

occurs-clause

 ____________________________________________________________________________________ 
|                                                                                    |
| >>__OCCURS__integer______________________________________________________________> |
|                      |__TIMES__|                                                   |
| >________________________________________________________________________________> |
|     |  <__________________________________________________________________   |     |
|     |                                           <______________________   |  |     |
|     |_______ASCENDING_____________________________qualified-data-name__|__|__|     |
|          |__DESCENDING__|  |__KEY__|  |__IS__|                                     |
| >_______________________________________________________________________________>< |
|     |                     <_____________   |                                       |
|     |__INDEXED______________index-name__|__|                                       |
|                 |__BY__|                                                           |
|____________________________________________________________________________________|

 ____________________________________________________________________________________ 
|                                                                                    |
| >>__OCCURS___________________________integer_______________DEPENDING_____________> |
|             |_____integer_____TO__|           |__TIMES__|                          |
|                |__zero_____|                                                       |
| >_____________qualified-data-name________________________________________________> |
|     |__ON__|                                                                       |
| >________________________________________________________________________________> |
|     |  <__________________________________________________________________   |     |
|     |                                           <______________________   |  |     |
|     |_______ASCENDING_____________________________qualified-data-name__|__|__|     |
|          |__DESCENDING__|  |__KEY__|  |__IS__|                                     |
| >_______________________________________________________________________________>< |
|     |                     <_____________   |                                       |
|     |__INDEXED______________index-name__|__|                                       |
|                 |__BY__|                                                           |
|____________________________________________________________________________________|

EBNF    Uses    Top    Help

picture-clause

 _________________________________________________ 
|                                                 |
| >>_____PICTURE_______________picture-string__>< |
|     |__PIC______|  |__IS__|                     |
|_________________________________________________|

EBNF    Uses    Top    Help

sign-clause

 _______________________________________________________________________________ 
|                                                                               |
| >>___________________________LEADING_______________________________________>< |
|     |__SIGN____________|  |__TRAILING__|  |__SEPARATE___________________|     |
|              |__IS__|                                  |__CHARACTER__|        |
|_______________________________________________________________________________|

EBNF    Uses    Top    Help

synchronized-clause

 _______________________________________________ 
|                                               |
| >>_____SYNCHRONIZED________________________>< |
|     |__SYNC__________|  |_____LEFT______|     |
|                            |__RIGHT__|        |
|_______________________________________________|

EBNF    Uses    Top    Help

usage-clause

 ______________________________________________________ 
|                                                      |
| >>____________________________BINARY______________>< |
|     |__USAGE____________|  |__COMP_____________|     |
|               |__IS__|     |__COMP-1___________|     |
|                            |__COMP-2___________|     |
|                            |__COMP-3___________|     |
|                            |__COMP-4___________|     |
|                            |__COMPUTATIONAL____|     |
|                            |__COMPUTATIONAL-1__|     |
|                            |__COMPUTATIONAL-2__|     |
|                            |__COMPUTATIONAL-3__|     |
|                            |__COMPUTATIONAL-4__|     |
|                            |__DISPLAY__________|     |
|                            |__DISPLAY-1________|     |
|                            |__INDEX____________|     |
|                            |__PACKED-DECIMAL___|     |
|                            |__POINTER__________|     |
|______________________________________________________|

EBNF    Uses    Top    Help

condition-value-clause

 _____________________________________________________________________________ 
|                                                                             |
|                              <________________________________________      |
| >>_____VALUE___________________literal________________________________|__>< |
|     |         |__IS__|    |             |_____THROUGH_____literal__|        |
|     |__VALUES_____________|                |__THRU_____|                    |
|                |__ARE__|                                                    |
|_____________________________________________________________________________|

EBNF    Uses    Top    Help

data-value-clause

 __________________________________ 
|                                  |
| >>__VALUE____________literal__>< |
|            |__IS__|              |
|__________________________________|

EBNF    Uses    Top    Help

renames-clause

 ________________________________________________________________________________ 
|                                                                                |
| >>__RENAMES__qualified-data-name____________________________________________>< |
|                                   |_____THROUGH_____qualified-data-name__|     |
|                                      |__THRU_____|                             |
|________________________________________________________________________________|

EBNF    Uses    Top    Help

procedure-division

 ___________________________________________________________________________________________________________ 
|                                                                                                           |
| >>__PROCEDURE__DIVISION_______________________________._________________________________________________> |
|                          |         <____________   |                                                      |
|                          |__USING____data-name__|__|                                                      |
| >_______________________________________________________________________________________________________> |
|     |                   <__________________________________________________                         |     |
|     |__DECLARATIVES__.____section-header__.__use-statement__.__paragraphs__|__END__DECLARATIVES__.__|     |
| >___sections___________________________________________________________________________________________>< |
|___________________________________________________________________________________________________________|

 _____________________________________________________________ 
|                                                             |
| >>__PROCEDURE__DIVISION_______________________________.___> |
|                          |         <____________   |        |
|                          |__USING____data-name__|__|        |
| >___paragraphs___________________________________________>< |
|_____________________________________________________________|

EBNF    Uses    Top    Help

sections

 ______________________________________________________________ 
|                                                              |
| >>__paragraphs____________________________________________>< |
|                 |  <________________________________   |     |
|                 |____section-header__.__paragraphs__|__|     |
|______________________________________________________________|

EBNF    Uses    Top    Help

section-header

 ______________________________________________________ 
|                                                      |
| >>__section-name__SECTION_________________________>< |
|                            |__priority-number__|     |
|______________________________________________________|

EBNF    Uses    Top    Help

paragraphs

 ___________________________________________________ 
|                                                   |
| >>_____________________________________________>< |
|     |  <___________   |  |  <____________   |     |
|     |____sentence__|__|  |____paragraph__|__|     |
|___________________________________________________|

EBNF    Uses    Top    Help

paragraph

 ________________________________________________ 
|                                                |
| >>__paragraph-name__._______________________>< |
|                        |  <___________   |     |
|                        |____sentence__|__|     |
|________________________________________________|

 ______________________ 
|                      |
| >>__altered-goto__>< |
|______________________|

EBNF    Uses    Top    Help

sentence

 ___________________________ 
|                           |
| >>__statement-list__.__>< |
|___________________________|

EBNF    Uses    Top    Help

statement-list

 ________________________ 
|                        |
|     <____________      |
| >>____statement__|__>< |
|________________________|

EBNF    Uses    Top    Help

statement

 ________________________________________ 
|                                        |
| >>_____accept-statement_____________>< |
|     |__add-statement_____________|     |
|     |__alter-statement___________|     |
|     |__call-statement____________|     |
|     |__cancel-statement__________|     |
|     |__close-statement___________|     |
|     |__compute-statement_________|     |
|     |__continue-statement________|     |
|     |__delete-statement__________|     |
|     |__display-statement_________|     |
|     |__divide-statement__________|     |
|     |__entry-statement___________|     |
|     |__evaluate-statement________|     |
|     |__exit-statement____________|     |
|     |__exit-program-statement____|     |
|     |__goback-statement__________|     |
|     |__go-to-statement___________|     |
|     |__if-statement______________|     |
|     |__initialize-statement______|     |
|     |__inspect-statement_________|     |
|     |__merge-statement___________|     |
|     |__move-statement____________|     |
|     |__multiply-statement________|     |
|     |__open-statement____________|     |
|     |__perform-statement_________|     |
|     |__read-statement____________|     |
|     |__release-statement_________|     |
|     |__return-statement__________|     |
|     |__rewrite-statement_________|     |
|     |__search-statement__________|     |
|     |__set-statement_____________|     |
|     |__sort-statement____________|     |
|     |__start-statement___________|     |
|     |__stop-statement____________|     |
|     |__string-statement__________|     |
|     |__subtract-statement________|     |
|     |__unstring-statement________|     |
|     |__write-statement___________|     |
|________________________________________|

EBNF    Uses    Top    Help

accept-statement

 ________________________________________________________________ 
|                                                                |
| >>__ACCEPT__identifier______________________________________>< |
|                         |__FROM_____mnemonic-name________|     |
|                                  |__environment-name__|        |
|________________________________________________________________|

 _____________________________________________________ 
|                                                     |
| >>__ACCEPT__identifier__FROM_____DATE____________>< |
|                               |__DAY__________|     |
|                               |__DAY-OF-WEEK__|     |
|                               |__TIME_________|     |
|_____________________________________________________|

EBNF    Uses    Top    Help

add-statement

 ________________________________________________________________________ 
|                                                                        |
|          <___________________       <____________________________      |
| >>__ADD_______identifier_____|__TO____identifier_________________|___> |
|            |__literal_____|                       |__ROUNDED__|        |
| >____________________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|                        |
|        |__ON__|                                                        |
| >____________________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|                   |
|             |__ON__|                                                   |
| >___________________________________________________________________>< |
|     |__END-ADD__|                                                      |
|________________________________________________________________________|

 ________________________________________________________________ 
|                                                                |
|          <___________________                                  |
| >>__ADD_______identifier_____|_______________identifier______> |
|            |__literal_____|     |__TO__|  |__literal_____|     |
|             <____________________________                      |
| >___GIVING____identifier_________________|___________________> |
|                           |__ROUNDED__|                        |
| >____________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|                |
|        |__ON__|                                                |
| >____________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|           |
|             |__ON__|                                           |
| >___________________________________________________________>< |
|     |__END-ADD__|                                              |
|________________________________________________________________|

 ____________________________________________________________________ 
|                                                                    |
| >>__ADD_____CORRESPONDING_____identifier__TO__identifier_________> |
|          |__CORR___________|                                       |
| >________________________________________________________________> |
|     |__ROUNDED__|  |____________SIZE__ERROR__statement-list__|     |
|                       |__ON__|                                     |
| >________________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|               |
|             |__ON__|                                               |
| >_______________________________________________________________>< |
|     |__END-ADD__|                                                  |
|____________________________________________________________________|

EBNF    Uses    Top    Help

alter-statement

 ____________________________________________________________________ 
|                                                                    |
| >>__ALTER________________________________________________________> |
|     <________________________________________________________      |
| >_____procedure-name__TO_____________________procedure-name__|__>< |
|                           |__PROCEED__TO__|                        |
|____________________________________________________________________|

EBNF    Uses    Top    Help

call-statement

 _______________________________________________________________________________________________ 
|                                                                                               |
| >>__CALL_____identifier_____________________________________________________________________> |
|           |__literal_____|                                                                    |
| >___________________________________________________________________________________________> |
|     |         <______________________________________________________________________   |     |
|     |                                         <________________________________      |  |     |
|     |__USING_______________________________________identifier__________________|_____|__|     |
|                 |  |____________REFERENCE__|    |__ADDRESS__OF__identifier__|     |           |
|                 |     |__BY__|                  |__file-name________________|     |           |
|                 |                     <_____________________________________      |           |
|                 |____________CONTENT_________________________identifier_____|_____|           |
|                    |__BY__|             |  |__LENGTH__OF__|              |                    |
|                                         |__ADDRESS__OF__identifier_______|                    |
|                                         |__literal_______________________|                    |
|                                                                                               |
| >__________________________________________________________________________________________>< |
|     |____________OVERFLOW__statement-list__|  |__END-CALL__|                                  |
|        |__ON__|                                                                               |
|_______________________________________________________________________________________________|

 _______________________________________________________________________________________________ 
|                                                                                               |
| >>__CALL_____identifier_____________________________________________________________________> |
|           |__literal_____|                                                                    |
| >___________________________________________________________________________________________> |
|     |         <______________________________________________________________________   |     |
|     |                                         <________________________________      |  |     |
|     |__USING_______________________________________identifier__________________|_____|__|     |
|                 |  |____________REFERENCE__|    |__ADDRESS__OF__identifier__|     |           |
|                 |     |__BY__|                  |__file-name________________|     |           |
|                 |                     <_____________________________________      |           |
|                 |____________CONTENT_________________________identifier_____|_____|           |
|                    |__BY__|             |  |__LENGTH__OF__|              |                    |
|                                         |__ADDRESS__OF__identifier_______|                    |
|                                         |__literal_______________________|                    |
|                                                                                               |
| >___________________________________________________________________________________________> |
|     |____________EXCEPTION__statement-list__|                                                 |
|        |__ON__|                                                                               |
| >__________________________________________________________________________________________>< |
|     |__NOT____________EXCEPTION__statement-list__|  |__END-CALL__|                            |
|             |__ON__|                                                                          |
|_______________________________________________________________________________________________|

EBNF    Uses    Top    Help

cancel-statement

 _______________________________________ 
|                                       |
|             <___________________      |
| >>__CANCEL_______identifier_____|__>< |
|               |__literal_____|        |
|_______________________________________|

EBNF    Uses    Top    Help

close-statement

 ____________________________________________________________________________________ 
|                                                                                    |
| >>__CLOSE________________________________________________________________________> |
|     <________________________________________________________________________      |
| >_____file-name______________________________________________________________|__>< |
|                  |________REEL____________________________________________|        |
|                     |  |__UNIT__|  |________________REMOVAL_________|  |           |
|                     |                 |  |__FOR__|               |     |           |
|                     |                 |______________NO__REWIND__|     |           |
|                     |                    |__WITH__|                    |           |
|                     |_________________NO__REWIND_______________________|           |
|                        |__WITH__|  |__LOCK________|                                |
|____________________________________________________________________________________|

 _______________________________________________________ 
|                                                       |
|            <____________________________________      |
| >>__CLOSE____file-name__________________________|__>< |
|                         |______________LOCK__|        |
|                            |__WITH__|                 |
|_______________________________________________________|

EBNF    Uses    Top    Help

compute-statement

 ______________________________________________________________ 
|                                                              |
|              <____________________________                   |
| >>__COMPUTE____identifier_________________|_____=__________> |
|                            |__ROUNDED__|     |__EQUAL__|     |
| >___arithmetic-expression__________________________________> |
| >__________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|              |
|        |__ON__|                                              |
| >__________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|         |
|             |__ON__|                                         |
| >_________________________________________________________>< |
|     |__END-COMPUTE__|                                        |
|______________________________________________________________|

EBNF    Uses    Top    Help

continue-statement

 __________________ 
|                  |
| >>__CONTINUE__>< |
|__________________|

EBNF    Uses    Top    Help

delete-statement

 _______________________________________________________ 
|                                                       |
| >>__DELETE__file-name_______________________________> |
|                        |__RECORD__|                   |
| >___________________________________________________> |
|     |__INVALID_____________statement-list__|          |
|                 |__KEY__|                             |
| >___________________________________________________> |
|     |__NOT__INVALID_____________statement-list__|     |
|                      |__KEY__|                        |
| >__________________________________________________>< |
|     |__END-DELETE__|                                  |
|_______________________________________________________|

EBNF    Uses    Top    Help

display-statement

 ____________________________________________ 
|                                            |
|              <___________________          |
| >>__DISPLAY_______identifier_____|_______> |
|                |__literal_____|            |
| >________________________________________> |
|     |__UPON_____mnemonic-name________|     |
|              |__environment-name__|        |
| >_______________________________________>< |
|     |______________NO__ADVANCING__|        |
|        |__WITH__|                          |
|____________________________________________|

EBNF    Uses    Top    Help

divide-statement

 ________________________________________________________________________ 
|                                                                        |
|                                     <____________________________      |
| >>__DIVIDE_____identifier_____INTO____identifier_________________|___> |
|             |__literal_____|                      |__ROUNDED__|        |
| >____________________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|                        |
|        |__ON__|                                                        |
| >____________________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|                   |
|             |__ON__|                                                   |
| >___________________________________________________________________>< |
|     |__END-DIVIDE__|                                                   |
|________________________________________________________________________|

 __________________________________________________________ 
|                                                          |
| >>__DIVIDE_____identifier_____INTO_____identifier______> |
|             |__literal_____|        |__literal_____|     |
|             <____________________________                |
| >___GIVING____identifier_________________|_____________> |
|                           |__ROUNDED__|                  |
| >______________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|          |
|        |__ON__|                                          |
| >______________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|     |
|             |__ON__|                                     |
| >_____________________________________________________>< |
|     |__END-DIVIDE__|                                     |
|__________________________________________________________|

 __________________________________________________________ 
|                                                          |
| >>__DIVIDE_____identifier_____BY_____identifier________> |
|             |__literal_____|      |__literal_____|       |
|             <____________________________                |
| >___GIVING____identifier_________________|_____________> |
|                           |__ROUNDED__|                  |
| >______________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|          |
|        |__ON__|                                          |
| >______________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|     |
|             |__ON__|                                     |
| >_____________________________________________________>< |
|     |__END-DIVIDE__|                                     |
|__________________________________________________________|

 __________________________________________________________________ 
|                                                                  |
| >>__DIVIDE_____identifier_____INTO_____identifier______________> |
|             |__literal_____|        |__literal_____|             |
| >___GIVING__identifier_________________REMAINDER__identifier___> |
|                         |__ROUNDED__|                            |
| >______________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|                  |
|        |__ON__|                                                  |
| >______________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|             |
|             |__ON__|                                             |
| >_____________________________________________________________>< |
|     |__END-DIVIDE__|                                             |
|__________________________________________________________________|

 __________________________________________________________________ 
|                                                                  |
| >>__DIVIDE_____identifier_____BY_____identifier________________> |
|             |__literal_____|      |__literal_____|               |
| >___GIVING__identifier_________________REMAINDER__identifier___> |
|                         |__ROUNDED__|                            |
| >______________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|                  |
|        |__ON__|                                                  |
| >______________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|             |
|             |__ON__|                                             |
| >_____________________________________________________________>< |
|     |__END-DIVIDE__|                                             |
|__________________________________________________________________|

EBNF    Uses    Top    Help

entry-statement

 _____________________________________________________ 
|                                                     |
| >>__ENTRY__literal_______________________________>< |
|                     |         <____________   |     |
|                     |__USING____data-name__|__|     |
|_____________________________________________________|

EBNF    Uses    Top    Help

evaluate-statement

 _____________________________________________________________________________________________ 
|                                                                                             |
| >>__EVALUATE_____identifier_______________________________________________________________> |
|               |__literal________________|  |  <____________________________________   |     |
|               |__arithmetic-expression__|  |____ALSO_____identifier________________|__|     |
|               |__condition______________|             |__literal________________|           |
|               |__TRUE___________________|             |__arithmetic-expression__|           |
|               |__FALSE__________________|             |__condition______________|           |
|                                                       |__TRUE___________________|           |
|                                                       |__FALSE__________________|           |
|     <_______________________________________________________________________________        |
|       <__________________________________________________________                   |       |
| >_______WHEN__evaluate-phrase____________________________________|__statement-list__|_____> |
|                                |  <________________________   |                             |
|                                |____ALSO__evaluate-phrase__|__|                             |
| >________________________________________________________________________________________>< |
|     |__WHEN__OTHER__statement-list__|  |__END-EVALUATE__|                                   |
|_____________________________________________________________________________________________|

EBNF    Uses    Top    Help

evaluate-phrase

 ________________________________________________________________________________________________________ 
|                                                                                                        |
| >>_____ANY__________________________________________________________________________________________>< |
|     |__condition_________________________________________________________________________________|     |
|     |__TRUE______________________________________________________________________________________|     |
|     |__FALSE_____________________________________________________________________________________|     |
|     |________________identifier__________________________________________________________________|     |
|        |__NOT__|  |__literal________________|  |_____THROUGH________identifier________________|        |
|                   |__arithmetic-expression__|     |__THRU_____|  |__literal________________|           |
|                                                                  |__arithmetic-expression__|           |
|________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

exit-statement

 ______________ 
|              |
| >>__EXIT__>< |
|______________|

EBNF    Uses    Top    Help

exit-program-statement

 _______________________ 
|                       |
| >>__EXIT__PROGRAM__>< |
|_______________________|

EBNF    Uses    Top    Help

goback-statement

 ________________ 
|                |
| >>__GOBACK__>< |
|________________|

EBNF    Uses    Top    Help

go-to-statement

 ______________________________________ 
|                                      |
| >>__GO____________procedure-name__>< |
|         |__TO__|                     |
|______________________________________|

 ___________________________________ 
|                                   |
| >>__GO____________MORE-LABELS__>< |
|         |__TO__|                  |
|___________________________________|

 ________________________________________________________________ 
|                                                                |
|                   <_________________                           |
| >>__GO______________procedure-name__|__DEPENDING_____________> |
|         |__TO__|                                  |__ON__|     |
| >___identifier______________________________________________>< |
|________________________________________________________________|

EBNF    Uses    Top    Help

altered-goto

 ____________________________________________ 
|                                            |
| >>__paragraph-name__.__GO____________.__>< |
|                            |__TO__|        |
|____________________________________________|

EBNF    Uses    Top    Help

if-statement

 _________________________________________________________ 
|                                                         |
|                                   <____________         |
| >>__IF__condition___________________statement__|______> |
|                    |__THEN__|  |__NEXT__SENTENCE__|     |
|                                                         |
| >____________________________________________________>< |
|     |           <____________      |  |__END-IF__|      |
|     |__ELSE_______statement__|_____|                    |
|              |__NEXT__SENTENCE__|                       |
|                                                         |
|_________________________________________________________|

EBNF    Uses    Top    Help

initialize-statement

 ___________________________________________________________________________________________ 
|                                                                                           |
|                 <_____________                                                            |
| >>__INITIALIZE____identifier__|_________________________________________________________> |
| >______________________________________________________________________________________>< |
|     |             <______________________________________________________________   |     |
|     |__REPLACING_______ALPHABETIC__________________________BY_____identifier_____|__|     |
|                     |__ALPHANUMERIC_________|  |__DATA__|      |__literal_____|           |
|                     |__NUMERIC______________|                                             |
|                     |__ALPHANUMERIC-EDITED__|                                             |
|                     |__NUMERIC-EDITED_______|                                             |
|                     |__DBCS_________________|                                             |
|                     |__EGCS_________________|                                             |
|___________________________________________________________________________________________|

EBNF    Uses    Top    Help

inspect-statement

 _______________________________________________________________________________________________________________ 
|                                                                                                               |
| >>__INSPECT__identifier__TALLYING___________________________________________________________________________> |
|     <___________________________________________________________________________________________________      |
|                        <_____________________________________________________________________________   |     |
| >_____identifier__FOR_______CHARACTERS_______________________________________________________________|__|__>< |
|                          |              |  <______________________   |                            |           |
|                          |              |____before-after-phrase__|__|                            |           |
|                          |                 <___________________________________________________   |           |
|                          |_____ALL______________identifier_____________________________________|__|           |
|                             |__LEADING__|    |__literal_____|  |  <______________________   |                 |
|                                                                |____before-after-phrase__|__|                 |
|_______________________________________________________________________________________________________________|

 _______________________________________________________________ 
|                                                               |
| >>__INSPECT__identifier__CONVERTING_____identifier_____TO___> |
|                                      |__literal_____|         |
| >______identifier__________________________________________>< |
|     |__literal_____|  |  <______________________   |          |
|                       |____before-after-phrase__|__|          |
|_______________________________________________________________|

 __________________________________________________________________________________________________________________________ 
|                                                                                                                          |
| >>__INSPECT__identifier__TALLYING______________________________________________________________________________________> |
|     <___________________________________________________________________________________________________                 |
|                        <_____________________________________________________________________________   |                |
| >_____identifier__FOR_______CHARACTERS_______________________________________________________________|__|__REPLACING___> |
|                          |              |  <______________________   |                            |                      |
|                          |              |____before-after-phrase__|__|                            |                      |
|                          |                 <___________________________________________________   |                      |
|                          |_____ALL______________identifier_____________________________________|__|                      |
|                             |__LEADING__|    |__literal_____|  |  <______________________   |                            |
|                                                                |____before-after-phrase__|__|                            |
|     <___________________________________________________________________________________________________                 |
| >________CHARACTERS__BY_____identifier__________________________________________________________________|_____________>< |
|       |                  |__literal_____|  |  <______________________   |                            |                   |
|       |                                    |____before-after-phrase__|__|                            |                   |
|       |                 <_________________________________________________________________________   |                   |
|       |_____ALL______________identifier_____BY_____identifier_____________________________________|__|                   |
|          |__LEADING__|    |__literal_____|      |__literal_____|  |  <______________________   |                         |
|          |__FIRST____|                                            |____before-after-phrase__|__|                         |
|__________________________________________________________________________________________________________________________|

 _______________________________________________________________________________________________________________ 
|                                                                                                               |
| >>__INSPECT__identifier__REPLACING__________________________________________________________________________> |
|     <___________________________________________________________________________________________________      |
| >________CHARACTERS__BY_____identifier__________________________________________________________________|__>< |
|       |                  |__literal_____|  |  <______________________   |                            |        |
|       |                                    |____before-after-phrase__|__|                            |        |
|       |                 <_________________________________________________________________________   |        |
|       |_____ALL______________identifier_____BY_____identifier_____________________________________|__|        |
|          |__LEADING__|    |__literal_____|      |__literal_____|  |  <______________________   |              |
|          |__FIRST____|                                            |____before-after-phrase__|__|              |
|_______________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

before-after-phrase

 _______________________________________________________ 
|                                                       |
| >>_____BEFORE_______________________identifier_____>< |
|     |__AFTER___|  |__INITIAL__|  |__literal_____|     |
|_______________________________________________________|

EBNF    Uses    Top    Help

merge-statement

 ____________________________________________________________________________________________________ 
|                                                                                                    |
|                       <__________________________________________________________________          |
|                                                                <______________________   |         |
| >>__MERGE__file-name_________________ASCENDING___________________qualified-data-name__|__|_______> |
|                         |__ON__|  |__DESCENDING__|  |__KEY__|                                      |
|                                                                                 <____________      |
| >_____________________________________________________________USING__file-name____file-name__|___> |
|     |___________________SEQUENCE____________alphabet-name__|                                       |
|        |__COLLATING__|            |__IS__|                                                         |
| >______OUTPUT__PROCEDURE____________procedure-name______________________________________________>< |
|     |                     |__IS__|                  |_____THROUGH_____procedure-name__|  |         |
|     |                                                  |__THRU_____|                     |         |
|     |          <____________                                                             |         |
|     |__GIVING____file-name__|____________________________________________________________|         |
|____________________________________________________________________________________________________|

EBNF    Uses    Top    Help

move-statement

 _____________________________________________________ 
|                                                     |
|                                 <_____________      |
| >>__MOVE_____identifier_____TO____identifier__|__>< |
|           |__literal_____|                          |
|_____________________________________________________|

 ____________________________________________________________________ 
|                                                                    |
|                                                <_____________      |
| >>__MOVE_____CORRESPONDING_____identifier__TO____identifier__|__>< |
|           |__CORR___________|                                      |
|____________________________________________________________________|

EBNF    Uses    Top    Help

multiply-statement

 ________________________________________________________________________ 
|                                                                        |
|                                     <____________________________      |
| >>__MULTIPLY_____identifier_____BY____identifier_________________|___> |
|               |__literal_____|                    |__ROUNDED__|        |
| >____________________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|                        |
|        |__ON__|                                                        |
| >____________________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|                   |
|             |__ON__|                                                   |
| >___________________________________________________________________>< |
|     |__END-MULTIPLY__|                                                 |
|________________________________________________________________________|

 __________________________________________________________ 
|                                                          |
| >>__MULTIPLY_____identifier_____BY_____identifier______> |
|               |__literal_____|      |__literal_____|     |
|             <____________________________                |
| >___GIVING____identifier_________________|_____________> |
|                           |__ROUNDED__|                  |
| >______________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|          |
|        |__ON__|                                          |
| >______________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|     |
|             |__ON__|                                     |
| >_____________________________________________________>< |
|     |__END-MULTIPLY__|                                   |
|__________________________________________________________|

EBNF    Uses    Top    Help

open-statement

 ____________________________________________________________________________________ 
|                                                                                    |
|           <__________________________________________________________________      |
|                       <________________________________________________      |     |
| >>__OPEN_______INPUT____file-name______________________________________|_____|__>< |
|             |                      |_____REVERSED___________________|     |        |
|             |                         |______________NO__REWIND__|        |        |
|             |                            |__WITH__|                       |        |
|             |          <__________________________________________        |        |
|             |__OUTPUT____file-name________________________________|_______|        |
|             |                       |______________NO__REWIND__|          |        |
|             |                          |__WITH__|                         |        |
|             |       <____________                                         |        |
|             |__I-O____file-name__|________________________________________|        |
|             |          <____________                                      |        |
|             |__EXTEND____file-name__|_____________________________________|        |
|                                                                                    |
|____________________________________________________________________________________|

 _________________________________________________ 
|                                                 |
|           <_______________________________      |
|                       <____________       |     |
| >>__OPEN_______INPUT____file-name__|______|__>< |
|             |          <____________   |        |
|             |__OUTPUT____file-name__|__|        |
|             |       <____________      |        |
|             |__I-O____file-name__|_____|        |
|             |          <____________   |        |
|             |__EXTEND____file-name__|__|        |
|                                                 |
|_________________________________________________|

EBNF    Uses    Top    Help

perform-statement

 ___________________________________________________________________ 
|                                                                   |
| >>__PERFORM_____________________________________________________> |
| >______procedure-name__________________________________________>< |
|     |                  |_____THROUGH_____procedure-name__|  |     |
|     |                     |__THRU_____|                     |     |
|     |__statement-list__END-PERFORM__________________________|     |
|___________________________________________________________________|

 __________________________________________________________________________________________________________________________ 
|                                                                                                                          |
| >>__PERFORM_____procedure-name_______________________________________perform-varying-phrase__perform-after-phrase_____>< |
|              |                  |_____THROUGH_____procedure-name__|                                                |     |
|              |                     |__THRU_____|                                                                   |     |
|              |__perform-varying-phrase__statement-list__END-PERFORM________________________________________________|     |
|__________________________________________________________________________________________________________________________|

 _____________________________________________________________________________________________________ 
|                                                                                                     |
| >>__PERFORM_____procedure-name__________________________________________identifier_____TIMES_____>< |
|              |                  |_____THROUGH_____procedure-name__|  |__integer_____|         |     |
|              |                     |__THRU_____|                                              |     |
|              |_____identifier_____TIMES__statement-list__END-PERFORM__________________________|     |
|                 |__integer_____|                                                                    |
|_____________________________________________________________________________________________________|

 _________________________________________________________________________________________ 
|                                                                                         |
| >>__PERFORM___________________________________________________________________________> |
| >______procedure-name_______________________________________perform-until-phrase_____>< |
|     |                  |_____THROUGH_____procedure-name__|                        |     |
|     |                     |__THRU_____|                                           |     |
|     |__perform-until-phrase__statement-list__END-PERFORM__________________________|     |
|_________________________________________________________________________________________|

EBNF    Uses    Top    Help

perform-until-phrase

 ________________________________________________________________ 
|                                                                |
| >>________________________________________UNTIL__condition__>< |
|     |______________TEST_____BEFORE_____|                       |
|        |__WITH__|        |__AFTER___|                          |
|________________________________________________________________|

EBNF    Uses    Top    Help

perform-varying-phrase

 ______________________________________________________________________________________________________________________________ 
|                                                                                                                              |
| >>________________________________________VARYING_____identifier_____FROM_____identifier_____BY_____identifier_____UNTIL___> |
|     |______________TEST_____BEFORE_____|           |__index-name__|        |__index-name__|      |__literal_____|            |
|        |__WITH__|        |__AFTER___|                                      |__literal_____|                                  |
| >___condition_____________________________________________________________________________________________________________>< |
|______________________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

perform-after-phrase

 ____________________________________________________________________________________________________________ 
|                                                                                                            |
| >>______________________________________________________________________________________________________>< |
|     |  <__________________________________________________________________________________________   |     |
|     |____AFTER_____identifier_____FROM_____identifier_____BY_____identifier_____UNTIL__condition__|__|     |
|                 |__index-name__|        |__index-name__|      |__literal_____|                             |
|                                         |__literal_____|                                                   |
|____________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

read-statement

 __________________________________________________________________ 
|                                                                  |
| >>__READ__file-name____________________________________________> |
|                      |__NEXT__|  |__RECORD__|                    |
| >______________________________________________________________> |
|     |__INTO__identifier__|                                       |
| >______________________________________________________________> |
|     |____________END__statement-list__|                          |
|        |__AT__|                                                  |
| >_____________________________________________________________>< |
|     |__NOT____________END__statement-list__|  |__END-READ__|     |
|             |__AT__|                                             |
|__________________________________________________________________|

 _______________________________________________________________________ 
|                                                                       |
| >>__READ__file-name_________________________________________________> |
|                      |__RECORD__|  |__INTO__identifier__|             |
| >___________________________________________________________________> |
|     |__KEY____________qualified-data-name__|                          |
|             |__IS__|                                                  |
| >___________________________________________________________________> |
|     |__INVALID_____________statement-list__|                          |
|                 |__KEY__|                                             |
| >__________________________________________________________________>< |
|     |__NOT__INVALID_____________statement-list__|  |__END-READ__|     |
|                      |__KEY__|                                        |
|_______________________________________________________________________|

EBNF    Uses    Top    Help

release-statement

 ______________________________________________________ 
|                                                      |
| >>__RELEASE__record-name__________________________>< |
|                           |__FROM__identifier__|     |
|______________________________________________________|

EBNF    Uses    Top    Help

return-statement

 ____________________________________________________________________ 
|                                                                    |
| >>__RETURN__file-name____________________________________________> |
|                        |__RECORD__|  |__INTO__identifier__|        |
| >_____________END__statement-list________________________________> |
|     |__AT__|                                                       |
| >_______________________________________________________________>< |
|     |__NOT____________END__statement-list__|  |__END-RETURN__|     |
|             |__AT__|                                               |
|____________________________________________________________________|

EBNF    Uses    Top    Help

rewrite-statement

 _______________________________________________________ 
|                                                       |
| >>__REWRITE__record-name____________________________> |
|                           |__FROM__identifier__|      |
| >___________________________________________________> |
|     |__INVALID_____________statement-list__|          |
|                 |__KEY__|                             |
| >___________________________________________________> |
|     |__NOT__INVALID_____________statement-list__|     |
|                      |__KEY__|                        |
| >__________________________________________________>< |
|     |__END-REWRITE__|                                 |
|_______________________________________________________|

EBNF    Uses    Top    Help

search-statement

 _____________________________________________________________ 
|                                                             |
| >>__SEARCH__identifier____________________________________> |
|                         |__VARYING_____identifier_____|     |
|                                     |__index-name__|        |
| >_________________________________________________________> |
|     |____________END__statement-list__|                     |
|        |__AT__|                                             |
|     <________________________________________               |
| >_____WHEN__condition_____statement-list_____|____________> |
|                        |__NEXT__SENTENCE__|                 |
| >________________________________________________________>< |
|     |__END-SEARCH__|                                        |
|_____________________________________________________________|

 _________________________________________________________________________________________________________________ 
|                                                                                                                 |
| >>__SEARCH__ALL__identifier___________________________________________________________________________________> |
|                              |____________END__statement-list__|                                                |
|                                 |__AT__|                                                                        |
| >___WHEN_____qualified-data-name_______________EQUAL__________________identifier______________________________> |
|           |                       |__IS__|  |         |__TO__|  |  |__literal________________|  |               |
|           |                                 |__=________________|  |__arithmetic-expression__|  |               |
|           |__condition-name-reference___________________________________________________________|               |
| >_____________________________________________________________________________________________________________> |
|     |  <_______________________________________________________________________________________________   |     |
|     |____AND_____qualified-data-name_______________EQUAL__________________identifier___________________|__|     |
|               |                       |__IS__|  |         |__TO__|  |  |__literal________________|  |           |
|               |                                 |__=________________|  |__arithmetic-expression__|  |           |
|               |__condition-name-reference___________________________________________________________|           |
| >______statement-list________________________________________________________________________________________>< |
|     |__NEXT__SENTENCE__|  |__END-SEARCH__|                                                                      |
|_________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

set-statement

 __________________________________________________________ 
|                                                          |
|          <___________________                            |
| >>__SET_______index-name_____|__TO_____index-name_____>< |
|            |__identifier__|         |__identifier__|     |
|                                     |__integer_____|     |
|__________________________________________________________|

 ________________________________________________________________ 
|                                                                |
|          <_____________                                        |
| >>__SET____index-name__|_____UP__BY__________identifier_____>< |
|                           |__DOWN__BY__|  |__integer_____|     |
|________________________________________________________________|

 _____________________________________________________ 
|                                                     |
|          <____________________________________      |
|            <________________                  |     |
| >>__SET______mnemonic-name__|__TO_____ON______|__>< |
|                                    |__OFF__|        |
|_____________________________________________________|

 ______________________________________________________ 
|                                                      |
|          <___________________________                |
| >>__SET____condition-name-reference__|__TO__TRUE__>< |
|______________________________________________________|

 _________________________________________________ 
|                                                 |
|          <________________________________      |
| >>__SET_______identifier__________________|___> |
|            |__ADDRESS__OF__identifier__|        |
| >___TO_____identifier________________________>< |
|         |__ADDRESS__OF__identifier__|           |
|         |__NULL_____________________|           |
|         |__NULLS____________________|           |
|_________________________________________________|

EBNF    Uses    Top    Help

sort-statement

 ________________________________________________________________________________________________ 
|                                                                                                |
|                      <__________________________________________________________________       |
|                                                               <______________________   |      |
| >>__SORT__file-name_________________ASCENDING___________________qualified-data-name__|__|____> |
|                        |__ON__|  |__DESCENDING__|  |__KEY__|                                   |
| >____________________________________________________________________________________________> |
|     |______________DUPLICATES_________________________|                                        |
|        |__WITH__|              |__IN__|  |__ORDER__|                                           |
| >____________________________________________________________________________________________> |
|     |___________________SEQUENCE____________alphabet-name__|                                   |
|        |__COLLATING__|            |__IS__|                                                     |
|               <____________                                                                    |
| >______USING____file-name__|_________________________________________________________________> |
|     |__INPUT__PROCEDURE____________procedure-name_______________________________________|      |
|                          |__IS__|                  |_____THROUGH_____procedure-name__|         |
|                                                       |__THRU_____|                            |
|                                                                                                |
|                <____________                                                                   |
| >______GIVING____file-name__|_______________________________________________________________>< |
|     |__OUTPUT__PROCEDURE____________procedure-name_______________________________________|     |
|                           |__IS__|                  |_____THROUGH_____procedure-name__|        |
|                                                        |__THRU_____|                           |
|                                                                                                |
|________________________________________________________________________________________________|

EBNF    Uses    Top    Help

start-statement

 __________________________________________________________________________________________________ 
|                                                                                                  |
| >>__START__file-name___________________________________________________________________________> |
| >______________________________________________________________________________________________> |
|     |__KEY_______________EQUAL________________________________________qualified-data-name__|     |
|             |__IS__|  |         |__TO__|                           |                             |
|                       |__=_________________________________________|                             |
|                       |__GREATER___________________________________|                             |
|                       |           |__THAN__|                       |                             |
|                       |__>_________________________________________|                             |
|                       |__NOT__LESS_________________________________|                             |
|                       |             |__THAN__|                     |                             |
|                       |__NOT__<____________________________________|                             |
|                       |__GREATER______________OR__EQUAL____________|                             |
|                       |           |__THAN__|             |__TO__|  |                             |
|                       |__>=________________________________________|                             |
| >______________________________________________________________________________________________> |
|     |__INVALID_____________statement-list__|                                                     |
|                 |__KEY__|                                                                        |
| >_____________________________________________________________________________________________>< |
|     |__NOT__INVALID_____________statement-list__|  |__END-START__|                               |
|                      |__KEY__|                                                                   |
|__________________________________________________________________________________________________|

EBNF    Uses    Top    Help

stop-statement

 _____________________________ 
|                             |
| >>__STOP_____RUN_________>< |
|           |__literal__|     |
|_____________________________|

EBNF    Uses    Top    Help

string-statement

 ___________________________________________________________________________ 
|                                                                           |
| >>__STRING______________________________________________________________> |
|     <_______________________________________________________________      |
|       <___________________                                          |     |
| >__________identifier_____|__DELIMITED_______________identifier_____|___> |
|         |__literal_____|                |__BY__|  |__literal_____|        |
|                                                   |__SIZE________|        |
| >___INTO__identifier____________________________________________________> |
|                       |______________POINTER__identifier__|               |
|                          |__WITH__|                                       |
| >_______________________________________________________________________> |
|     |____________OVERFLOW__statement-list__|                              |
|        |__ON__|                                                           |
| >_______________________________________________________________________> |
|     |__NOT____________OVERFLOW__statement-list__|                         |
|             |__ON__|                                                      |
| >______________________________________________________________________>< |
|     |__END-STRING__|                                                      |
|___________________________________________________________________________|

EBNF    Uses    Top    Help

subtract-statement

 __________________________________________________________ 
|                                                          |
|               <___________________                       |
| >>__SUBTRACT_______identifier_____|__FROM______________> |
|                 |__literal_____|                         |
|     <____________________________                        |
| >_____identifier_________________|_____________________> |
|                   |__ROUNDED__|                          |
| >______________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|          |
|        |__ON__|                                          |
| >______________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|     |
|             |__ON__|                                     |
| >_____________________________________________________>< |
|     |__END-SUBTRACT__|                                   |
|__________________________________________________________|

 _________________________________________________________________ 
|                                                                 |
|               <___________________                              |
| >>__SUBTRACT_______identifier_____|__FROM_____identifier______> |
|                 |__literal_____|           |__literal_____|     |
|             <____________________________                       |
| >___GIVING____identifier_________________|____________________> |
|                           |__ROUNDED__|                         |
| >_____________________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|                 |
|        |__ON__|                                                 |
| >_____________________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|            |
|             |__ON__|                                            |
| >____________________________________________________________>< |
|     |__END-SUBTRACT__|                                          |
|_________________________________________________________________|

 __________________________________________________________ 
|                                                          |
| >>__SUBTRACT_____CORRESPONDING_____identifier__FROM____> |
|               |__CORR___________|                        |
| >___identifier_________________________________________> |
|                 |__ROUNDED__|                            |
| >______________________________________________________> |
|     |____________SIZE__ERROR__statement-list__|          |
|        |__ON__|                                          |
| >______________________________________________________> |
|     |__NOT____________SIZE__ERROR__statement-list__|     |
|             |__ON__|                                     |
| >_____________________________________________________>< |
|     |__END-SUBTRACT__|                                   |
|__________________________________________________________|

EBNF    Uses    Top    Help

unstring-statement

 __________________________________________________________________________________________________________________ 
|                                                                                                                  |
| >>__UNSTRING__identifier_______________________________________________________________________________________> |
| >_______________________________________________________________________________________________________INTO___> |
|     |__DELIMITED__________________________identifier_________________________________________________|           |
|                   |__BY__|  |__ALL__|  |__literal_____|  |  <__________________________________   |              |
|                                                          |____OR________________identifier_____|__|              |
|                                                                   |__ALL__|  |__literal_____|                    |
|     <_______________________________________________________________________________________                     |
| >_____identifier____________________________________________________________________________|__________________> |
|                   |__DELIMITER____________identifier__|  |__COUNT____________identifier__|                       |
|                                 |__IN__|                           |__IN__|                                      |
| >______________________________________________________________________________________________________________> |
|     |______________POINTER__identifier__|  |__TALLYING____________identifier__|                                  |
|        |__WITH__|                                       |__IN__|                                                 |
| >______________________________________________________________________________________________________________> |
|     |____________OVERFLOW__statement-list__|  |__NOT____________OVERFLOW__statement-list__|                      |
|        |__ON__|                                       |__ON__|                                                   |
| >_____________________________________________________________________________________________________________>< |
|     |__END-UNSTRING__|                                                                                           |
|__________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

write-statement

 _______________________________________________________________________________________________________________________________________ 
|                                                                                                                                       |
| >>__WRITE__record-name______________________________________________________________________________________________________________> |
|                         |__FROM__identifier__|                                                                                        |
| >______________________________________________________________________________________write-statement-phrase______________________>< |
|     |  |_____BEFORE____________________________identifier___________________________|                          |  |__END-WRITE__|     |
|     |     |__AFTER___|  |__ADVANCING__|  |  |__integer_____|  |_____LINE______|  |                             |                      |
|     |                                    |                       |__LINES__|     |                             |                      |
|     |                                    |__mnemonic-name________________________|                             |                      |
|     |                                    |__PAGE_________________________________|                             |                      |
|     |__________________________________________________________________________________________________________|                      |
|        |__INVALID_____________statement-list__|  |__NOT__INVALID_____________statement-list__|                                        |
|                    |__KEY__|                                      |__KEY__|                                                           |
|_______________________________________________________________________________________________________________________________________|

 _______________________________________________________ 
|                                                       |
| >>__WRITE__record-name______________________________> |
|                         |__FROM__identifier__|        |
| >___________________________________________________> |
|     |__INVALID_____________statement-list__|          |
|                 |__KEY__|                             |
| >___________________________________________________> |
|     |__NOT__INVALID_____________statement-list__|     |
|                      |__KEY__|                        |
| >__________________________________________________>< |
|     |__END-WRITE__|                                   |
|_______________________________________________________|

 _____________________________________________________________________ 
|                                                                     |
| >>__WRITE__record-name___________________________________________>< |
|                         |__FROM__identifier__|  |__END-WRITE__|     |
|_____________________________________________________________________|

EBNF    Uses    Top    Help

write-statement-phrase

 ___________________________________________________________________________________________________________________ 
|                                                                                                                   |
| >>_____________________________________________________________________________________________________________>< |
|     |_______________END-OF-PAGE_____statement-list__|  |__NOT_______________END-OF-PAGE_____statement-list__|     |
|        |__AT__|  |__EOP__________|                             |__AT__|  |__EOP__________|                        |
|___________________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

compiler-directing-statement

 _____________________________________________________ 
|                                                     |
| >>_____basis-statement___________________________>< |
|     |__cbl-process-statement__________________|     |
|     |__control-cbl-statement__________________|     |
|     |__copy-statement_________________________|     |
|     |__delete-compiler-directing-statement____|     |
|     |__eject-statement________________________|     |
|     |__enter-statement________________________|     |
|     |__insert-statement_______________________|     |
|     |__ready-or-reset-trace-statement_________|     |
|     |__replace-statement______________________|     |
|     |__replace-statement______________________|     |
|     |__service-label-statement________________|     |
|     |__service-reload-statement_______________|     |
|     |__skip1-2-3-statement____________________|     |
|     |__title-statement________________________|     |
|     |__use-statement__________________________|     |
|_____________________________________________________|

EBNF    Uses    Top    Help

basis-statement

 ________________________________________________________ 
|                                                        |
| >>_________________________BASIS_____basis-name_____>< |
|     |__sequence-number__|         |__literal_____|     |
|________________________________________________________|

EBNF    Uses    Top    Help

cbl-process-statement

 ___________________________________________ 
|                                           |
| >>_____CBL_____________________________>< |
|     |__PROCESS__|  |__options-list__|     |
|___________________________________________|

EBNF    Uses    Top    Help

control-cbl-statement

 ______________________________________________________ 
|                                                      |
|                     <_________________               |
| >>_____*CONTROL__________SOURCE_______|___________>< |
|     |__*CBL______|    |__NOSOURCE__|     |__.__|     |
|                       |__LIST______|                 |
|                       |__NOLIST____|                 |
|                       |__MAP_______|                 |
|                       |__NOMAP_____|                 |
|______________________________________________________|

EBNF    Uses    Top    Help

copy-statement

 ___________________________________________________________________ 
|                                                                   |
| >>__COPY_____text-name__________________________________________> |
|           |__literal____|  |_____OF________library-name_____|     |
|                               |__IN__|  |__literal_______|        |
| >_______________________________________________________________> |
|     |__SUPPRESS__|                                                |
| >_________________________________________________________.____>< |
|     |             <_________________________________   |          |
|     |__REPLACING____copy-operand__BY__copy-operand__|__|          |
|___________________________________________________________________|

EBNF    Uses    Top    Help

delete-compiler-directing-statement

 ______________________________________________________________ 
|                                                              |
| >>_________________________DELETE__sequence-number-field__>< |
|     |__sequence-number__|                                    |
|______________________________________________________________|

EBNF    Uses    Top    Help

eject-statement

 ________________________ 
|                        |
| >>__EJECT___________>< |
|            |__.__|     |
|________________________|

EBNF    Uses    Top    Help

enter-statement

 _____________________________________________________ 
|                                                     |
| >>__ENTER__language-name______________________.__>< |
|                           |__routine-name__|        |
|_____________________________________________________|

EBNF    Uses    Top    Help

insert-statement

 ______________________________________________________________ 
|                                                              |
| >>_________________________INSERT__sequence-number-field__>< |
|     |__sequence-number__|                                    |
|______________________________________________________________|

EBNF    Uses    Top    Help

ready-or-reset-trace-statement

 _______________________________ 
|                               |
| >>_____READY_____TRACE__.__>< |
|     |__RESET__|               |
|_______________________________|

EBNF    Uses    Top    Help

replace-statement

 _____________________________________________________________________ 
|                                                                     |
|              <_____________________________________________         |
| >>__REPLACE____quoted-pseudo-text__BY__quoted-pseudo-text__|__.__>< |
|_____________________________________________________________________|

 _________________________ 
|                         |
| >>__REPLACE__OFF__.__>< |
|_________________________|

EBNF    Uses    Top    Help

service-label-statement

 ________________________ 
|                        |
| >>__SERVICE__LABEL__>< |
|________________________|

EBNF    Uses    Top    Help

service-reload-statement

 _____________________________________ 
|                                     |
| >>__SERVICE__RELOAD__identifier__>< |
|_____________________________________|

EBNF    Uses    Top    Help

skip-statement

 ______________________________ 
|                              |
| >>_____SKIP1______________>< |
|     |__SKIP2__|  |__.__|     |
|     |__SKIP3__|              |
|______________________________|

EBNF    Uses    Top    Help

title-statement

 _________________________________ 
|                                 |
| >>__TITLE__literal___________>< |
|                     |__.__|     |
|_________________________________|

EBNF    Uses    Top    Help

use-statement

 ______________________________________________________________________________ 
|                                                                              |
| >>__USE________________AFTER_____________________EXCEPTION_____PROCEDURE___> |
|          |__GLOBAL__|         |__STANDARD__|  |__ERROR______|                |
|                  <____________                                               |
| >__________________file-name__|___________________________________________>< |
|     |__ON__|  |__INPUT___________|                                           |
|               |__OUTPUT__________|                                           |
|               |__I-O_____________|                                           |
|               |__EXTEND__________|                                           |
|                                                                              |
|______________________________________________________________________________|

 ____________________________________________________________________________ 
|                                                                            |
| >>__USE________________AFTER_____________________________________________> |
|          |__GLOBAL__|         |__STANDARD__|  |_____BEGINNING_____|        |
|                                                  |__ENDING_____|           |
|                                                      <____________         |
| >_____________________LABEL__PROCEDURE_________________file-name__|_____>< |
|     |_____FILE_____|                    |__ON__|  |__INPUT___________|     |
|        |__REEL__|                                 |__OUTPUT__________|     |
|        |__UNIT__|                                 |__I-O_____________|     |
|                                                   |__EXTEND__________|     |
|                                                                            |
|____________________________________________________________________________|

 ________________________________________________________________________ 
|                                                                        |
|                                             <_________________         |
| >>__USE_____________DEGUGGING_________________procedure-name__|_____>< |
|          |__FOR__|             |__ON__|  |__ALL__PROCEDURES______|     |
|                                                                        |
|________________________________________________________________________|

EBNF    Uses    Top    Help

condition

 ______________________________________ 
|                                      |
| >>_____combinable-condition_______>< |
|     |__combined-conditions_____|     |
|______________________________________|

EBNF    Uses    Top    Help

combinable-condition

 ________________________________________________________ 
|                                                        |
| >>_____simple-condition_____________________________>< |
|     |__negated-simple-conditions_________________|     |
|     |__abbreviated-combined-relation-conditions__|     |
|________________________________________________________|

EBNF    Uses    Top    Help

simple-condition

 __________________________________________ 
|                                          |
| >>_____class-condition________________>< |
|     |__condition-name-condition____|     |
|     |__relation-condition__________|     |
|     |__sign-condition______________|     |
|     |__switch-status-condition_____|     |
|     |__(__condition__)_____________|     |
|__________________________________________|

EBNF    Uses    Top    Help

class-condition

 _________________________________________________________________ 
|                                                                 |
| >>__identifier__________________________NUMERIC______________>< |
|                 |__IS__|  |__NOT__|  |__ALPHABETIC________|     |
|                                      |__ALPHABETIC-LOWER__|     |
|                                      |__ALPHABETIC-UPPER__|     |
|                                      |__class-name________|     |
|                                      |__DBCS______________|     |
|                                      |__KANJI_____________|     |
|_________________________________________________________________|

EBNF    Uses    Top    Help

condition-name-condition

 __________________________________ 
|                                  |
| >>__condition-name-reference__>< |
|__________________________________|

EBNF    Uses    Top    Help

relation-condition

 ____________________________________________________ 
|                                                    |
| >>__arithmetic-expression__relational-operator___> |
| >___arithmetic-expression_______________________>< |
|____________________________________________________|

EBNF    Uses    Top    Help

relational-operator

 __________________________________________________________ 
|                                                          |
| >>_____________________________________________________> |
|     |__IS__|                                             |
| >____________________GREATER__________________________>< |
|     |  |__NOT__|  |           |__THAN__|  |        |     |
|     |             |__>____________________|        |     |
|     |             |__LESS_________________|        |     |
|     |             |        |__THAN__|     |        |     |
|     |             |__<____________________|        |     |
|     |             |__EQUAL________________|        |     |
|     |             |         |__TO__|      |        |     |
|     |             |__=____________________|        |     |
|     |__GREATER______________OR__EQUAL______________|     |
|     |           |__THAN__|             |__TO__|    |     |
|     |__>=__________________________________________|     |
|     |__LESS______________OR__EQUAL_________________|     |
|     |        |__THAN__|             |__TO__|       |     |
|     |__<__=________________________________________|     |
|__________________________________________________________|

EBNF    Uses    Top    Help

sign-condition

 ____________________________________________________________________ 
|                                                                    |
| >>__arithmetic-expression__________________________POSITIVE_____>< |
|                            |__IS__|  |__NOT__|  |__NEGATIVE__|     |
|                                                 |__ZERO______|     |
|____________________________________________________________________|

EBNF    Uses    Top    Help

switch-status-condition

 __________________________________ 
|                                  |
| >>__condition-name-reference__>< |
|__________________________________|

EBNF    Uses    Top    Help

negated-simple-conditions

 ________________________ 
|                        |
| >>__NOT__condition__>< |
|________________________|

EBNF    Uses    Top    Help

abbreviated-combined-relation-conditions

 ____________________________ 
|                            |
| >>__relation-condition___> |
| >___abbreviation-rest___>< |
|____________________________|

 ___________________________________________________________________ 
|                                                                   |
| >>__arithmetic-expression__relational-operator__________________> |
| >___(_____________arithmetic-expression__abbreviation-rest__)__>< |
|        |__NOT__|                                                  |
|___________________________________________________________________|

 _______________________________________________________________________________________________________________ 
|                                                                                                               |
| >>__arithmetic-expression__(_____________relational-operator__arithmetic-expression__abbreviation-rest__)__>< |
|                               |__NOT__|                                                                       |
|_______________________________________________________________________________________________________________|

EBNF    Uses    Top    Help

abbreviation-rest

 _________________________________________________________________________________ 
|                                                                                 |
|     <_____________________________________________________________________      |
| >>_______AND___________________________________________abbreviation-leaf__|__>< |
|       |__OR___|  |__NOT__|  |__relational-operator__|                           |
|_________________________________________________________________________________|

EBNF    Uses    Top    Help

abbreviation-leaf

 ______________________________________________________________ 
|                                                              |
| >>_____arithmetic-expression______________________________>< |
|     |__(__arithmetic-expression__abbreviation-rest__)__|     |
|______________________________________________________________|

EBNF    Uses    Top    Help

combined-conditions

 ____________________________________________________________________ 
|                                                                    |
|                           <__________________________________      |
| >>__combinable-condition_______AND_____combinable-condition__|__>< |
|                             |__OR___|                              |
|____________________________________________________________________|

EBNF    Uses    Top    Help

procedure-name

 ______________________________________________________ 
|                                                      |
| >>__paragraph-name________________________________>< |
|                     |_____IN_____section-name__|     |
|                        |__OF__|                      |
|______________________________________________________|

 ______________________ 
|                      |
| >>__section-name__>< |
|______________________|

EBNF    Uses    Top    Help

identifier

 __________________________________________________________________ 
|                                                                  |
| >>__qualified-data-name________________________________________> |
|                          |  <__________________   |              |
|                          |____(__subscript__)__|__|              |
| >_____________________________________________________________>< |
|     |__(__leftmost-character-position__:________________)__|     |
|                                           |__length__|           |
|__________________________________________________________________|

 ___________________________________________________ 
|                                                   |
| >>__LINAGE-COUNTER_____________________________>< |
|                     |_____IN_____file-name__|     |
|                        |__OF__|                   |
|___________________________________________________|

EBNF    Uses    Top    Help

qualified-data-name

 ______________________________________________________________________________ 
|                                                                              |
| >>__data-name_____________________________________________________________>< |
|                |  <______________________   |  |_____IN_____file-name__|     |
|                |_______IN_____data-name__|__|     |__OF__|                   |
|                     |__OF__|                                                 |
|______________________________________________________________________________|

 __________________________ 
|                          |
| >>__special-register__>< |
|__________________________|

EBNF    Uses    Top    Help

length

 _______________________________ 
|                               |
| >>__arithmetic-expression__>< |
|_______________________________|

EBNF    Uses    Top    Help

leftmost-character-position

 _______________________________ 
|                               |
| >>__arithmetic-expression__>< |
|_______________________________|

EBNF    Uses    Top    Help

condition-name-reference

 _______________________________________________________________ 
|                                                               |
| >>__condition-name__________________________________________> |
|                     |  <______________________   |            |
|                     |_______IN_____data-name__|__|            |
|                          |__OF__|                             |
| >__________________________________________________________>< |
|     |_____IN_____file-name__|  |  <__________________   |     |
|        |__OF__|                |____(__subscript__)__|__|     |
|_______________________________________________________________|

 ____________________________________________________________ 
|                                                            |
| >>__condition-name______________________________________>< |
|                     |  <__________________________   |     |
|                     |_______IN_____mnemonic-name__|__|     |
|                          |__OF__|                          |
|____________________________________________________________|

EBNF    Uses    Top    Help

subscript

 ________________________________________________________________ 
|                                                                |
|     <____________________________________________________      |
| >>_______integer_________________________________________|__>< |
|       |__qualified-data-name__________________________|        |
|       |                       |_____+_____integer__|  |        |
|       |                          |__-__|              |        |
|       |__index-name___________________________________|        |
|                      |_____+_____integer__|                    |
|                         |__-__|                                |
|________________________________________________________________|

EBNF    Uses    Top    Help

arithmetic-expression

 __________________________________________________ 
|                                                  |
| >>__times-div_________________________________>< |
|                |  <_____________________   |     |
|                |_______+_____times-div__|__|     |
|                     |__-__|                      |
|__________________________________________________|

EBNF    Uses    Top    Help

times-div

 __________________________________________ 
|                                          |
| >>__power_____________________________>< |
|            |  <_________________   |     |
|            |_______*_____power__|__|     |
|                 |__/__|                  |
|__________________________________________|

EBNF    Uses    Top    Help

power

 ____________________________________________________ 
|                                                    |
| >>_________________basis________________________>< |
|     |_____+_____|         |  <____________   |     |
|        |__-__|            |____**__basis__|__|     |
|____________________________________________________|

EBNF    Uses    Top    Help

basis

 ___________________________________________ 
|                                           |
| >>_____identifier______________________>< |
|     |__literal______________________|     |
|     |__(__arithmetic-expression__)__|     |
|___________________________________________|

EBNF    Uses    Top    Help

copy-operand

 __________________________________ 
|                                  |
| >>_____quoted-pseudo-text_____>< |
|     |__identifier__________|     |
|     |__literal_____________|     |
|     |__cobol-word__________|     |
|__________________________________|

EBNF    Uses    Top    Help

mode

 _________________ 
|                 |
| >>_____F_____>< |
|     |__V__|     |
|     |__U__|     |
|     |__S__|     |
|_________________|

EBNF    Uses    Top    Help

alphabet-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

class-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

condition-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

data-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

file-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

index-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

mnemonic-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

record-name

 _____________________________ 
|                             |
| >>__qualified-data-name__>< |
|_____________________________|

EBNF    Uses    Top    Help

routine-name

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

symbolic-character

 ______________________________________ 
|                                      |
| >>__alphabetic-user-defined-word__>< |
|______________________________________|

EBNF    Uses    Top    Help

library-name

 ___________________________ 
|                           |
| >>__user-defined-word__>< |
|___________________________|

EBNF    Uses    Top    Help

program-name

 ___________________________ 
|                           |
| >>__user-defined-word__>< |
|___________________________|

EBNF    Uses    Top    Help

text-name

 ___________________________ 
|                           |
| >>__user-defined-word__>< |
|___________________________|

EBNF    Uses    Top    Help

paragraph-name

 ___________________________ 
|                           |
| >>__user-defined-word__>< |
|___________________________|

EBNF    Uses    Top    Help

section-name

 ___________________________ 
|                           |
| >>__user-defined-word__>< |
|___________________________|

EBNF    Uses    Top    Help

computer-name

 _____________________ 
|                     |
| >>__system-name__>< |
|_____________________|

EBNF    Uses    Top    Help

language-name

 _____________________ 
|                     |
| >>__system-name__>< |
|_____________________|

EBNF    Uses    Top    Help

environment-name

 _____________________ 
|                     |
| >>__system-name__>< |
|_____________________|

EBNF    Uses    Top    Help

assignment-name

 _____________________ 
|                     |
| >>__system-name__>< |
|_____________________|

EBNF    Uses    Top    Help

basis-name

 ______________________ 
|                      |
| >>__program-name__>< |
|______________________|

EBNF    Uses    Top    Help

figurative-constant

 ______________________________ 
|                              |
| >>_____ZERO_______________>< |
|     |__ZEROS___________|     |
|     |__ZEROES__________|     |
|     |__SPACE___________|     |
|     |__SPACES__________|     |
|     |__HIGH-VALUE______|     |
|     |__HIGH-VALUES_____|     |
|     |__LOW-VALUE_______|     |
|     |__LOW-VALUES______|     |
|     |__QUOTE___________|     |
|     |__QUOTES__________|     |
|     |__ALL__literal____|     |
|     |__NULL____________|     |
|     |__NULLS___________|     |
|______________________________|

EBNF    Uses    Top    Help

literal

 ___________________________________ 
|                                   |
| >>_____nonnumeric______________>< |
|     |__numeric______________|     |
|     |__dbcs_________________|     |
|     |__figurative-constant__|     |
|___________________________________|

EBNF    Uses    Top    Help

special-register

 ________________________________________ 
|                                        |
| >>_____ADDRESS__OF__data-name_______>< |
|     |__DEBUG-ITEM________________|     |
|     |__LENGTH__OF__identifier____|     |
|     |__RETURN-CODE_______________|     |
|     |__SHIFT-OUT_________________|     |
|     |__SHIFT-IN__________________|     |
|     |__SORT-CONTROL______________|     |
|     |__SORT-CORE-SIZE____________|     |
|     |__SORT-FILE-SIZE____________|     |
|     |__SORT-MESSAGE______________|     |
|     |__SORT-MODE-SIZE____________|     |
|     |__SORT-RETURN_______________|     |
|     |__TALLY_____________________|     |
|     |__WHEN-COMPILED_____________|     |
|________________________________________|

EBNF    Uses    Top    Help


Copyright

Copyright (c) 1999-2003, Ralf Lämmel & Chris Verhoef.
All rights reserved.

Permission is hereby granted by Ralf Lämmel and Chris Verhoef (the "Copyright holders"), free of charge, to any person obtaining a copy of this software in source code or binary form and associated files (the "Distribution"), to deal in the Distribution without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Distribution, and to permit persons to whom the Distribution is furnished to do so, subject to the following conditions:

DISCLAIMER

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


End Of Grammar