COMMANDUppercase commands must be entered as shown.
COMMANDItalics are optional entries.
variableIs a WORKING-STORAGE variable.
valueIs a working storage variable or a value, or a literal.
conditionIs an 88-level or (value NOT|=|>|>=|<|<=value)
computeIs an value or (value +|-|*|/|value)

ACCEPT variable FROM device|DATE|DAY|DAY-OF-WEEK|TIME 
ADD value TO variable... ROUNDED
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-ADD 
ADD value... TO variable GIVING variable... ROUNDED
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-ADD
CALL value USING 
    BY REFERENCE variable...
    BY CONTENT variable...
    ON OVERFLOW statement 
    END-CALL 
CLOSE filehandle...
COMPUTE variable ROUNDED = compute
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-COMPUTE
COPY filename IN library 
    REPLACING{==pText==|value BY==pText==|value }... 
DELETE filehandle RECORD
    INVALID KEY statement 
    NOT INVALID KEY statement 
    END-DELETE 
DISPLAY value ... UPON device WITH NO ADVANCING
DIVIDE value INTO|BY value GIVING variable ROUNDED
    REMAINDER variable
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-DIVIDE 
DIVIDE value INTO variable ROUNDED 
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-DIVIDE 
EVALUATE {value|compute|TRUE|FALSE}
    ALSO {variable|literal-2|compute|TRUE|FALSE} 
    {WHEN
        condition|ANY|TRUE|FALSE|
            NOT{variable|literal-3|compute}
            THRU  {variable|literal-4|compute} }
        ALSO {condition|ANY|TRUE|FALSE|
            NOT{variable|literal-5|compute}
            THRU  {variable|literal-6|compute} }...
        statement} ...
    WHEN OTHER statement 
    END-EVALUATE 
IF condition THEN 
    NEXT SENTENCE|statement...
ELSE 
    NEXT SENTENCE|statement...
END-IF 
INITIALIZE variable...
INSPECT variable REPLACING
    CHARACTERS BY value BEFORE|AFTER INITIAL value...
    ALL|LEADING|FIRST value BY value BEFORE|AFTER INITIAL value...
INSPECT variable TALLYING variable FOR
    CHARACTERS BEFORE|AFTER INITIAL value...
    ALL|LEADING value BEFORE|AFTER INITIAL value
INSPECT variable CONVERTING value TO value
    BEFORE|AFTER INITIAL value...
MERGE filehandle-1 {ON {ASCENDING|DESCENDING} KEY SD-Element ...} ...
    COLLATING SEQUENCE IS ASCII|EBCDIC 
      USING filehandle...
    {OUTPUT PROCEDURE IS paragraph-1 THRU paragraph-2 
      | GIVING filehandle...}
MOVE value TO variable....
MULTIPLY variable BY value ROUNDED...
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-MULTIPLY 
MULTIPLY value BY value GIVING variable ROUNDED...
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-MULTIPLY 
OPEN INPUT filehandle... OUTPUT filehandle... I-O filehandle... EXTEND filehandle...
PERFORM paragraph-1 THRU paragraph-2 
      value TIMES
      VARYING variable FROM value BY value UNTIL condition { 
         WITH TEST BEFORE|AFTER} 
      statement... 
      END-PERFORM 
READ filehandle NEXT {INTO variable} 
    AT END statement 
    NOT AT END statement 
    END-READ 
READ filehandle { INTO variable} 
    KEY IS Fd-element 
    INVALID KEY statement 
    NOT INVALID KEY statement 
    END-READ 
REWRITE FD-record { FROM FD-record} 
    INVALID KEY statement
    NOT INVALID KEY statement
    END-REWRITE 
SEARCH variable VARYING {variable|index}
    AT END statement 
    {WHEN condition-1 {statement|NEXT SENTENCE}} ...
    END-SEARCH
SEARCH ALL variable
    AT END statement 
    WHEN {variable = {var-3|literal-1|compute}|condition-1}
        AND {var-4 = {var-5|literal-2|compute}|condition-2}...
        {statement|NEXT SENTENCE}
    END-SEARCH 
SELECT filehandle ASSIGN TO library|device
    ORGANIZATION IS SEQUENTIAL|INDEXED|DYNAMIC|LINE SEQUENTIAL 
    ACCESS MODE IS SEQUENTIAL|RANDOM|DYNAMIC 
    RECORD KEY IS Fd-element
    ALTERNATE RECORD KEY IS Fd-element
    FILE STATUS IS variable
SET index|variable... TO index|value
SET index... UP|DOWN BY value
SET 88-level... TO TRUE
SORT SD-filehandle 
    ON ASCENDING|DESCENDING KEY SD-element...
    WITH DUPLICATES IN ORDER
    COLLATING SEQUENCE IS ASCII|EBCDIC
    USING filehandle... GIVING filehandle...
SORT SD-filehandle 
    ON ASCENDING|DESCENDING KEY SD-element...
    WITH DUPLICATES IN ORDER
    COLLATING SEQUENCE IS ASCII|EBCDIC
    INPUT PROCEDURE IS sort-input-paragraph {THRU paragraph}
    OUTPUT PROCEDURE IS sort-output-paragraph {THRU paragraph}
    sort-input-paragraph
       RETURN SD-filehandle INTO variable
         AT END statement
         NOT AT END statement 
         END-RETURN 
    sort-output-paragraph
       RELEASE Sd-record FROM variable
START filehandle KEY IS =|KEY IS >|KEY IS NOT <|KEY IS >= Fd-element 
     INVALID KEY statement 
    NOT INVALID KEY statement 
    END-START 
STOP {RUN|literal-1}
STRING value...  DELIMITED BYvalue|SIZE ...
    INTO variable
    WITH POINTER variable 
    ON OVERFLOW statement 
    NOT ON OVERFLOW statement 
    END-STRING 
SUBTRACT value...  FROMvariable ROUNDED  ...
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-SUBTRACT 
SUBTRACT value... FROM value
    GIVING variable ROUNDED  ...
    ON SIZE ERROR statement 
    NOT ON SIZE ERROR statement 
    END-SUBTRACT 
UNSTRING variable
    DELIMITED BY { ALL} value {OR ALL value}...
     INTOvariable
        DELIMITER IN variable-delimiter 
        COUNT IN variable-counter  ...
    WITH POINTER variable-pointer 
    TALLYING IN variable-tally 
    ON OVERFLOW statement 
     NOT ON OVERFLOW statement 
    END-UNSTRING 
WRITE filehandle FROM Fd-record 
    BEFORE|AFTER ADVANCING PAGE|value LINE
    END-WRITE 
WRITE filehandle FROM Fd-record 
    INVALID KEY statement 
    NOT INVALID KEY statement 
    END-WRITE 

(c) 1996-2001 Logical Extensions||Updated:

COBOL Syntax Reference
COBOL Programming (COP 2120/2121)


This page contains an abbreviated COBOL syntax reference for the most commonly used COBOL verbs listed in alphabetical order. You can print this page for help while programming (although online Help is better) and to refer to during quizzes.

Conventions used in COBOL-85 Syntax Reference
UPPER-CASE Must be entered as shown (unless in )
X X is an optional item
{X} ... X may be repeated
{X|Y} Either X or Y is required 
compute An arithmetic expression
88-condition-# A condition name (88-level)
condition-# A conditional expression
var-# A data item defined in WORKING-STORAGE
literal-# A literaleral (numeric or alphanumeric as required)
filehandle-# A logical file name
impStmt-# An imperative statement (not IF/EVALUATE)
index-# An index name
library-# A drive:\directory name (C:\MYLIB)
device-# A mnemonic device name (like CONSOLE)
paragraph-# A paragraph name
FD-01-record-# A record name (FD 01 level var-#)
filename-# A physical file name (EXAMPLE.TXT)