ID | IDENTIFICATION DIVISION.
PROGRAM-ID. <30-char-unreserved-alphanumeric-name>
[ RECURSIVE | INITIAL [COMMON] [PROGRAM]].
[ AUTHOR. <comment entry>
DATE-WRITTEN. <comment entry>
DATE-COMPILED. <comment entry>
INSTALLATION. <comment entry>
SECURITY. <comment entry>
]
ENVIRONMENT DIVISION.
[CONFIGURATION SECTION.
[ SOURCE - COMPUTER. <computer name> ]
[ OBJECT-COMPUTER. <Computer-name>
[PROGRAM COLLATING SEQUENCE IS <alphabet name1>] .|
| SPECIAL-NAMES.
[DECIMAL-POINT IS COMMA]
[CURRENCY SIGN IS <“unreserved capital alphabet character (not ABCDEGPRSVXZ)”>]
[CLASS <user def name data name> IS <literal1> THRU <literal1>]*
[(SYSIN/SYSOUT/SYSLST/CONSOLE IS <data name 2>)*
[ON STATUS IS <condition1> OFF STATUS IS <condition2>]]*
[ALPHABET <alphabet name1> IS NATIVE/EBCDIC/STANDARD-1/STANDARED-2
/ (one char alphabet1 THRU/ (ALSO one char alphabet2)*)* ]*
[SYMBOLIC CHARACTERS (<one char alphabet> IS <ord integer>)*[IN <alphabet name1>]] . | ]
[INPUT-OUTPUT SECTION.
| FILE-CONTROL.
((SELECT [OPTIONAL] <filename> ASSIGN TO [<label>][S-] AS- <JCL variable>)*
[RESERVE >integer> AREAS]
| ORGANIZATION IS [SEQUENTIAL]/RELATIVE/INDEXED |
| ACCESS MODE IS [SEQUENTIAL]/RANDOM/DYNAMIC |
|RELATIVE/RECORD KEY <alphanumeric data filed>|
[ALTERNATIVE RECORD KEY < alphanumeric record field> [WITH DUPLICATES]*
[PASSWORD IS <literal/data name>]
[FILE STATUS IS <2 byte alphanumeric data item>, <6 byte group data item>] )*. |
[I-O-CONTROL.
[SAME RECORD AREA FOR (<VSAM-filename>)*] . ] ]
]
[
DATA DIVISION.
[FILE SECTION.
| (FD <filename> [EXTERNAL] [GLOBAL]
[BLOCK CONTAINS 0 RECORDS]
| RECODING MODE F/V/S/U |
[LINAGE IS <integer 2/dataname 2> LINES WITH FOOTING <integer3/dataname3>
TOP <integer4/dataname 4> BOTTOM <integer 5/dataname5>]
[CODE-SET IS <alphabet name1>] )* | ]
WORKING-STORAGE SECTION.
Data Description Entry
data-description-entry | = | level-number [(data-name|"FILLER")] data-description-entry-clauses"." |
data-description-entry | = | "66"data-namerenames-clause"." |
data-description-entry | = | "88"condition-namecondition-value-clause"." |
redefines-clause | = | "REDEFINES"data-name |
blank-when-zero-clause | = | "BLANK"["WHEN"]("ZERO"|"ZEROS"|"ZEROES") |
justified-clause | = | ("JUSTIFIED"|"JUST")["RIGHT"] |
sign-clause | = | ["SIGN"["IS"]]("LEADING"|"TRAILING")["SEPARATE"["CHARACTER"]] |
synchronized-clause | = | ("SYNCHRONIZED"|"SYNC")[("LEFT"|"RIGHT")] |
condition-value-clause | = | ("VALUE"["IS"]|"VALUES"["ARE"]){literal[("THROUGH"|"THRU")literal]}+ |
data-value-clause | = | "VALUE"["IS"]literal |
PROCEDURE DIVISION.
procedure-division
accept-statement | = | "ACCEPT"identifier"FROM"("DATE"|"DAY"|"DAY-OF-WEEK"|"TIME") |
close-statement | = | "CLOSE" |
| | {file-name[(("REEL"|"UNIT")[(["FOR"]"REMOVAL"|["WITH"]"NO""REWIND")]| ["WITH"]("NO""REWIND"|"LOCK"))]}+ |
close-statement | = | "CLOSE"{file-name[["WITH"]"LOCK"]}+ |
continue-statement | = | "CONTINUE" |
exit-program-statement | = | "EXIT""PROGRAM" |
goback-statement | = | "GOBACK" |
go-to-statement | = | "GO"["TO"]"MORE-LABELS" |
initialize-statement | = | "INITIALIZE"{identifier}+ |
| | ["REPLACING"{("ALPHABETIC"|"ALPHANUMERIC"|"NUMERIC" "ALPHANUMERIC-EDITED"|"NUMERIC-EDITED"|"DBCS"|"EGCS")["DATA"]"BY"(identifier|literal)}+] |
perform-until-phrase | = | [["WITH"]"TEST"("BEFORE"|"AFTER")]"UNTIL"condition |
stop-statement | = | "STOP"("RUN"|literal) |
control-cbl-statement | = | ("*CONTROL"|"*CBL"){("SOURCE"|"NOSOURCE"|"LIST"|"NOLIST"|"MAP"|"NOMAP")}+["."] |
eject-statement | = | "EJECT"["."] |
ready-or-reset-trace-statement | = | ("READY"|"RESET")"TRACE""." |
replace-statement | = | "REPLACE""OFF""." |
service-label-statement | = | "SERVICE""LABEL" |
service-reload-statement | = | "SERVICE""RELOAD"identifier |
skip1-2-3-statement | = | ("SKIP1"|"SKIP2"|"SKIP3")["."] |
title-statement | = | "TITLE"literal["."] |
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") |
class-condition | = | identifier["IS"]["NOT"]("NUMERIC"|"ALPHABETIC"|"ALPHABETIC-LOWER"|"ALPHABETIC-UPPER"|class-name|"DBCS"|"KANJI") |
relational-operator | = | ["IS"] |
| | (["NOT"]("GREATER"["THAN"]|">"|"LESS"["THAN"]|"<"|"EQUAL"["TO"]|"=") |
| | |"GREATER"["THAN"]"OR""EQUAL"["TO"] |
| | |">=" |
| | |"LESS"["THAN"]"OR""EQUAL"["TO"] |
| | |"<""=") |
identifier | = | "LINAGE-COUNTER"[("IN"|"OF")file-name] |
figurative-constant | = | ("ZERO"|"ZEROS"|"ZEROES" |
| | |"SPACE"|"SPACES" |
| | |"HIGH-VALUE"|"HIGH-VALUES" |
| | |"LOW-VALUE"|"LOW-VALUES" |
| | |"QUOTE"|"QUOTES" |
| | |"ALL"literal |
| | |"NULL"|"NULLS") |
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") |