Rm/Cobol: Syntax Summary
Rm/Cobol: Syntax Summary
RM/COBOL
Syntax Summary
First Edition
This document provides complete syntax for all RM/COBOL commands, divisions, entries, statements, and other
general formats. Use this pamphlet in conjunction with the RM/COBOL Language Reference Manual and the
RM/COBOL User's Guide.
The RM/COBOL Syntax Summary has been prepared for all implementations of RM/COBOL. Consult the
RM/COBOL User's Guide for all appropriate operating system rules and conventions (such as command line
invocation).
No part of this publication may be reproduced, stored in a retrieval system or transmitted, in any form or by any
means, electronic, mechanical, photocopied, recorded, or otherwise, without prior written permission of Liant
Software Corporation.
The information in this document is subject to change without prior notice. Liant Software Corporation assumes no
responsibility for any errors that may appear in this document. Liant reserves the right to make improvements and/or
changes in the products and programs described in this guide at any time without notice. Companies, names, and data
used in examples herein are fictitious unless otherwise noted.
The software described in this document is furnished to the user under a license for a specific number of uses and
may be copied (with inclusion of the copyright notice) only in accordance with the terms of such license.
Copyright 1985-2005 by Liant Software Corporation. All rights reserved. Printed in U.S.A.
(512) 343-1010
(800) 762-6265
(512) 343-9487
http://www.liant.com/
Document
Part Number
Applies To
Product Version
Publication
Date
401225
January 2005
Contents
Contents
Compile Command............................................................................................................. 1
Runtime Command............................................................................................................. 3
Debug Commands .............................................................................................................. 4
Source Program General Format ........................................................................................ 6
Identification Division General Format.............................................................................. 6
Environment Division General Format .............................................................................. 7
File Control Entry General Formats .......................................................................... 10
Data Division General Format.......................................................................................... 12
file-description-entry................................................................................................. 13
sort-merge-file-description-entry .............................................................................. 13
record-description-entry ............................................................................................ 14
77-level-description-entry ......................................................................................... 14
data-description-entry................................................................................................ 14
communication-description-entry.............................................................................. 16
screen-description-entry ............................................................................................ 17
Procedure Division General Formats ............................................................................... 21
General Formats for COBOL Statements......................................................................... 22
ACCEPT Statement................................................................................................... 22
ADD Statement ......................................................................................................... 24
ALTER Statement ..................................................................................................... 25
CALL Statement ....................................................................................................... 25
CALL PROGRAM Statement................................................................................... 26
CANCEL Statement.................................................................................................. 26
CLOSE Statement ..................................................................................................... 26
COMPUTE Statement............................................................................................... 27
CONTINUE Statement.............................................................................................. 27
DELETE Statement................................................................................................... 27
DELETE FILE Statement ......................................................................................... 27
DISABLE Statement ................................................................................................. 27
DISPLAY Statement ................................................................................................. 28
DIVIDE Statement .................................................................................................... 29
ENABLE Statement .................................................................................................. 30
ENTER Statement ..................................................................................................... 30
EVALUATE Statement............................................................................................. 31
EXIT Statement......................................................................................................... 32
GOBACK Statement ................................................................................................. 32
GO TO Statement...................................................................................................... 32
Contents
IF Statement .............................................................................................................. 33
INITIALIZE Statement ............................................................................................. 33
INSPECT Statement.................................................................................................. 33
MERGE Statement.................................................................................................... 34
MOVE Statement ...................................................................................................... 35
MULTIPLY Statement.............................................................................................. 35
OPEN Statement ....................................................................................................... 36
PERFORM Statement ............................................................................................... 36
PURGE Statement..................................................................................................... 37
READ Statement ....................................................................................................... 37
RECEIVE Statement ................................................................................................. 38
RELEASE Statement ................................................................................................ 38
RETURN Statement.................................................................................................. 38
REWRITE Statement ................................................................................................ 39
SEARCH Statement .................................................................................................. 39
SEND Statement ....................................................................................................... 40
SET Statement........................................................................................................... 40
SORT Statement........................................................................................................ 41
START Statement ..................................................................................................... 42
STOP Statement ........................................................................................................ 42
STRING Statement ................................................................................................... 43
SUBTRACT Statement ............................................................................................. 43
UNLOCK Statement ................................................................................................. 44
UNSTRING Statement.............................................................................................. 44
USE Statement .......................................................................................................... 44
WRITE Statement ..................................................................................................... 45
General Format for END PROGRAM Header ................................................................. 46
General Formats for COPY and REPLACE Statements .................................................. 46
General Formats for Conditions ....................................................................................... 47
Relation Condition .................................................................................................... 47
LIKE Condition (Special Case of a Relation Condition) .......................................... 47
Class Condition ......................................................................................................... 47
Sign Condition........................................................................................................... 48
Condition-Name Condition ....................................................................................... 48
Switch-Status Condition............................................................................................ 48
Negated Condition..................................................................................................... 48
Combined Condition ................................................................................................. 48
Abbreviated Combined Relation Condition .............................................................. 48
General Formats for Qualification.................................................................................... 49
Miscellaneous Formats..................................................................................................... 50
Sentence .................................................................................................................... 50
Statement Sequence................................................................................................... 50
Subscripting............................................................................................................... 50
Reference Modification............................................................................................. 50
vi
Contents
Identifier.................................................................................................................... 50
Special Registers ....................................................................................................... 51
Figurative-Constants ................................................................................................. 52
Concatenation Expression ......................................................................................... 52
Constant-Expression.................................................................................................. 52
General Format for Nested Source Programs ................................................................... 53
General Format for nested-source-program..................................................................... 53
General Format for a Sequence of Source Programs........................................................ 54
PICTURE Clause ............................................................................................................. 55
PICTURE Character-Strings ..................................................................................... 55
PICTURE Symbols ................................................................................................... 56
Reserved Words ............................................................................................................... 60
Context-Sensitive Words.................................................................................................. 65
Nonreserved System-Names............................................................................................. 67
Code-Names .............................................................................................................. 67
(Color-Integer) Color-Names .................................................................................... 67
Computer-Names ...................................................................................................... 67
Delimiter-Names ....................................................................................................... 67
Device-Names ........................................................................................................... 67
Feature-Names .......................................................................................................... 68
Label-Names ............................................................................................................. 68
Language-Names....................................................................................................... 68
Low-Volume-I-O-Names .......................................................................................... 68
Rerun-Names............................................................................................................. 68
Switch-Names ........................................................................................................... 68
List of Tables
Table 1: PICTURE Symbol Precedence.......................................................................... 59
Table 2: Context-Sensitive Words................................................................................... 65
vii
Contents
viii
Compile Command
Compile Command
The format of the Compile Command is as follows:
rmcobol filename [[(] [[~]option] ... [)comment]]
Description
F={(keyword-list)|keyword}
INTERMEDIATE
OBSOLETE
SEG1
SEG2
H=path
L[=path]
Compile Command
Option
Description
O=path
Specify the directory pathname where the object file will be placed.
Direct the compiler to assume a separate sign when the SIGN clause
is not specified for a DISPLAY usage, signed numeric data item
(that is, for a data item whose character-string within a PICTURE
clause begins with S).
U[={B|D|P}]
W=n
Y=n
Direct the compiler to output the symbol table and debug line table
to the object program file. n can be 0 to 3.
Z=version
Runtime Command
Runtime Command
The format of the Runtime Command is as follows:
runcobol filename [option] ...
Description
B=n
Specify a maximum buffer size for use with the ACCEPT and
DISPLAY statements.
C=pathname
F=<fill-char>
L=pathname
S=n . . . n
T=n
X=pathname
Debug Commands
Debug Commands
The Debug commands are as follows.
Command
Description
Set breakpoints and resume program execution from the current location.
A [ line [ + intraline ] [ , [ prog-name ] [ , [ count ] ] ] ]
Clear any breakpoints that have been set with the A or B Command.
C [ line [ + intraline] [ , [ prog-name ] ] ]
Specify a line on the monitor screen at which command input echoes and
Debug responses are to be displayed.
L [ line-display ]
Debug Commands
Command
Description
Monitor the value of a specified data item, and suspend execution whenever a
change in that value occurs. That is, a data trap.
Identifier Format
T name-1 [ { IN | OF } name-2 ] [ script ] [ refmod ]
[ , { type | { * | & } [ type ] } ] [ # alias ]
Address-Size Format
T [ base : ] address [ + occur-size * occur-num ] , size ,
[ type ] [ # alias ]
Alias Format
T # alias
Note In the Address-Size formats for the D, M, T, and U commands, base is one of the
following:
U arg-num, for a formal argument and arg-num is the formal argument number.
B item-num, for a based linkage item and item-num is the based linkage item number.
X ext-num, for an external data item and ext-num is the external item number.
[ environment-division ]
[ data-division ]
[ procedure-division ]
[ nested-source-program ]!
[ end-program-header ]
program-name-1
PROGRAM - ID .
literal-1
COMMON
IS
PROGRAM .
INITIAL
[ AUTHOR . [ comment-entry-1 ]! ]
[ INSTALLATION . [ comment-entry-2 ]! ]
[ DATE - WRITTEN . [ comment-entry-3 ]! ]
[ DATE - COMPILED . [ comment-entry-4 ]! ]
[ SECURITY . [ comment-entry-5 ]! ]
[ REMARKS . [ comment-entry-6 ]! ]
ENVIRONMENT DIVISION .
CONFIGURATION SECTION .
[ WITH
DEBUGGING MODE
].
WORDS
MEMORY SIZE integer-1 CHARACTERS
MODULES
[ PROGRAM COLLATING
[ SEGMENT - LIMIT
SPECIAL - NAMES .
SEQUENCE IS alphabet-name-1 ]
IS segment-number-1 ]
ON STATUS IS condition-name-1
IS mnemonic-name-1
switch-name-1
ON STATUS IS condition-name-1
conditionname-2
OFF
STATUS
IS
feature-name-1 IS mnemonic-name-2
low-volume-I-O-name-1 IS mnemonic-name-3
ALPHABET alphabet-name-1 IS
STANDARD - 1
STANDARD - 2
NATIVE
code-name-1
literal-1 THROUGH literal-2
THRU
THROUGH
literal-4 !
ALSO literal-3 THRU
SYMBOLIC CHARACTER
CHARACTERS
{ integer-1 }!
[ IN
{ symbolic-character-1 }!
IS
ARE
alphabet-name-2 ] !
THRU
[ SEPARATE
CHARACTER ]
CONSOLE IS CRT
CURSOR IS data-name-1
FILE - CONTROL .
{ file-control-entry-1 }!
(continued on next page)
I - O - CONTROL .
RERUN ON
EVERY
file-name-1
rerun-name-1
REEL
[ END OF ]
UNIT OF file-name-2
integer-1 RECORDS
condition-name-1
RECORD
SAME SORT
SORT - MERGE
{ file-name-5 [ POSITION
IS integer-3
] }!
{ file-name-4 }!
[ [ NOT ]
ASSIGN TO
OPTIONAL
file-name-1
DISPLAY
INPUT
data-name-1
OUTPUT
INPUT - OUTPUT literal-1
RANDOM
TAPE
device-name-1
data-name-1
literal-1
integer-1
RESERVE NO
[ ALTERNATE ]
[ ORGANIZATION IS
BINARY
SEQUENTIAL
LINE
RELATIVE
INDEXED
AREA
AREAS
data-name-2
STANDARD - 1
RECORD DELIMITER IS delimiter-name-1
SEQUENTIAL
ACCESS
MODE
IS
RANDOM
DYNAMIC
LOCK MODE IS
MANUAL
AUTOMATIC
EXCLUSIVE
[ RELATIVE
WITH LOCK ON
KEY IS data-name-3 ]
[ MULTIPLE ]
RECORD
RECORDS
10
[ CODE - SET
IS alphabet-name-1 ]
[ COLLATING
SEQUENCE IS alphabet-name-2
data-name-4
RECORD KEY IS split-key-name-1 =
[ WITH
DUPLICATES
{ data-name-5 }!
data-name-6
ALTERNATE RECORD KEY IS split-key-name-2 =
[ WITH DUPLICATES ] !
[ FILE
STATUS IS data-name-8
{ data-name-7 }!
].
ASSIGN TO
SORT
device-name-1
data-name-1
literal-1
11
DATA DIVISION .
FILE SECTION .
file-description-entry-1 { record-description-entry-1 }!
sort-merge-file-description-entry-1 { record-description-entry-2 }! !
77-level-description-entry-1
record-description-entry-3 !
LINKAGE SECTION .
77-level-description-entry-2
record-description-entry-4 !
COMMUNICATION SECTION .
[ communication-description-entry-1 { record-description-entry-5 }! ]!
SCREEN SECTION .
[ screen-description-entry-1 ]!
12
file-description-entry
FD file-name-1
[ IS
EXTERNAL
[ IS
GLOBAL
BLOCK CONTAINS
RECORD
LABEL
[ integer-1
TO
RECORDS
integer-2
CHARACTERS
IS VARYING IN SIZE
[
DEPENDING ON data-name-1 ]
RECORD IS
RECORDS ARE
RECORD IS
RECORDS ARE
{ data-name-3 }!
integer-7
IS alphabet-name-1 ]
data-name-5
WITH FOOTING AT integer-8
data-name-6
[ CODE - SET
STANDARD
OMITTED
LABEL
data-name-2
VALUE OF
!
IS
label-name-1
literal-1
DATA
data-name-7
LINES AT BOTTOM integer-10
sort-merge-file-description-entry
SD file-name-1
RECORD
IS VARYING IN SIZE
[ DEPENDING ON data-name-1 ]
RECORD IS
{ data-name-3 }! .
13
record-description-entry
{ data-description-entry-1 }!
77-level-description-entry
data-description-entry-2
data-description-entry
Format 1: Data-Name Full Declaration
data-name-1
level-number-1
FILLER
[ REDEFINES
data-name-2
[ IS
EXTERNAL
[ IS
GLOBAL
PICTURE
IS character-string-1
PIC
[ USAGE IS
BINARY [ ( integer-3 ) ]
COMPUTATIONAL
COMP
COMPUTATIONAL - 1
COMP - 1
COMPUTATIONAL - 3
COMP - 3
COMPUTATIONAL - 4 [ ( integer-3 ) ]
COMP - 4 [ ( integer-3 ) ]
COMPUTATIONAL - 5 [ ( integer-3 ) ]
COMP - 5 [ ( integer-3 ) ]
COMPUTATIO
NAL
6
COMP - 6
DISPLAY
INDEX
PACKED - DECIMAL
POINTER
14
LEADING
[ SIGN IS ] TRAILING
[ SEPARATE
CHARACTER ]
[
]
integer-1
TO
integer-2
TIMES
DEPENDING
ON
data-name3
ASCENDING
KEY IS
DESCENDING
{ data-name-4 }! !
[ INDEXED BY { index-name-1 }! ]
SYNCHRONIZED LEFT
RIGHT
SYNC
JUSTIFIED
RIGHT
JUST
[ BLANK
WHEN ZERO ]
[ VALUE IS
literal-1 ] .
THROUGH
data-name-3
THRU
THROUGH
literal-1
literal-2
THRU
VALUE IS
VALUES ARE
relational-operator literal-1
[ WHEN
].
15
VALUE IS
constant-expression-1
communication-description-entry
Format 1: Input CD
CD cd-name-1 FOR [ INITIAL ] INPUT
Format 2: Output CD
CD cd-name-1 FOR OUTPUT
[ DESTINATION COUNT IS data-name-1 ]
[ INDEXED BY { index-name-1 }! ]
16
Format 3: Input-Output CD
CD cd-name-1 FOR [ INITIAL ] I - O
data-name-5 data-name-6
screen-description-entry
Format 1: Screen Group
screen-name-1
level-number-1
FILLER
BACKGROUND IS color-name-1
[ [ USAGE
IS
] DISPLAY ]
[ SIGN IS
] LEADING
[ SEPARATE
TRAILING
CHARACTER ]
AUTO
AUTO - SKIP
[ SECURE ]
[ REQUIRED ]
[ FULL ] .
{ screen-description-entry-1 }!
17
FILLER
BELL
BEEP
BLANK
SCREEN
LINE
REMAINDER
[ BLINK ]
ERASE
EOS
EOL
SCREEN
[ NO ] HIGHLIGHT
LOWLIGHT
REVERSE
REVERSED
REVERSE - VIDEO
[ UNDERLINE ]
BACKGROUND IS color-name-1
LINE
PLUS
integer-3
NUMBER IS +
identifier-1
COLUMN
COL
PLUS
NUMBER IS +
integer-4
identifier-2
[ [ VALUE IS ] literal-1 ] .
18
FILLER
BELL
BEEP
BLANK
SCREEN
LINE
REMAINDER
[ BLINK ]
ERASE
EOS
EOL
SCREEN
[ NO ] HIGHLIGHT
LOWLIGHT
REVERSE
REVERSED
REVERSE - VIDEO
[ UNDERLINE ]
BACKGROUND IS color-name-1
LINE
PLUS
integer-3
NUMBER IS +
identifier-1
COLUMN
COL
PLUS
NUMBER IS +
integer-4
identifier-2
identifier-7
FROM
PICTURE
literal-1
IS character-string-1
PIC
TO identifier-8
USING identifier-9
[ [ USAGE IS ] DISPLAY ]
[ BLANK
WHEN ZERO ]
19
RIGHT
JUST
[ SIGN IS
] LEADING
[ SEPARATE
TRAILING
AUTO
AUTO - SKIP
[ SECURE ]
[ REQUIRED ]
[ FULL ] .
20
CHARACTER ]
PROCEDURE DIVISION
GIVING
RETURNING data-name-2
GIVING
data-name2
RETURNING
DECLARATIVES .
{ section-name-1
SECTION
[ segment-number-1 ] .
USE-statement-1 .
paragraph-name-1 .
[ sentence-1 ]! ]! }!
END DECLARATIVES .
{ section-name-2
SECTION
[ segment-number-2 ].
paragraph-name-2 .
[ sentence-2 ] ! ] ! }!
Format 2: Paragraphs
PROCEDURE DIVISION
USING
{ data-name-1 }!
paragraph-name-3 .
[ sentence-3 ]! }!
21
ACCEPT Statement
Format 1: Accept From System-Name
mnemonic-name-3
ACCEPT identifier-1 FROM
low-volume
-I-O-name1
[ END - ACCEPT ]
ACCEPT identifier-2
22
FROM
CENTURY - DATE
CENTURY - DAY
DATE [ YYYYMMDD ]
DAY [ YYYYDDD ]
DAY - AND - TIME
DAY - OF - WEEK
ESCAPE KEY
EXCEPTION STATUS
TIME
[ END - ACCEPT ]
identifier-2
ON EXCEPTION
ESCAPE
[ identifier-9 ]
BLINK
identifier-4
CONTROL
literal-3
CONVERT
identifier-5
CURSOR
literal-4
ECHO
EOL
ERASE
EOS
HIGH
HIGHLIGHT
LOW
LOWLIGHT
SECURE
OFF
identifier-6
LINE
literal-5
AT COLUMN
identifier
-3
COL
literal-2
POSITION
MODE IS BLOCK
CHARACTER IS identifier-10
PROMPT
CHARACTER IS literal-6
REVERSE
REVERSED
REVERSE - VIDEO
identifier-7
SIZE
literal-7
TAB
identifier-8
BEFORE TIME
literal-8
UPDATE
AUTO
AUTO - SKIP
BEEP
NO
BELL
imperative-statement-1
NEXT SENTENCE
EXCEPTION
NOT ON
imperative-statement-2
ESCAPE
[ END - ACCEPT ]
23
[ END - ACCEPT ]
identifier-1
ACCEPT screen-name-1 AT
COLUMN
identifier-2
COL
NUMBER integer-2
EXCEPTION
imperative-statement-1
ON ESCAPE
EXCEPTION
imperative-statement-2
NOT ON ESCAPE
[ END - ACCEPT ]
ADD Statement
Format 1: AddTo
identifier-1
ADD
! TO
literal-1
[ ON
{ identifier-2 [ ROUNDED ] }!
[ NOT ON
[ END - ADD ]
Format 2: AddGiving
identifier-1
identifier-2
ADD
! TO literal-2
!
literal-1
GIVING
[ ON
{ identifier-3 [ ROUNDED ] }!
[ NOT ON
[ END - ADD ]
24
[ ON
[ ROUNDED ]
[ NOT ON
[ END - ADD ]
ALTER Statement
ALTER
{ procedure-name-1
TO
[ PROCEED
TO
procedure-name-2 } !
CALL Statement
Format 1: CallOn Overflow
identifier-1
CALL
literal-1
[ ON
identifier-2
[ BY REFERENCE ] OMITTED !
identifier-2
!
USING BY CONTENT literal-2
!
OMITTED
identifier
-2
literal-2
!
OMITTED
GIVING
RETURNING identifier-3
OVERFLOW imperative-statement-1 ]
[ END - CALL ]
25
identifier-1
CALL
literal-1
[ ON
identifier-2
[ BY REFERENCE ] OMITTED !
identifier-2
identifier-2
literal-2
!
OMITTED
GIVING
RETURNING identifier-3
EXCEPTION imperative-statement-1 ]
[ NOT ON
EXCEPTION imperative-statement-2
[ END - CALL ]
literal-1
[ ON
USING
identifier-2
literal-2
OMITTED
EXCEPTION imperative-statement-1 ]
[ END - CALL ]
CANCEL Statement
identifier-1
CANCEL
!
literal-1
CLOSE Statement
CLOSE file-name-1
26
!
NO REWIND
WITH
LOCK
COMPUTE Statement
{ identifier-1 [ ROUNDED ] } !
COMPUTE
[ ON
[ NOT ON
arithmetic-expression-1
[ END - COMPUTE ]
CONTINUE Statement
CONTINUE
DELETE Statement
DELETE file-name-1 RECORD
[ INVALID
[ NOT
KEY imperative-statement-1 ]
[ END - DELETE ]
{ file-name-2 }!
[ END - DELETE ]
DISABLE Statement
DISABLE
INPUT [ TERMINAL ]
I - O TERMINAL
OUTPUT
TERMINAL
identifier-1
cd-name-1 WITH KEY literal-1
27
DISPLAY Statement
Format 1: Display Upon System-Name
identifier-1
DISPLAY
!
literal-1
[ WITH
mnemonic-name-3
UPON low-volume-I-O-name-1
NO ADVANCING
DISPLAY
identifier-2
identifier-1
UNIT
WITH
literal-2
literal-1
BEEP
BELL
BLINK
identifier-4
CONTROL
literal-4
CONVERT
EOL
ERASE
EOS
HIGH
HIGHLIGHT
LOW
LOWLIGHT
identifier-5
LINE
literal-5
AT COLUMN
identifier-3
COL
literal-3
POSITION
MODE IS BLOCK
REVERSE
REVERSED
REVERSE - VIDEO
identifier-6
SIZE
literal-6
DISPLAY screen-name-1
28
identifier-1
AT
!
COLUMN
identifier-2
COL
NUMBER integer-2
DIVIDE Statement
Format 1: DivideInto
identifier-1
DIVIDE
INTO
literal-1
[ ON
{ identifier-2 [ ROUNDED ] }!
[ NOT ON
[ END - DIVIDE ]
Format 2: DivideIntoGiving
identifier-1
identifier-2
DIVIDE
INTO literal-2
literal-1
GIVING
[ ON
{ identifier-3 [ ROUNDED ] }!
[ NOT ON
[ END - DIVIDE ]
Format 3: DivideByGiving
identifier-2
DIVIDE
BY
literal-2
GIVING
[ ON
identifier-1
literal-1
{ identifier-3 [ ROUNDED ] }!
[ NOT ON
[ END - DIVIDE ]
29
Format 4: DivideIntoGivingRemainder
identifier-1
identifier-2
DIVIDE
INTO literal-2
literal-1
GIVING identifier-3
[ ON
[ ROUNDED ]
REMAINDER identifier-4
[ NOT ON
[ END - DIVIDE ]
Format 5: DivideByGivingRemainder
identifier-2
DIVIDE
BY
literal-2
GIVING identifier-3
[ ON
identifier-1
literal-1
[ ROUNDED ]
REMAINDER identifier-4
[ NOT ON
[ END - DIVIDE ]
ENABLE Statement
ENABLE
INPUT [ TERMINAL ]
I - O TERMINAL
OUTPUT
TERMINAL
identifier-1
cd-name-1 WITH KEY
literal-1
ENTER Statement
ENTER language-name-1
30
[ routine-name-1 ]
EVALUATE Statement
identifier-1
literal-1
EVALUATE expression-1
TRUE
FALSE
identifier-2
literal-2
ALSO
expression-2
TRUE
FALSE
ANY
condition-1
TRUE
WHEN FALSE
identifier-3
[ NOT ] literal-3
arithmetic-expression-1
ANY
condition-2
TRUE
ALSO
FALSE
identifier-5
[ NOT ] literal-5
arithmetic-expression-3
THROUGH
THRU
THROUGH
THRU
identifier-4
literal-4
arithmetic-expression-2
! !
identifier-6
literal-6
arithmetic-expression-4
imperative-statement-1 !
[ WHEN
OTHER imperative-statement-2
[ END - EVALUATE ]
31
EXIT Statement
Format 1: Exit Paragraph
EXIT
[ CYCLE ]
SECTION
GOBACK Statement
GOBACK
GO TO Statement
Format 1: Go To (Alterable)
GO TO
[ procedure-name-1 ]
Format 2: Go To (Non-Alterable)
GO TO procedure-name-1
Format 3: Go ToDepending On
GO TO
32
{ procedure-name-1 }!
DEPENDING ON identifier-1
IF Statement
statement-1
IF condition-1 THEN
NEXT SENTENCE
statement-2
[ END - IF ]
INITIALIZE Statement
INITIALIZE
ALL
category-name TO VALUE
identifier-2
!
THEN REPLACING category-name DATA BY literal-1
[ THEN
TO DEFAULT
ALPHABETIC
ALPHANUMERIC
ALPHANUMERIC - EDITED
DATA - POINTER
NUMERIC
NUMERIC - EDITED
INSPECT Statement
Format 1: InspectTallying
INSPECT identifier-1 TALLYING
BEFORE
identifier-4
INITIAL
CHARACTERS
AFTER
literal-2
identifier-2 FOR
identifier-3 BEFORE
identifier-4
ALL
!!
! !
33
Format 2: InspectReplacing
INSPECT identifier-1 REPLACING
identifier-5 BEFORE
identifier-4
CHARACTERS BY
AFTER INITIAL literal-2
literal-3
ALL
FIRST
! !
Format 3: InspectTallyingReplacing
INSPECT identifier-1 TALLYING
BEFORE
identifier-4
CHARACTERS
INITIAL literal-2
AFTER
identifier-2 FOR
ALL
BEFORE
identifier-3
identifier-4
! !
! !
REPLACING
identifier-5 BEFORE
identifier-4
CHARACTERS BY
INITIAL literal-2
literal-3 AFTER
ALL
LEADING identifier-3 BY identifier-5 BEFORE INITIAL identifier-4
literal-1
literal-3 AFTER
literal-2
FIRST
! !
Format 4: InspectConverting
INSPECT identifier-1 CONVERTING
identifier-6
identifier-7 BEFORE
identifier-4
literal-4 TO literal-5 AFTER INITIAL literal-2
MERGE Statement
ASCENDING
MERGE file-name-1 ON
KEY
DESCENDING
[ COLLATING
{ data-name-1 }! !
SEQUENCE IS alphabet-name-1 ]
USING file-name-2
{ file-name-3 }!
GIVING { file-name-4}!
34
THROUGH
procedure-name-2
THRU
MOVE Statement
Format 1: MoveTo
identifier-1
MOVE
TO
literal-1
{ identifier-2 }!
{ identifier-2 }!
MULTIPLY Statement
Format 1: MultiplyBy
identifier-1
MULTIPLY
BY
literal-1
[ ON
{ identifier-2 [ ROUNDED ] }!
[ NOT ON
[ END - MULTIPLY ]
Format 2: MultiplyGiving
identifier-1
MULTIPLY
BY
literal-1
GIVING
[ ON
identifier-2
literal-2
{ identifier-3 [ ROUNDED ] }!
[ NOT ON
[ END - MULTIPLY ]
35
OPEN Statement
OPEN [ EXCLUSIVE ]
REVERSED
!
I - O { file-name-3 [ WITH LOCK ] }!
PERFORM Statement
Format 1: Perform (Once)
THROUGH
PERFORM procedure-name-1
procedure-name-2
THRU
[ imperative-statement-1
END - PERFORM ]
Format 2: PerformTimes
THROUGH
PERFORM procedure-name-1
procedure-name-2
THRU
identifier-1
integer-1 TIMES
[ imperative-statement-1
END - PERFORM ]
Format 3: PerformUntil
THROUGH
PERFORM procedure-name-1
procedure-name-2
THRU
BEFORE
WITH TEST AFTER UNTIL condition-1
[ imperative-statement-1
36
END - PERFORM ]
Format 4: PerformVarying
THROUGH
PERFORM procedure-name-1
procedure-name-2
THRU
BEFORE
WITH TEST AFTER
identifier-3
identifier-2
VARYING
FROM index-name-2
index-name-1
literal-1
identifier-4
BY literal-2
UNTIL condition-1
identifier-6
identifier-5
AFTER index-name-3 FROM index-name-4
literal-3
identifier-7
BY literal-4
UNTIL condition-2 !
[ imperative-statement-1
END - PERFORM ]
PURGE Statement
PURGE cd-name-1
READ Statement
Format 1: Read Sequential Access
WITH [ NO ] LOCK
NEXT
READ file-name-1
RECORD
PREVIOUS
INTO identifier-1
[ AT
END imperative-statement-1 ]
[ NOT AT
END imperative-statement-2
[ END - READ ]
37
INTO identifier-1
data-name-1
KEY IS split-key-name-1
[ INVALID
[ NOT
KEY imperative-statement-1 ]
[ END - READ ]
RECEIVE Statement
MESSAGE
RECEIVE cd-name-1
INTO identifier-1
SEGMENT
[ NO
DATA imperative-statement-1 ]
[ WITH
DATA imperative-statement-2
[ END - RECEIVE ]
RELEASE Statement
identifier-1
RELEASE record-name-1 FROM
literal-1
RETURN Statement
RETURN file-name-1 RECORD
[ AT
identifier-1 ]
END imperative-statement-1 ]
[ NOT AT
END imperative-statement-2
[ END - RETURN ]
38
[ INTO
REWRITE Statement
identifier-1
REWRITE record-name-1 FROM
literal-1
[ INVALID
[ NOT
KEY imperative-statement-1 ]
[ END - REWRITE ]
SEARCH Statement
Format 1: Search (Serial)
identifier-2
SEARCH identifier-1 VARYING
index-name-1
[ AT
END imperative-statement-1 ]
imperative-statement-2
WHEN condition-1 NEXT SENTENCE !
[ END - SEARCH ]
Format 2: Search All (Binary)
SEARCH ALL identifier-1
[ AT
END imperative-statement-1 ]
identifier-3
WHEN
IS
=
arithmetic-expression-1
condition-name-1
identifier-4
conditionname-2
imperative-statement-2
NEXT SENTENCE
[ END - SEARCH ]
39
SEND Statement
Format 1: Send (Simple)
identifier-1
SEND cd-name-1 FROM
literal-1
identifier-1
SEND cd-name-1 FROM
WITH
EMI
literal-1
EGI
identifier-3 LINE
integer-1 LINES
BEFORE
AFTER ADVANCING
mnemonic-name-2
PAGE
[ REPLACING LINE ]
SET Statement
Format 1: Set Index
index-name-2
index-name-1
! TO identifier-2
SET
identifier
-1
integer-1
UP
SET { index-name-3 } !
BY
DOWN
identifier-3
integer-2 !
ON
SET { mnemonic-name-1 } ! TO
!
OFF
40
TRUE
SET { condition-name-1 } ! TO
FALSE
SET
IN
ADDRESS OF identifier-5
IN
data-name-1
ADDRESS
! TO identifier-6
OF
identifier-4
NULL
NULLS
identifier-7
IN
data-name-1
ADDRESS
UP
!
integer-3
SET
BY
!
DOWN
OF
identifier-4
IN
LENGTH OF identifier-8
SORT Statement
ASCENDING
SORT file-name-1 ON
KEY
DESCENDING
[ WITH
{ data-name-1 }! !
DUPLICATES IN ORDER ]
[ COLLATING
SEQUENCE IS alphabet-name-1 ]
USING { file-name-2 }!
THROUGH
procedure-name-2
THRU
THROUGH
GIVING { file-name-3 }!
41
START Statement
START file-name-1
KEY
IS
IS
IS
IS
IS
IS
IS
IS
IS
IS
IS
IS
EQUAL TO
data-name-1
[ NOT ] >
>=
<=
FIRST
LAST
identifier-1
WITH SIZE
integer-1
[ INVALID
[ NOT
KEY imperative-statement-1 ]
[ END - START ]
STOP Statement
identifier-1
RUN
integer-1
STOP
identifier-2
literal-1
42
STRING Statement
identifier-2
identifier-1
STRING
DELIMITED BY literal-2
!
literal-1
SIZE
INTO identifier-3
[ WITH
POINTER identifier-4
[ ON OVERFLOW
[ NOT
imperative-statement-1 ]
ON OVERFLOW imperative-statement-2 ]
[ END - STRING ]
SUBTRACT Statement
Format 1: SubtractFrom
identifier-1
SUBTRACT
! FROM
literal-1
[ ON
{ identifier-3 [ ROUNDED ] }!
[ NOT ON
[ END - SUBTRACT ]
Format 2: SubtractGiving
identifier-1
identifier-2
SUBTRACT
! FROM literal-2
literal-1
GIVING
[ ON
{ identifier-3 [ ROUNDED ] }!
[ NOT ON
[ END - SUBTRACT ]
43
[ ON
[ ROUNDED ]
[ NOT ON
[ END - SUBTRACT ]
UNLOCK Statement
RECORD
UNLOCK file-name-1
RECORDS
UNSTRING Statement
UNSTRING identifier-1
DELIMITED BY
INTO
identifier-2
literal-1
OR
{ identifier-4 [ DELIMITER
[ WITH
POINTER identifier-7
[ TALLYING
[ ON
[ ALL ]
IN identifier-8
IN identifier-5
[ ALL ]
] [ COUNT
OVERFLOW imperative-statement-1 ]
[ NOT ON
OVERFLOW imperative-statement-2
[ END - UNSTRING ]
USE Statement
USE
[ GLOBAL ]
EXCEPTION
AFTER STANDARD
ERROR
PROCEDURE ON
44
{ file-name-1 }!
INPUT
OUTPUT
I-O
EXTEND
identifier-3
literal-2
!
IN identifier-6
] }!
WRITE Statement
Format 1: Write Sequential File
identifier-1
WRITE record-name-1 FROM
literal-1
identifier-2 LINE
integer-1 LINES
BEFORE
identifier-3
AFTER ADVANCING TO LINE integer-2 [ ON NEXT PAGE ]
mnemonic-name-2
PAGE
END - OF - PAGE
imperative-statement-1
AT EOP
END - OF - PAGE
imperative-statement-2
NOT AT EOP
[ END - WRITE ]
Format 2: Write Relative and Indexed File
identifier-1
WRITE record-name-1 FROM
literal-1
[ INVALID
[ NOT
KEY imperative-statement-1 ]
[ END - WRITE ]
45
literal-1
IN library-name-1
OF literal-2
= = pseudo-text-1 = =
identifier-1
REPLACING
literal-3
word-1
[ SUPPRESS
= = pseudo-text-2 = =
identifier-2
BY
literal-4
word-2
= = pseudo-text-1 = = BY
46
PRINTING ]
= = pseudo-text-2 = =
}!
literal-1
arithmetic-expression-1 relational-operator
index-name-1
identifier-2
literal-2
arithmetic-expression-2
index-name-2
IS
IS
IS
IS
IS
IS
IS
IS
IS
[ NOT ]
LIKE
RIGHT
TRIMMED
LEFT
CASE - INSENSITIVE
CASE - SENSITIVE
identifier-1
IS [ NOT ]
literal-1
LIKE
RIGHT
TRIMMED
LEFT
CASE - INSENSITIVE
CASE - SENSITIVE
identifier-2
literal-2
Class Condition
NUMERIC
ALPHABETIC
47
Sign Condition
POSITIVE
Condition-Name Condition
condition-name-1
Switch-Status Condition
condition-name-2
Negated Condition
NOT condition-1
Combined Condition
AND
condition-2
condition-3 !
OR
48
[ relational-operator ]
object-1 !
data-name-1
condition-name-1
IN file-name-1
IN
OF data-name-2 ! OF cd-name-1
IN file-name-1
OF cd-name-1
screen-name-1
screen-name-2 !
OF
49
Miscellaneous Formats
Sentence
Miscellaneous Formats
Sentence
statement-sequence-1
Statement Sequence
{ imperative-statement-1
imperative-statement-2
THEN }!
conditional-statement-1
Subscripting
integer-1
data-name-1
(
condition-name-1 data-name-2 + integer-2
index-name-1
! )
Reference Modification
data-name-1 ( leftmost-character-position-1 :
[ length-1 ]
Identifier
IN
IN file-name-1
data-name-1
data-name-2 ! OF cd-name-1
OF
[ ( { subscript-1 }! ) ] [ (
50
leftmost-character-position-1 : [ length-1 ] ) ]
Miscellaneous Formats
Special Registers
Special Registers
IN
ADDRESS
identifier-1
OF
IN
COUNT
data-name-1
OF
IN
data-name-1
COUNT - MAX
OF
IN
COUNT - MIN
data-name-1
OF
IN identifier-1
LENGTH
OF literal-1
IN
LINAGE - COUNTER
file-name-1
OF
PROGRAM - ID
RETURN - CODE
WHEN - COMPILED
51
Miscellaneous Formats
Figurative-Constants
Figurative-Constants
[ ALL ] HIGH - VALUE
[ ALL ] HIGH - VALUES
[ ALL ] LOW - VALUE
[ ALL ] LOW - VALUES
[ ALL ] NULL
[ ALL ] NULLS
[ ALL ]
[ ALL ]
QUOTE
QUOTES
[ ALL ] SPACE
[ ALL ] SPACES
[ ALL ] ZERO
[ ALL ] ZEROES
[ ALL ] ZEROS
ALL literal-1
[ ALL ] symbolic-character-1
Concatenation Expression
literal-1 & literal-2
Constant-Expression
[ NOT ]
52
integer-1
NEXT
LENGTH
data-name-4
OF
literal-4
SIZE
START OF data-name-6
DATE
COMPILED
( constant-expression-2 )
**
[ NOT
AND
OR
EXCLUSIVE OR
integer-2
NEXT
LENGTH
data-name5
OF
SIZE
literal-5
!
START OF data-name-7
DATE
COMPILED
( constant-expression-3 )
program-name-1
PROGRAM - ID .
[ IS INITIAL PROGRAM ].
literal-1
[ ENVIRONMENT
[ DATA
DIVISION . data-division-content-1 ]
[ PROCEDURE
DIVISION . environment-division-content-1 ]
DIVISION . procedure-division-content-1 ]
[ nested-source-program-1 ]!
program-name-1
END PROGRAM
.
literal-1
COMMON
program-name-2
PROGRAM - ID .
IS INITIAL
PROGRAM .
literal-2
[ ENVIRONMENT
[ DATA
DIVISION . environment-division-content-2 ]
DIVISION . data-division-content-2
[ PROCEDURE
DIVISION . procedure-division-content-2 ]
[ nested-source-program-2 ]!
program-name-2
END PROGRAM
.
literal-2
53
IDENTIFICATION
DIVISION .
ID
program-name-3
PROGRAM - ID .
literal-3
[ ENVIRONMENT
[ DATA
[ IS
DIVISION . environment-division-content-3
DIVISION . data-division-content-3
[ PROCEDURE
INITIAL PROGRAM
].
DIVISION . procedure-division-content-3
[ nested-source-program-3 ]!
program-name-3
END PROGRAM
.
!
literal-3
IDENTIFICATION
DIVISION .
ID
program-name-4
PROGRAM - ID .
literal-4
[ ENVIRONMENT
[ DATA
INITIAL PROGRAM
DIVISION . environment-division-content-4
DIVISION . data-division-content-4
[ PROCEDURE
[ IS
DIVISION . procedure-division-content-4
[ nested-source-program-4 ]!
program-name-4
END PROGRAM literal-4
.
54
].
PICTURE Clause
PICTURE Character-Strings
PICTURE Clause
The PICTURE clause describes a data item with a character-string composed of symbols.
PICTURE Character-Strings
The five categories of data that can be described with a PICTURE clause 1 are defined as
follows:
1.
Alphabetic. Its PICTURE character-string can contain only the symbol A. The contents
of an alphabetic data item when represented in standard data format must be one or more
alphabetic characters (a through z, A through Z, and space).
2.
3.
4.
Numeric. Its PICTURE character-string can contain only the symbols 9, P, S, and V. Its
PICTURE character-string must contain at least one symbol 9 and not more than thirty
symbols 9. Each symbol 9 specifies a digit position. If unsigned, the contents of a
numeric data item when represented in standard data format must be one or more numeric
characters. If signed, a numeric data item may also contain a +, , or other
representation of an operational sign. The actual in-memory contents of a numeric data
item are not standard data format when the usage is other than DISPLAY as specified by
a USAGE clause applicable to the data description entry or when the data item is signed
and the SEPARATE CHARACTER phrase is not specified in a SIGN clause applicable
to the data description entry.
5.
The additional data categories, index data and data pointer, also exist but do not use a PICTURE clause in their data description
entry. An index data item is described with the USAGE IS INDEX clause. A data pointer data item is described with the
USAGE IS POINTER clause.
55
PICTURE Clause
PICTURE Symbols
PICTURE Symbols
The functions of the symbols used in a PICTURE character-string to describe an elementary
data item are as follows:
56
Each symbol A in the character-string represents a character position that can contain
only an alphabetic character (a through z, A through Z, and space). Each
symbol A is counted in the size of the data item described by the PICTURE
character-string.
Each symbol B in the character-string represents a character position into which the
character space will be inserted when the data item is the receiving item of an
elementary MOVE statement. Each symbol B is counted in the size of the data item
described by the PICTURE character-string.
The symbol S is used in the character-string to indicate the presence, but neither the
representation nor, necessarily, the position of an operational sign. The symbol S
must be written as the leftmost character in the PICTURE character-string. The
symbol S is not counted in determining the size (in terms of standard data format
characters) of the data item described by the PICTURE character-string unless the
entry contains or is subject to a SIGN clause that specifies the SEPARATE
CHARACTER phrase. The symbol S in the PICTURE character-string and the
BLANK WHEN ZERO clause may not occur in the same data description entry.
PICTURE Clause
PICTURE Symbols
Each symbol 0 in the character-string represents a character position into which the
character zero (0) will be inserted when the data item is the receiving item of an
elementary MOVE statement and removed when a numeric edited data item is the
sending item in an elementary MOVE statement with a numeric or numeric edited
receiving data item. Each symbol 0 is counted in the size of the data item described
by the PICTURE character-string. The symbol 0 does not represent a digit position
in a numeric edited data item.
Each symbol slash (/) in the character-string represents a character position into
which a character slash (/) will be inserted when the data item is the receiving item
of an elementary MOVE statement. Each symbol slash (/) is counted in the size of
the data item described by the PICTURE character-string.
Each symbol comma (,) in the character-string represents a character position into
which a character comma (,) will be inserted when the data item is the receiving
item of an elementary MOVE statement. Each symbol comma (,) is counted in the
size of the data item described by the PICTURE character-string.
When the symbol period (.) appears in the character-string, it is an editing symbol
that represents the decimal point for alignment purposes and, in addition, represents a
character position into which the character period (.) will be inserted. The symbol
period is counted in the size of the data item described by the PICTURE characterstring. The symbols P and V cannot occur with a symbol period (.) in the same
PICTURE character-string.
Note For a given program the functions of the period and comma are exchanged if the
DECIMAL-POINT IS COMMA clause is stated in the SPECIAL-NAMES paragraph. In
this exchange, the rules for the period apply to the comma and the rules for the comma
apply to the period wherever they appear in a PICTURE character-string.
+, , CR, DB
These symbols are used as editing sign control symbols. When used, they represent
the character position into which the editing sign control symbol will be placed. The
symbols are mutually exclusive in any one PICTURE character-string and each
character used in the symbol is counted in determining the size of the data item
described by the PICTURE character-string. If the symbols plus or minus occur
more than once (a floating sign control symbol), then one less than the total number
of these symbols is counted in determining the maximum number (30) of digit
positions allowed in a numeric edited data item. If a floating symbol plus or minus is
used to the right of the decimal point in a character-string, then all digit positions in
57
PICTURE Clause
PICTURE Symbols
that character-string must be described with the symbol plus or minus, respectively.
If a floating plus or minus symbol string represents all the digit-positions in the
character-string, then the described data item is blank when zero, even if the BLANK
WHEN ZERO clause is not specified.
*
58
PICTURE Clause
PICTURE Symbols
Floating
Insertion Symbols
CR
DB
Other Symbols
CS
CS
A
X
CR
DB
CS
z z
* *
CS
Other Symbols
Floating
Insertion Symbols
Second
Symbol
Non-floating
Insertion Symbols
Non-floating
Insertion Symbols
z
*
z
*
CS
CS
A
X
X
X
59
Reserved Words
Reserved Words
The DERESERVE keyword of the COMPILER-OPTIONS configuration record, which is
described in Chapter 10: Configuration of the RM/COBOL Users Guide, can be used to
make a reserved word a user-defined word whenever it occurs in the source program, but then
the language feature provided by the construct in which the word appears is not available for
programs compiled with that particular configuration setting.
A
ACCEPT
ACCESS
ADD
ADDRESS 2
ADVANCING
AFTER
ALL
ALPHABET 2
ALPHABETIC
ALPHABETIC-LOWER 2
ALPHABETIC-UPPER 2
ALPHANUMERIC 2
ALPHANUMERIC-EDITED 2
ALSO 2
ALTER
ALTERNATE
AND
ANY 2
ARE
AREA
AREAS
ASCENDING 2
ASSIGN
AT
AUTHOR
B
BEEP
BEFORE
BELL 2
BINARY
BLANK
BLINK
BLOCK
BOTTOM 2
BY
60
C
CALL
CANCEL
CD 2
CENTURY-DATE 2
CENTURY-DAY 2
CF 2
CH 2
CHARACTER
CHARACTERS
CLASS 2
CLOCK-UNITS 2
CLOSE
COBOL 2
CODE 2
CODE-SET
COL 2
COLLATING
COLUMN 2
COMMA
COMMON 2
COMMUNICATION 2
COMP
COMP-1
COMP-3
COMP-4 2
COMP-5 2
COMP-6
COMPUTATIONAL
COMPUTATIONAL-1
COMPUTATIONAL-3
COMPUTATIONAL-4 2
COMPUTATIONAL-5 2
COMPUTATIONAL-6
COMPUTE
CONFIGURATION
CONTAINS
CONTENT 2
This word is not considered reserved if the RM/COBOL (74) 2.0 compatibility option is present in the Compile Command
(see the RM/COBOL User's Guide for details on this option). In such cases, this word is treated as a user-defined word
whenever it occurs in the source program.
Reserved Words
CONTINUE 2
CONTROL 2
CONTROLS 2
CONVERT
CONVERTING 2
COPY
CORR
CORRESPONDING
COUNT 2
COUNT-MAX 2
COUNT-MIN 2
CURRENCY
CURSOR 2
D
DATA
DATA-POINTER 2
DATE
DATE-AND-TIME 2
DATE-COMPILED 2
DATE-WRITTEN
DAY
DAY-AND-TIME 2
DAY-OF-WEEK 2
DE 2
DEBUG-CONTENTS 2
DEBUG-ITEM 2
DEBUG-LINE 2
DEBUG-NAME 2
DEBUG-SUB-1 2
DEBUG-SUB-2 2
DEBUG-SUB-3 2
DEBUGGING 2
DECIMAL-POINT
DECLARATIVES
DEFAULT 2
DELETE
DELIMITED 2
DELIMITER 2
DEPENDING
DESCENDING 2
DESTINATION 2
DETAIL 2
DISABLE 2
DISPLAY
DIVIDE
DIVISION
DOWN
DUPLICATES
DYNAMIC
E
ECHO
EGI 2
ELSE
EMI 2
ENABLE 2
END
END-ACCEPT 2
END-ADD 2
END-CALL 2
END-COMPUTE 2
END-DELETE 2
END-DIVIDE 2
END-EVALUATE 2
END-IF 2
END-MULTIPLY 2
END-OF-PAGE 2
END-PERFORM 2
END-READ 2
END-RECEIVE 2
END-RETURN 2
END-REWRITE 2
END-SEARCH 2
END-START 2
END-STRING 2
END-SUBTRACT 2
END-UNSTRING 2
END-WRITE 2
ENTER 2
ENVIRONMENT
EOP 2
EQUAL
ERASE
ERROR
ESCAPE 2
ESI 2
EVALUATE 2
EVERY 2
EXCEPTION
EXCLUSIVE 2
EXIT
EXTEND
EXTERNAL 2
F
FALSE 2
FD
FILE
FILE-CONTROL
FILLER
This word is not considered reserved if the RM/COBOL (74) 2.0 compatibility option is present in the Compile Command
(see the RM/COBOL User's Guide for details on this option). In such cases, this word is treated as a user-defined word
whenever it occurs in the source program.
61
Reserved Words
FINAL 2
FIRST
FIXED 2
FOOTING 2
FOR
FROM
FUNCTION 2
G
GENERATE 2
GIVING
GLOBAL 2
GO
GOBACK 2
GREATER
GROUP 2
H
HEADING 2
HIGH
HIGH-VALUE
HIGH-VALUES
HIGHLIGHT
I
I-O
I-O-CONTROL
ID 2
IDENTIFICATION
IF
IN
INDEX
INDEXED
INDICATE 2
INITIAL
INITIALIZE 2
INITIATE 2
INPUT
INPUT-OUTPUT
INSPECT
INSTALLATION
INTO
INVALID
IS
K
KEY
L
LABEL
LAST 2
LEADING
LEFT
LENGTH 2
LESS
LIKE 2
LIMIT 2
LIMITS 2
LINAGE 2
LINAGE-COUNTER 2
LINE
LINE-COUNTER 2
LINES
LINKAGE
LOCK
LOW
LOWLIGHT 2
LOW-VALUE
LOW-VALUES
M
MEMORY
MERGE 2
MESSAGE 2
MODE
MODULES
MOVE
MULTIPLY
N
NATIVE
NEGATIVE 2
NEXT
NO
NOT
NULL 2
NULLS 2
NUMBER 2
NUMERIC
NUMERIC-EDITED 2
J
JUST
JUSTIFIED
62
This word is not considered reserved if the RM/COBOL (74) 2.0 compatibility option is present in the Compile Command
(see the RM/COBOL User's Guide for details on this option). In such cases, this word is treated as a user-defined word
whenever it occurs in the source program.
Reserved Words
O
OBJECT-COMPUTER
OCCURS
OF
OFF
OMITTED
ON
OPEN
OPTIONAL 2
OR
ORDER 2
ORGANIZATION
OTHER 2
OUTPUT
OVERFLOW
P
PACKED-DECIMAL 2
PADDING 2
PAGE
PAGE-COUNTER 2
PERFORM
PF 2
PH 2
PIC
PICTURE
PLUS 2
POINTER 2
POSITION
POSITIVE 2
PRINTING 2
PROCEDURE
PROCEDURES 2
PROCEED
PROGRAM
PROGRAM-ID
PROMPT
PURGE 2
Q
QUEUE 2
QUOTE
QUOTES
R
RANDOM
RD 2
READ
RECEIVE 2
RECORD
RECORDING 2
RECORDS
REDEFINES
REEL
REFERENCE 2
REFERENCES 2
RELATIVE
RELEASE 2
REMAINDER
REMARKS 2
REMOVAL 2
RENAMES
REPLACE 2
REPLACING
REPORT 2
REPORTING 2
REPORTS 2
RERUN 2
RESERVE
RESET 2
RETURN 2
RETURN-CODE 2
RETURNING 2
REVERSE
REVERSE-VIDEO 2
REVERSED 2
REWIND
REWRITE
RF 2
RH 2
RIGHT
ROUNDED
RUN
S
SAME
SCREEN 2
SD 2
SEARCH 2
SECTION
SECURE 2
SECURITY
SEGMENT 2
SEGMENT-LIMIT 2
SELECT
SEND 2
SENTENCE
SEPARATE
SEQUENCE
SEQUENTIAL
This word is not considered reserved if the RM/COBOL (74) 2.0 compatibility option is present in the Compile Command
(see the RM/COBOL User's Guide for details on this option). In such cases, this word is treated as a user-defined word
whenever it occurs in the source program.
63
Reserved Words
64
SET
SIGN
SIZE
SORT 2
SORT-MERGE 2
SOURCE 2
SOURCE-COMPUTER
SPACE
SPACES
SPECIAL-NAMES
STANDARD
STANDARD-1
STANDARD-2 2
START
STATUS
STOP
STRING 2
SUB-QUEUE-1 2
SUB-QUEUE-2 2
SUB-QUEUE-3 2
SUBTRACT
SUM 2
SUPPRESS 2
SYMBOLIC 2
SYNC
SYNCHRONIZED
THRU
TIME
TIMES
TO
TOP 2
TRAILING
TRUE 2
TYPE 2
T
TAB
TABLE 2
TALLYING
TAPE 2
TERMINAL 2
TERMINATE 2
TEST 2
TEXT 2
THAN
THEN 2
THROUGH
W
WHEN
WHEN-COMPILED 2
WITH
WORDS
WORKING-STORAGE
WRITE
U
UNIT
UNLOCK
UNSTRING 2
UNTIL
UP
UPDATE
UPON 2
USAGE
USE
USING
V
VALUE
VALUES
VARIABLE 2
VARYING
Z
ZERO
ZEROES
ZEROS
This word is not considered reserved if the RM/COBOL (74) 2.0 compatibility option is present in the Compile Command
(see the RM/COBOL User's Guide for details on this option). In such cases, this word is treated as a user-defined word
whenever it occurs in the source program.
Context-Sensitive Words
Context-Sensitive Words
The words listed in Table 2 are context-sensitive words and are reserved in the specified
language construct or context. If a context-sensitive word is used where the context-sensitive
word is permitted in the general format, the word is treated as a keyword; otherwise, it is
treated as a user-defined word.
Table 2: Context-Sensitive Words
Context-Sensitive Word
AUTO
AUTO-SKIP
AUTOMATIC 3
BACKGROUND 3
BACKGROUND-COLOR
CARD-PUNCH
CARD-READER
CASE-INSENSITIVE 3
CASE-SENSITIVE
LIKE relational-operator
LIKE relational-operator
CASSETTE
CONSOLE
CRT 3
CYCLE 3
DISC
DISK
EOL
EOS
FOREGROUND 3
FOREGROUND-COLOR 3
FULL
3
This word in is not considered to be a context-sensitive word if the RM/COBOL (74) 2.0
compatibility option is present in the Compile Command (see the RM/COBOL Users Guide for
details on this option). When that option is present, this word is treated as a user-defined word
whenever it occurs in the source program.
65
Context-Sensitive Words
KEYBOARD
LISTING
MAGNETIC-TAPE
MANUAL
MULTIPLE
PARAGRAPH 3
3
PREVIOUS
PRINTER
PRINTER-1
REQUIRED
SORT-WORK
TRIMMED
UNDERLINE
YYYYDDD
LIKE relational-operator
3
YYYYMMDD 3
66
Nonreserved System-Names
Code-Names
Nonreserved System-Names
Code-Names
EBCDIC
(Color-Integer) Color-Names
(0) BLACK
(1) BLUE
(2) GREEN
(3) CYAN
(4) RED
(5) MAGENTA
(6) BROWN
(7) WHITE
Computer-Names
user-defined-word-1
Delimiter-Names
BINARY-SEQUENTIAL
LINE-SEQUENTIAL
Device-Names
CARD-PUNCH
CARD-READER
CASSETTE
CONSOLE
DISC
DISK
KEYBOARD
LISTING
MAGNETIC-TAPE
PRINT
PRINTER
PRINTER-1
SORT-WORK
67
Nonreserved System-Names
Feature-Names
Feature-Names
C01
C02
C03
C04
C05
C06
C07
C08
C09
C10
C11
C12
Label-Names
FILE-ID
user-defined-word-2
Language-Names
user-defined-word-3
Low-Volume-I-O-Names
CONSOLE
SYSIN
SYSOUT
Rerun-Names
user-defined-word-4
Switch-Names
SWITCH-1
SWITCH-2
SWITCH-3
SWITCH-4
SWITCH-5
SWITCH-6
SWITCH-7
SWITCH-8
68
UPSI-0
UPSI-1
UPSI-2
UPSI-3
UPSI-4
UPSI-5
UPSI-6
UPSI-7