COBOL has many reserved words, and the set depends on the standard and on the compiler. A reserved word cannot be a user-defined name; using one is an error, which is why old programs break when a compiler grows new words. Words are case-insensitive. The lists here are the words the viewer colours; they are not a copy of any vendor’s official list.
How large the lists are
| Source | Reserved words |
|---|---|
| COBOL-74 / COBOL-85 | Several hundred, including words reserved for optional modules (the standards’ own tables; not counted here) |
| COBOL 2002 / 2014 | More again, with words for classes, exceptions, report writer and screens; the 2014 list says which module each word belongs to (not counted here) |
| IBM Enterprise COBOL | Its own list in the Language Reference, in the order of its appendix; not copied here |
| GnuCOBOL 3.1 | More than 1,100 words counting intrinsic functions, mnemonics, system names and the GUI and screen words, of which many exist only to be accepted. The set changes with -std= and -freserved= / -fno-reserved=; cobc --list-reserved prints it |
| Micro Focus | Its own list per dialect directive; $SET REMOVE(word) and ADDRSV / ADDSYN edit it |
The standards’ reserved-word tables were not available to me, so the viewer list below was built from the GnuCOBOL Programmer’s Guide’s list and from the words of the IBM, Micro Focus and 2002 features this page’s sources mention.
Words the viewer colours as keywords
accept access acquire add address advancing after all allocate alphabet alphabetic alphabetic-lower
alphabetic-upper alphanumeric alphanumeric-edited also alter alternate and any are area areas as ascending
ascii assign at author automatic based before beginning bit blank block bottom by call cancel cd cf ch
character characters chaining class class-id clock-units close cobol code code-set collating column comma
commit common communication compute condition configuration constant contains content continue control
controls converting corr corresponding count crt currency cursor data date date-compiled date-modified
date-written day day-of-week de debugging decimal-point declaratives default delete delimited delimiter
depending descending destination detail disable display divide division down duplicates dynamic ebcdic ec
egi else emi enable encoding end end-accept end-add end-call end-chain end-compute end-delete end-display
end-divide end-evaluate end-exec end-if end-invoke end-json end-multiply end-of-page end-perform end-read
end-receive end-return end-rewrite end-search end-send end-start end-string end-subtract end-unstring
end-write end-xml enter entry environment environment-name environment-value eop equal error escape esi
evaluate every exception exclusive exec execute exhibit exit extend external factory fd file file-control
file-id filler final first footing for format forever free from function function-id generate get giving
global go goback greater group heading i-o i-o-control id identification if ignore ignoring implements in
indexed indicate inherits initial initialise initialize initialised initialized initiate input
input-output inspect installation interface interface-id into invalid invoke is just justified kanji key
keyboard label last leading left length less limit limits linage line lines linkage local-storage locale
lock lower memory merge message method method-id minus mode module modules move multiple multiply native
negative nested new next no not note nothing number numbers numeric numeric-edited object object-computer
occurs of off omitted on only open optional or order organisation organization other output overflow
override packed-decimal padding page paragraph perform pf ph pic picture plus position positive present
printing procedure procedures proceed process program program-id prompt prototype purge queue raise raising
rd read ready receive record recording records recursive redefines reel reference references relative
release reload remainder remarks removal renames replace replacing report reporting reports repository
rerun reserve reset resume retry return returning reversed rewind rewrite rf rh right rounded run same
screen sd search section secure security segment segment-limit select self send sentence separate sequence
sequential service set sharing sign signed size skip1 skip2 skip3 sort sort-merge source source-computer
sources special-names standard standard-1 standard-2 start status step stop string sub-queue-1 sub-queue-2
sub-queue-3 subtract sum super suppress symbolic sync synchronised synchronized table tallying tape terminal
terminate test text than then through thru time times to top trace trailing transform type typedef unit
universal unlock unsigned unstring until up update upon usage use user using validate validating value
values varying when with words working-storage write xml xor b-and b-or b-xor b-not b-shift-l b-shift-r
b-shift-lc b-shift-rc background-color foreground-color highlight lowlight underline blink bell beep erase
eol eos auto auto-skip required full reverse-video json eject examine apply intrinsic try catch finally
throw declare end-try
COPY and REPLACE are coloured as directives. After FUNCTION any word is a function name, and the names after
PROGRAM-ID, FUNCTION-ID, METHOD-ID, CLASS-ID and INTERFACE-ID are program, function, method and class names.
Figurative constants
zero zeros zeroes space spaces high-value high-values low-value low-values quote quotes null nulls true false
Usage names and special registers
binary binary-char binary-short binary-long binary-double binary-c-long binary-int binary-long-long
comp comp-0 comp-1 comp-2 comp-3 comp-4 comp-5 comp-6 comp-9 comp-10 comp-15 comp-n comp-x
computational computational-0 … computational-6 computational-n computational-x display-1 index pointer
procedure-pointer function-pointer program-pointer object-reference national national-edited float
float-short float-long float-extended float-binary-32 float-binary-64 float-binary-128 float-decimal-16
float-decimal-34 signed-short signed-int signed-long unsigned-short unsigned-int unsigned-long utf-8
utf-16 ucs-4 boolean
return-code sort-return tally linage-counter line-counter page-counter number-of-call-parameters
shift-in shift-out when-compiled debug-item debug-line debug-name debug-contents debug-sub-1
debug-sub-2 debug-sub-3 exception-object json-code json-status xml-code xml-event xml-text xml-ntext
xml-namespace xml-nnamespace xml-namespace-prefix xml-nnamespace-prefix cob-crt-status crt-status
sort-control sort-core-size sort-file-size sort-message sort-mode-size special-registers
Context-sensitive and optional words
- Some words are reserved only in one place. GnuCOBOL lists
AUTHOR,DATE-COMPILED,DATE-MODIFIED,DATE-WRITTEN,INSTALLATION,REMARKSandSECURITYas such (paragraph headers whose text is a comment). Many words of the 2002 and 2014 standards are context-sensitive (ENTRY-CONVENTION,SELF…). - GnuCOBOL accepts the screen and GUI words of ACUCOBOL-GT (
BITMAP,CHECK-BOX,COMBO-BOX,LIST-BOX,PUSH-BUTTON,RADIO-BUTTON,SCROLL-BAR,TREE-VIEW,WEB-BROWSER,WINDOWand dozens of attribute words); they are marked as extensions in its list and are not coloured as keywords here. - Device and feature names (system names) of GnuCOBOL:
SYSIN,SYSIPT,STDIN,SYSOUT,SYSLIST,SYSLST,SYSPCH,SYSPUNCH,STDOUT,PRINT,PRINTER,PRINTER-1,SYSERR,STDERR,CONSOLE,C01toC12,S01toS05,CSP,FORMFEED,TOP,SWITCH-0toSWITCH-36. They are not coloured specially. - Compilers let a program turn off words it uses as names: IBM does not; GnuCOBOL with
-fno-reserved=word; Micro Focus with$SET REMOVE(word).
Function names
Intrinsic function names are not reserved in the same way: they live in their own name space and are written after FUNCTION. They are on
Intrinsic functions.