Appendix C: COBOL Language Quick Reference
Notation Conventions
This reference uses the following notation:
- UPPERCASE — COBOL reserved words (must appear as shown)
- lowercase-italic — User-supplied names or values
- [ ] — Optional element; may be omitted
- { } — Required choice; exactly one alternative must be selected
- | — Separates alternatives within braces or brackets
- ... — Preceding element may be repeated
- ( ) — Literal parentheses in COBOL syntax
1. Program Structure
IDENTIFICATION DIVISION.
PROGRAM-ID. program-name [IS {INITIAL | COMMON | INITIAL COMMON}].
[AUTHOR. comment-text.]
[DATE-WRITTEN. comment-text.]
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
[SOURCE-COMPUTER. computer-name [WITH DEBUGGING MODE].]
[OBJECT-COMPUTER. computer-name.]
[SPECIAL-NAMES. special-names-entries.]
[REPOSITORY. repository-entries.]
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT [OPTIONAL] file-name
ASSIGN TO assignment-name
[ORGANIZATION IS {SEQUENTIAL | INDEXED | RELATIVE}]
[ACCESS MODE IS {SEQUENTIAL | RANDOM | DYNAMIC}]
[RECORD KEY IS data-name]
[ALTERNATE RECORD KEY IS data-name [WITH DUPLICATES]] ...
[RELATIVE KEY IS data-name]
[FILE STATUS IS data-name].
DATA DIVISION.
FILE SECTION.
FD / SD entries and record descriptions.
WORKING-STORAGE SECTION.
Data item descriptions.
LOCAL-STORAGE SECTION.
Data item descriptions (per-invocation).
LINKAGE SECTION.
Data item descriptions for passed parameters.
PROCEDURE DIVISION [USING parameter-list] [RETURNING data-name].
Paragraphs, sections, and statements.
2. DATA DIVISION Entries
FD (File Description) Entry
FD file-name
[BLOCK CONTAINS {integer-1 TO} integer-2 {CHARACTERS | RECORDS}]
[RECORD {CONTAINS integer CHARACTERS |
CONTAINS integer-1 TO integer-2 CHARACTERS |
IS VARYING IN SIZE FROM integer-1 TO integer-2
CHARACTERS DEPENDING ON data-name}]
[LABEL RECORDS ARE {STANDARD | OMITTED}]
[RECORDING MODE IS {F | V | U | S}]
[DATA RECORDS ARE record-name ...]
.
01 record-name.
...
SD (Sort-Merge File Description) Entry
SD file-name
[RECORD CONTAINS integer-1 TO integer-2 CHARACTERS]
.
01 record-name.
...
Level Numbers
| Level |
Purpose |
| 01 |
Record-level entry or independent item in WORKING-STORAGE |
| 02–49 |
Group and elementary items within a record structure |
| 66 |
RENAMES entry — regroups previously defined items |
| 77 |
Independent elementary item (not part of a group) |
| 88 |
Condition name (defines values for conditional testing) |
Level 66 (RENAMES)
66 data-name-1 RENAMES data-name-2 [THROUGH data-name-3].
Level 88 (Condition Name)
88 condition-name VALUE IS literal-1 [THROUGH literal-2] ...
[WHEN SET TO FALSE IS literal-3].
Data Description Entry
level-number [data-name | FILLER]
[REDEFINES data-name-2]
[PIC | PICTURE IS character-string]
[USAGE IS {DISPLAY | BINARY | COMP | COMP-1 | COMP-2 | COMP-3 |
COMP-4 | COMP-5 | PACKED-DECIMAL | INDEX | POINTER |
FUNCTION-POINTER | PROCEDURE-POINTER |
NATIONAL | DISPLAY-1}]
[VALUE IS literal]
[OCCURS integer TIMES
[{ASCENDING | DESCENDING} KEY IS data-name ...]
[INDEXED BY index-name ...]]
[OCCURS integer-1 TO integer-2 TIMES
DEPENDING ON data-name
[{ASCENDING | DESCENDING} KEY IS data-name ...]
[INDEXED BY index-name ...]]
[SIGN IS {LEADING | TRAILING} [SEPARATE CHARACTER]]
[SYNCHRONIZED | SYNC [LEFT | RIGHT]]
[JUSTIFIED | JUST RIGHT]
[BLANK WHEN ZERO]
[EXTERNAL]
[GLOBAL]
.
3. PICTURE Clause Symbols
| Symbol |
Category |
Meaning |
| 9 |
Numeric |
Decimal digit (0-9) |
| A |
Alphabetic |
Alphabetic character (A-Z, a-z, space) |
| X |
Alphanumeric |
Any character |
| S |
Numeric |
Indicates signed numeric; must be leftmost |
| V |
Numeric |
Implied decimal point position |
| P |
Numeric |
Assumed decimal scaling position |
| Z |
Numeric edited |
Zero-suppressed digit (replaced with space) |
| * |
Numeric edited |
Zero-suppressed digit (replaced with asterisk) |
| $ |
Numeric edited |
Currency symbol (fixed or floating) |
| + |
Numeric edited |
Plus sign (fixed or floating) |
| - |
Numeric edited |
Minus sign (fixed or floating) |
| . (period) |
Numeric edited |
Decimal point (actual) |
| , (comma) |
Numeric edited |
Comma insertion |
| CR |
Numeric edited |
Credit symbol (appears for negative values) |
| DB |
Numeric edited |
Debit symbol (appears for negative values) |
| B |
Edited |
Blank insertion |
| 0 |
Edited |
Zero insertion |
| / |
Edited |
Slash insertion |
4. USAGE Clause Options
| USAGE |
Storage |
Description |
| DISPLAY |
1 byte/digit |
Default; character representation of data |
| BINARY / COMP / COMP-4 |
2, 4, or 8 bytes |
Binary integer (halfword, fullword, doubleword) |
| COMP-3 / PACKED-DECIMAL |
(n+1)/2 bytes |
Packed decimal; 2 digits per byte plus sign nibble |
| COMP-1 |
4 bytes |
Single-precision floating-point (IBM) |
| COMP-2 |
8 bytes |
Double-precision floating-point (IBM) |
| COMP-5 |
2, 4, or 8 bytes |
Native binary (platform byte order, full range) |
| INDEX |
4 bytes |
Index data item for table processing |
| POINTER |
4 bytes |
Address pointer |
| NATIONAL |
2 bytes/char |
UTF-16 encoding (IBM) |
| DISPLAY-1 |
2 bytes/char |
DBCS encoding (IBM) |
5. PROCEDURE DIVISION Verbs
ACCEPT
ACCEPT identifier FROM {DATE | DATE YYYYMMDD | DAY | DAY YYYYDDD |
DAY-OF-WEEK | TIME | CONSOLE | SYSIN |
environment-name}
ADD
ADD {identifier | literal} ... TO identifier [ROUNDED] ...
[ON SIZE ERROR imperative-statement]
[NOT ON SIZE ERROR imperative-statement]
[END-ADD]
ADD {identifier | literal} ... TO {identifier | literal}
GIVING identifier [ROUNDED] ...
[ON SIZE ERROR imperative-statement]
[NOT ON SIZE ERROR imperative-statement]
[END-ADD]
ADD CORRESPONDING group-item-1 TO group-item-2 [ROUNDED]
[ON SIZE ERROR imperative-statement]
[END-ADD]
CALL
CALL {identifier | literal}
[USING {[BY REFERENCE] identifier | ADDRESS OF identifier |
BY CONTENT {identifier | literal | LENGTH OF identifier} |
BY VALUE {identifier | literal}} ...]
[RETURNING identifier]
[ON OVERFLOW imperative-statement]
[ON EXCEPTION imperative-statement]
[NOT ON EXCEPTION imperative-statement]
[END-CALL]
CLOSE
CLOSE file-name [{REEL | UNIT} [FOR REMOVAL | WITH NO REWIND] |
WITH {NO REWIND | LOCK}] ...
COMPUTE
COMPUTE identifier [ROUNDED] ... = arithmetic-expression
[ON SIZE ERROR imperative-statement]
[NOT ON SIZE ERROR imperative-statement]
[END-COMPUTE]
CONTINUE
CONTINUE
DELETE
DELETE file-name [RECORD]
[INVALID KEY imperative-statement]
[NOT INVALID KEY imperative-statement]
[END-DELETE]
DISPLAY
DISPLAY {identifier | literal} ... [UPON {CONSOLE | SYSOUT | environment-name}]
[WITH NO ADVANCING]
DIVIDE
DIVIDE {identifier | literal} INTO identifier [ROUNDED] ...
[ON SIZE ERROR imperative-statement]
[END-DIVIDE]
DIVIDE {identifier | literal} INTO {identifier | literal}
GIVING identifier [ROUNDED] ...
[REMAINDER identifier]
[ON SIZE ERROR imperative-statement]
[END-DIVIDE]
DIVIDE {identifier | literal} BY {identifier | literal}
GIVING identifier [ROUNDED] ...
[REMAINDER identifier]
[ON SIZE ERROR imperative-statement]
[END-DIVIDE]
EVALUATE
EVALUATE {identifier | literal | expression | TRUE | FALSE}
[ALSO {identifier | literal | expression | TRUE | FALSE}] ...
{WHEN {ANY | condition | TRUE | FALSE |
[NOT] {identifier | literal | arithmetic-expression}
[THROUGH {identifier | literal | arithmetic-expression}]}
[ALSO ...] ...
imperative-statement} ...
[WHEN OTHER imperative-statement]
[END-EVALUATE]
EXIT
EXIT [PROGRAM | PARAGRAPH | SECTION | PERFORM [CYCLE]]
GO TO
GO TO procedure-name
GO TO procedure-name-1 ... DEPENDING ON identifier
GOBACK
GOBACK
IF
IF condition THEN
{imperative-statement | NEXT SENTENCE}
[ELSE
{imperative-statement | NEXT SENTENCE}]
[END-IF]
INITIALIZE
INITIALIZE identifier ...
[REPLACING {{ALPHABETIC | ALPHANUMERIC | NUMERIC |
ALPHANUMERIC-EDITED | NUMERIC-EDITED} DATA
BY {identifier | literal}} ...]
INSPECT
INSPECT identifier TALLYING
{tally-counter FOR {{CHARACTERS | {ALL | LEADING} {identifier | literal} ...}
[{BEFORE | AFTER} INITIAL {identifier | literal}]} ...} ...
INSPECT identifier REPLACING
{{CHARACTERS BY {identifier | literal}
[{BEFORE | AFTER} INITIAL {identifier | literal}]} |
{{ALL | LEADING | FIRST} {identifier | literal}
BY {identifier | literal}
[{BEFORE | AFTER} INITIAL {identifier | literal}]} ...} ...
INSPECT identifier CONVERTING {identifier | literal}
TO {identifier | literal}
[{BEFORE | AFTER} INITIAL {identifier | literal}]
MERGE
MERGE file-name
ON {ASCENDING | DESCENDING} KEY data-name ... ...
[COLLATING SEQUENCE IS alphabet-name]
USING file-name-2 file-name-3 ...
{OUTPUT PROCEDURE IS procedure-name [THROUGH procedure-name] |
GIVING file-name ...}
MOVE
MOVE {identifier | literal} TO identifier ...
MOVE CORRESPONDING group-item-1 TO group-item-2
MULTIPLY
MULTIPLY {identifier | literal} BY identifier [ROUNDED] ...
[ON SIZE ERROR imperative-statement]
[END-MULTIPLY]
MULTIPLY {identifier | literal} BY {identifier | literal}
GIVING identifier [ROUNDED] ...
[ON SIZE ERROR imperative-statement]
[END-MULTIPLY]
OPEN
OPEN {INPUT file-name ... |
OUTPUT file-name ... |
I-O file-name ... |
EXTEND file-name ...} ...
PERFORM procedure-name [THROUGH procedure-name]
PERFORM procedure-name [THROUGH procedure-name]
{identifier | integer} TIMES
PERFORM procedure-name [THROUGH procedure-name]
[WITH TEST {BEFORE | AFTER}]
UNTIL condition
PERFORM procedure-name [THROUGH procedure-name]
[WITH TEST {BEFORE | AFTER}]
VARYING identifier FROM {identifier | literal}
BY {identifier | literal}
UNTIL condition
[AFTER identifier FROM {identifier | literal}
BY {identifier | literal}
UNTIL condition] ...
PERFORM [WITH TEST {BEFORE | AFTER}]
{UNTIL condition | {identifier | integer} TIMES |
VARYING ...}
imperative-statement
END-PERFORM
READ
READ file-name [NEXT | PREVIOUS] [RECORD] [INTO identifier]
[AT END imperative-statement]
[NOT AT END imperative-statement]
[END-READ]
READ file-name [RECORD] [INTO identifier]
[KEY IS data-name]
[INVALID KEY imperative-statement]
[NOT INVALID KEY imperative-statement]
[END-READ]
RELEASE
RELEASE record-name [FROM identifier]
RETURN
RETURN file-name [RECORD] [INTO identifier]
AT END imperative-statement
[NOT AT END imperative-statement]
[END-RETURN]
REWRITE
REWRITE record-name [FROM identifier]
[INVALID KEY imperative-statement]
[NOT INVALID KEY imperative-statement]
[END-REWRITE]
SEARCH
SEARCH identifier [VARYING identifier]
[AT END imperative-statement]
{WHEN condition {imperative-statement | NEXT SENTENCE}} ...
[END-SEARCH]
SEARCH ALL identifier
[AT END imperative-statement]
WHEN {data-name IS {EQUAL TO | =} {identifier | literal}
[AND data-name IS {EQUAL TO | =} {identifier | literal}] ...}
{imperative-statement | NEXT SENTENCE}
[END-SEARCH]
SET
SET {index-name | identifier} ... TO {index-name | identifier | integer}
SET index-name ... {UP BY | DOWN BY} {identifier | integer}
SET condition-name ... TO TRUE
SET {ADDRESS OF identifier} TO {pointer | ADDRESS OF identifier}
SORT
SORT file-name
ON {ASCENDING | DESCENDING} KEY data-name ... ...
[WITH DUPLICATES IN ORDER]
[COLLATING SEQUENCE IS alphabet-name]
{INPUT PROCEDURE IS procedure-name [THROUGH procedure-name] |
USING file-name ...}
{OUTPUT PROCEDURE IS procedure-name [THROUGH procedure-name] |
GIVING file-name ...}
START
START file-name
KEY IS {EQUAL TO | = | GREATER THAN | > | NOT LESS THAN | >= |
LESS THAN | < | NOT GREATER THAN | <=} data-name
[INVALID KEY imperative-statement]
[NOT INVALID KEY imperative-statement]
[END-START]
STOP
STOP RUN
STOP {literal}
STRING
STRING {identifier | literal} ... DELIMITED BY {identifier | literal | SIZE}
...
INTO identifier [WITH POINTER identifier]
[ON OVERFLOW imperative-statement]
[NOT ON OVERFLOW imperative-statement]
[END-STRING]
SUBTRACT
SUBTRACT {identifier | literal} ... FROM identifier [ROUNDED] ...
[ON SIZE ERROR imperative-statement]
[END-SUBTRACT]
SUBTRACT {identifier | literal} ... FROM {identifier | literal}
GIVING identifier [ROUNDED] ...
[ON SIZE ERROR imperative-statement]
[END-SUBTRACT]
SUBTRACT CORRESPONDING group-item-1 FROM group-item-2 [ROUNDED]
[ON SIZE ERROR imperative-statement]
[END-SUBTRACT]
UNSTRING
UNSTRING identifier
DELIMITED BY [ALL] {identifier | literal}
[OR [ALL] {identifier | literal}] ...
INTO {identifier [DELIMITER IN identifier] [COUNT IN identifier]} ...
[WITH POINTER identifier]
[TALLYING IN identifier]
[ON OVERFLOW imperative-statement]
[NOT ON OVERFLOW imperative-statement]
[END-UNSTRING]
WRITE
WRITE record-name [FROM identifier]
[{BEFORE | AFTER} ADVANCING
{{identifier | integer} {LINE | LINES} | PAGE |
mnemonic-name}]
[AT {END-OF-PAGE | EOP} imperative-statement]
[NOT AT {END-OF-PAGE | EOP} imperative-statement]
[END-WRITE]
WRITE record-name [FROM identifier]
[INVALID KEY imperative-statement]
[NOT INVALID KEY imperative-statement]
[END-WRITE]
6. Scope Terminators
| Scope Terminator |
Terminates |
| END-ACCEPT |
ACCEPT |
| END-ADD |
ADD |
| END-CALL |
CALL |
| END-COMPUTE |
COMPUTE |
| END-DELETE |
DELETE |
| END-DISPLAY |
DISPLAY |
| END-DIVIDE |
DIVIDE |
| END-EVALUATE |
EVALUATE |
| END-IF |
IF |
| END-MULTIPLY |
MULTIPLY |
| END-PERFORM |
Inline PERFORM |
| END-READ |
READ |
| END-RETURN |
RETURN |
| END-REWRITE |
REWRITE |
| END-SEARCH |
SEARCH |
| END-START |
START |
| END-STRING |
STRING |
| END-SUBTRACT |
SUBTRACT |
| END-UNSTRING |
UNSTRING |
| END-WRITE |
WRITE |
7. Conditional Expressions
Relational Conditions
identifier IS [NOT] {EQUAL TO | = | GREATER THAN | > |
LESS THAN | < | GREATER THAN OR EQUAL TO | >= |
LESS THAN OR EQUAL TO | <=} {identifier | literal}
Class Conditions
identifier IS [NOT] {NUMERIC | ALPHABETIC | ALPHABETIC-LOWER |
ALPHABETIC-UPPER | DBCS | KANJI | class-name}
Sign Conditions
identifier IS [NOT] {POSITIVE | NEGATIVE | ZERO}
Condition-Name (Level 88) Conditions
condition-name
Combined Conditions
condition-1 {AND | OR} condition-2
NOT condition
Abbreviated Combined Relations
identifier IS GREATER THAN literal-1 AND LESS THAN literal-2
(equivalent to: identifier > literal-1 AND identifier < literal-2)
8. Intrinsic Functions
Numeric Functions
| Function |
Signature |
Returns |
| ABS |
FUNCTION ABS(argument) |
Absolute value |
| ACOS |
FUNCTION ACOS(argument) |
Arc cosine |
| ANNUITY |
FUNCTION ANNUITY(rate, periods) |
Annuity factor |
| ASIN |
FUNCTION ASIN(argument) |
Arc sine |
| ATAN |
FUNCTION ATAN(argument) |
Arc tangent |
| COMBINED-DATETIME |
FUNCTION COMBINED-DATETIME(date, time) |
Date-time integer |
| COS |
FUNCTION COS(argument) |
Cosine |
| CURRENT-DATE |
FUNCTION CURRENT-DATE |
21-char date/time/GMT string |
| DATE-OF-INTEGER |
FUNCTION DATE-OF-INTEGER(integer) |
YYYYMMDD from integer date |
| DATE-TO-YYYYMMDD |
FUNCTION DATE-TO-YYYYMMDD(date [, window]) |
Convert 2-digit to 4-digit year |
| DAY-OF-INTEGER |
FUNCTION DAY-OF-INTEGER(integer) |
YYYYDDD from integer date |
| DAY-TO-YYYYDDD |
FUNCTION DAY-TO-YYYYDDD(date [, window]) |
Convert 2-digit to 4-digit year |
| DISPLAY-OF |
FUNCTION DISPLAY-OF(national [, codepage]) |
Convert national to display |
| E |
FUNCTION E |
Value of e (2.71828...) |
| EXP |
FUNCTION EXP(argument) |
e raised to a power |
| EXP10 |
FUNCTION EXP10(argument) |
10 raised to a power |
| FACTORIAL |
FUNCTION FACTORIAL(integer) |
Factorial of integer |
| INTEGER |
FUNCTION INTEGER(argument) |
Truncated integer (toward negative) |
| INTEGER-OF-DATE |
FUNCTION INTEGER-OF-DATE(date) |
Integer from YYYYMMDD |
| INTEGER-OF-DAY |
FUNCTION INTEGER-OF-DAY(date) |
Integer from YYYYDDD |
| INTEGER-PART |
FUNCTION INTEGER-PART(argument) |
Truncated integer (toward zero) |
| LENGTH |
FUNCTION LENGTH(argument) |
Length in characters |
| LOG |
FUNCTION LOG(argument) |
Natural logarithm |
| LOG10 |
FUNCTION LOG10(argument) |
Base-10 logarithm |
| MAX |
FUNCTION MAX(argument ...) |
Maximum value |
| MEAN |
FUNCTION MEAN(argument ...) |
Arithmetic mean |
| MEDIAN |
FUNCTION MEDIAN(argument ...) |
Median value |
| MIDRANGE |
FUNCTION MIDRANGE(argument ...) |
Average of min and max |
| MIN |
FUNCTION MIN(argument ...) |
Minimum value |
| MOD |
FUNCTION MOD(argument-1, argument-2) |
Modulus (remainder) |
| NATIONAL-OF |
FUNCTION NATIONAL-OF(display [, codepage]) |
Convert to national |
| NUMVAL |
FUNCTION NUMVAL(string) |
Numeric value of string |
| NUMVAL-C |
FUNCTION NUMVAL-C(string [, currency]) |
Numeric value with currency |
| ORD |
FUNCTION ORD(character) |
Ordinal position in collating sequence |
| ORD-MAX |
FUNCTION ORD-MAX(argument ...) |
Position of maximum value |
| ORD-MIN |
FUNCTION ORD-MIN(argument ...) |
Position of minimum value |
| PI |
FUNCTION PI |
Value of pi (3.14159...) |
| PRESENT-VALUE |
FUNCTION PRESENT-VALUE(rate, amount ...) |
Present value calculation |
| RANDOM |
FUNCTION RANDOM[(seed)] |
Pseudo-random number 0 to 1 |
| RANGE |
FUNCTION RANGE(argument ...) |
Difference of max and min |
| REM |
FUNCTION REM(argument-1, argument-2) |
Remainder of division |
| REVERSE |
FUNCTION REVERSE(string) |
Reversed string |
| SIN |
FUNCTION SIN(argument) |
Sine |
| SQRT |
FUNCTION SQRT(argument) |
Square root |
| STANDARD-DEVIATION |
FUNCTION STANDARD-DEVIATION(argument ...) |
Standard deviation |
| SUM |
FUNCTION SUM(argument ...) |
Sum of arguments |
| TAN |
FUNCTION TAN(argument) |
Tangent |
| VARIANCE |
FUNCTION VARIANCE(argument ...) |
Variance |
| WHEN-COMPILED |
FUNCTION WHEN-COMPILED |
Compilation date/time |
| YEAR-TO-YYYY |
FUNCTION YEAR-TO-YYYY(year [, window]) |
Convert 2-digit to 4-digit year |
String Functions
| Function |
Signature |
Returns |
| LOWER-CASE |
FUNCTION LOWER-CASE(string) |
Lowercase string |
| TRIM |
FUNCTION TRIM(string [{LEADING | TRAILING}]) |
Trimmed string |
| UPPER-CASE |
FUNCTION UPPER-CASE(string) |
Uppercase string |
Date/Time Functions
| Function |
Signature |
Returns |
| CURRENT-DATE |
FUNCTION CURRENT-DATE |
YYYYMMDDHHMMSSssGMToffset (21 chars) |
| DATE-OF-INTEGER |
FUNCTION DATE-OF-INTEGER(n) |
YYYYMMDD |
| INTEGER-OF-DATE |
FUNCTION INTEGER-OF-DATE(YYYYMMDD) |
Integer day number |
| WHEN-COMPILED |
FUNCTION WHEN-COMPILED |
Compilation timestamp |
9. Arithmetic Expressions
Operators (in precedence order, highest first)
| Operator |
Meaning |
Example |
| ( ) |
Grouping |
(A + B) * C |
| ** |
Exponentiation |
A ** 2 |
| * |
Multiplication |
A * B |
| / |
Division |
A / B |
| + |
Addition |
A + B |
| - |
Subtraction |
A - B |
| Unary + / - |
Sign |
-A |
10. Figurative Constants
| Constant |
Value |
| ZERO / ZEROS / ZEROES |
Numeric zero or character '0' |
| SPACE / SPACES |
Space character(s) |
| HIGH-VALUE / HIGH-VALUES |
Highest character in collating sequence (X'FF' in EBCDIC) |
| LOW-VALUE / LOW-VALUES |
Lowest character in collating sequence (X'00' in EBCDIC) |
| QUOTE / QUOTES |
Quotation mark character |
| NULL / NULLS |
Null pointer value |
| ALL literal |
Repeated literal to fill field |
11. Reference Modification
data-name ( leftmost-character-position : [length] )
- leftmost-character-position — Integer starting position (1-based)
- length — Number of characters to reference (optional; defaults to remainder)
Example: WS-FULL-NAME(1:10) references the first 10 characters.
12. COPY and REPLACE Statements
COPY
COPY text-name [OF | IN library-name]
[REPLACING {==pseudo-text-1== | identifier-1 | literal-1 | word-1}
BY {==pseudo-text-2== | identifier-2 | literal-2 | word-2}} ...].
REPLACE
REPLACE {==pseudo-text-1== BY ==pseudo-text-2==} ... .
REPLACE OFF.
This quick reference covers the most commonly used COBOL syntax elements. For complete syntax details, consult the IBM Enterprise COBOL Language Reference or the ISO/IEC 1989 standard.