═══ 1. COBOL/370 Language Help ═══ COBOL/370 Language Help provides help on the following topics:  COBOL Source Program (Overall Format)  Identification Division  Environment Division  Data Division  Procedure Division  Procedure Division Statements  Intrinsic Functions  Compiler-Directing Statements  Compiler Options For information on any of these topics, click on the topic, or select the topic with your cursor and press Enter. ═══ 1.1. COBOL Source Program ═══ Description A COBOL source program is a syntactically correct set of COBOL statements. With the exception of the COPY and REPLACE statements and the end program header, the statements, entries, paragraphs, and sections of a COBOL source program are grouped into four divisions: the Identification, Environment, Data, and Procedure Divisions. The end of a COBOL source program is indicated by either the end program header, if specified, or by the absence of additional source program lines. Contained Programs: A COBOL source program may contain other COBOL source programs. These contained programs may reference some of the resources of the programs within which they are contained. Nested Programs: A program may be directly or indirectly contained in another program. For example, if program B is contained in program A, it is directly contained if there is no program contained in program A that also contains program B. Program B is indirectly contained in program A if there exists a program contained in program A that also contains program B. Here is the format for a separately compiled COBOL source program: ──┬──IDENTIFICATION DIVISION. ──┬────────────────────────── └──ID DIVISION. ──────────────┘ ──PROGRAM-ID. program-name-1──┬──────────────────────┬──.─── 1 └┬──┬─INITIAL┬───────┬─┘ 1 └IS┘ └PROGRAM┘ ──┬───────────────────────────────────┬───────────────────── └──identification-division-content──┘ ──┬──────────────────────────────────────────────────────┬── └──ENVIRONMENT DIVISION. environment-division-content──┘ ──┬────────────────────────────────────────┬──────────────── └──DATA DIVISION. data-division-content──┘ ──┬──────────────────────────────────────────────────┬────── └──PROCEDURE DIVISION. procedure-division-content──┘ ──┬───────────────────────────────────────────────────────┬─ └┬─────────────────────────┬END PROGRAM program-name-1.─┘ │ ┌─────────────────────┐ │ │  │ │ └─nested-source-program─┴─┘ 1 This separator period is optional as an IBM extension. ═══ 1.2. Identification Division ═══ Description The Identification Division must be the first division in every COBOL source program. It names the program and may include the date the program was written, the date of compilation, and other such documentary information about the program. The Identification Division must begin with the words IDENTIFICATION DIVISION or ID DIVISION followed by a separator period. The periods following PROGRAM-ID, the program-name, AUTHOR, INSTALLATION, DATE-WRITTEN, and SECURITY are optional. ──┬──IDENTIFICATION DIVISION. ──┬─────────────────────────── └──ID DIVISION. ──────────────┘ ─PROGRAM-ID. program-name─┬───────────────────────────────┬.─ └┬──┬┬COMMON─┬───────┬┬┬───────┬┘ └IS┘│ └INITIAL┘│└PROGRAM┘ └INITIAL─┬──────┬┘ └COMMON┘ ────┬─────────────────────────────────┬────────────────────── └──AUTHOR. ────┬────────────────┬─┘ │ ┌─────────────┐│ │  ││ └─comment-entry─┴┘ ────┬─────────────────────────────────────┬────────────────── └─INSTALLATION. ──┬────────────────┬──┘ │ ┌─────────────┐│ │  ││ └─comment-entry─┴┘ ────┬─────────────────────────────────────┬────────────────── └─DATE-WRITTEN. ──┬────────────────┬──┘ │ ┌─────────────┐│ │  ││ └─comment-entry─┴┘ ───┬───────────────────────────────────────┬───────────────── └──DATE-COMPILED. ──┬─────────────────┬─┘ │ ┌─────────────┐│ │  ││ └──comment-entry─┴┘ ───┬──────────────────────────────────┬────────────────────── └──SECURITY. ──┬─────────────────┬─┘ │ ┌─────────────┐│ │  ││ └──comment-entry─┴┘ ═══ 1.3. Environment Division ═══ Description The Environment Division is optional in a COBOL source program. It has two sections:  Configuration Section  Input-Output Section ─ENVIRONMENT DIVISION. ─┬───────────────────────────────── 1 └─CONFIGURATION SECTION. ───────── 2 1 ───────────────────────────────────────────────────────── 3 2 ─┬─────────────────────────────────────────────┬───────── 4 └─SOURCE-COMPUTER. ─┬───────────────────────┬─┘ └─source-computer-entry─┘ 3 ───────────────────────────────────────────────────────── 5 4 ─┬─────────────────────────────────────────────┬───────── 6 └─OBJECT-COMPUTER. ─┬───────────────────────┬─┘ └─object-computer-entry─┘ 5 ──────────────────────────────────────────────┬────────── 6 ──┬─────────────────────────────────────────┬─┘ └─SPECIAL-NAMES. ─┬─────────────────────┬─┘ └─special-names-entry─┘ ─┬─────────────────────────────────────────────────────── 7 │ └─INPUT-OUTPUT SECTION. FILE-CONTROL.─────────────────── 8 7 ───────────────────────────────────────────────────────── 9 ┌─────────────────────┐  │ 8 ─────file-control-paragraph┴─────────────────────────────10 9 ───────────────────────────────────────────────────────┬─ 10 ─┬────────────────────────────────────────────────────┬┘ └─I-O-CONTROL.─┬───────────────────────────────────┬─┘ │ ┌─────────────────────────────┐ │ │  │ │ └─input-output-control-paragraph┴─.─┘ ═══ 1.4. Configuration Section ═══ The Configuration Section is optional. It contains three paragraphs:  SOURCE-COMPUTER  OBJECT-COMPUTER  SPECIAL-NAMES When specified, the Configuration Section can describe the computer on which the source program is compiled and the computer on which the object program is executed. In addition, the Configuration Section can:  Relate IBM-defined environment-names to user-defined mnemonic names  Specify the collating sequence  Specify a substitution for the currency sign  Exchange the functions of the comma and the period in PICTURE clauses and numeric literals  Relate alphabet-names to character sets or collating sequences  Specify symbolic-characters  Relate class names to sets of characters Each paragraph must contain one, and only one, separator period immediately after the last entry in the paragraph. Do not specify the Configuration Section in a program that is contained within another program. The entries specified in the Configuration Section of a program apply to any program contained within that program. 1 ──────────────────────────────────────────────────── 3 2 ─┬─────────────────────────────────────────────┬──── 4 └─SOURCE-COMPUTER. ─┬───────────────────────┬─┘ └─source-computer-entry─┘ 3 ───────────────────────────────────────────────────── 5 4 ─┬─────────────────────────────────────────────┬───── 6 └─OBJECT-COMPUTER. ─┬───────────────────────┬─┘ └─object-computer-entry─┘ 5 ──────────────────────────────────────────────┬────── 6 ──┬─────────────────────────────────────────┬─┘ └─SPECIAL-NAMES. ─┬─────────────────────┬─┘ └─special-names-entry─┘ ═══ 1.5. SOURCE-COMPUTER Paragraph ═══ Description The SOURCE-COMPUTER paragraph describes the computer on which the source program is to be compiled. Except for the WITH DEBUGGING MODE clause, the SOURCE-COMPUTER paragraph is syntax-checked only and has no effect on the execution of the program. ───SOURCE-COMPUTER.──┬─────────────────────────────────1 └─computer-name───────────────────2 1─────────────────────────────────────────┬─────────── 2─────────┬─────────────────────────┬─.───┘ └┬──────┬─DEBUGGING MODE──┘ └─WITH─┘ ═══ WITH DEBUGGING MODE ═══  The WITH DEBUGGING MODE clause activates a compile-time switch for debugging lines written in the source program.  A debugging line is a statement compiled only when the compile-time switch is activated.  To specify a debugging line in your program, code a 'D' in column 7 (the indicator area). You can include successive debugging lines, but each must have a 'D' in column 7. Do not break character strings across lines.  You must write all your debugging lines so that the program is syntactically correct, whether the debugging lines are compiled or treated as comments.  The presence or absence of the WITH DEBUGGING MODE clause is logically determined after all COPY and REPLACE statements have been processed.  You can code debugging lines in the Environment (after the OBJECT-COMPUTER paragraph), Data, or Procedure Divisions.  If a debugging line contains only spaces in Area A and Area B, it is treated the same as a blank line. ═══ 1.6. OBJECT-COMPUTER Paragraph ═══ Description The OBJECT-COMPUTER paragraph specifies the systems for which the object program is designated. Except for the PROGRAM COLLATING SEQUENCE clause, the OBJECT-COMPUTER clause is syntax-checked only and has no effect on the execution of the program. ───OBJECT-COMPUTER. ─┬──────────────────────────────────1 └─computer-name────────────────────2 1──────────────────────────────────────────────────────3 2────┬────────────────────────────────────┬────────────4 └─MEMORY┬────┬integer─┬─WORDS──────┬─┘ └SIZE┘ ├─CHARACTERS─┤ └─MODULES────┘ 3──────────────────────────────────────────────────────5 4──┬────────────────────────────────────────────────┬──6 └┬───────┬┬─────────┬─SEQUENCE┬──┬─alphabet-name─┘ └PROGRAM┘└COLLATING┘ └IS┘ 5─────────────────────────────────────────────────┬─── 6──┬───────────────────────────────────────┬──. ──┘ └──SEGMENT-LIMIT┬──┬─priority-number────┘ └IS┘ ═══ PROGRAM COLLATING SEQUENCE IS ═══  The PROGRAM COLLATING SEQUENCE clause determines the collating sequence to be used in a COBOL program. The collating sequence associated with the specific alphabet-name pertains to the program in which the clause is specified, and to other programs contained within that program.  PROGRAM COLLATING SEQUENCE determines the truth value of the following nonnumeric comparisons: - Those explicitly specified in relation conditions. - Those explicitly specified in condition-name conditions.  The PROGRAM COLLATING SEQUENCE clause also applies to any nonnumeric merge or sort keys (unless you specify the COLLATING SEQUENCE phrase in the MERGE or SORT statement).  The PROGRAM COLLATING SEQUENCE clause is not applied to the DBCS character set.  If you omit the PROGRAM COLLATING SEQUENCE clause, the EBCDIC collating sequence is used. ═══ SEGMENT-LIMIT IS ═══  Certain permanent segments can be overlaid by independent segments while still retaining the logical properties of fixed portion segments. (Fixed portion segments are made up of fixed permanent and fixed overlayable segments.)  When you specify SEGMENT-LIMIT: - A fixed permanent segment is one with a priority-number less than the priority-number specified. - A fixed overlayable segment is one with a priority-number ranging from that specified through 49, inclusive.  For example, if you specify SEGMENT-LIMIT IS 25: - Sections with priority-numbers 0 through 24 are fixed permanent segments. - Sections with priority-numbers 25 through 49 are fixed overlayable segments.  If you omit the SEGMENT-LIMIT clause, all sections with priority-numbers 0 through 49 are fixed permanent segments. ═══ 1.7. SPECIAL-NAMES Paragraph ═══ Definition The SPECIAL-NAMES paragraph:  Relates IBM-specified environment-names to user-defined mnemonic-names.  Relates alphabetic-names to character sets or collating sequences.  Specifies symbolic characters.  Relates class names to sets of characters.  Specifies a substitute character for the currency sign.  Specifies that the functions of the comma and decimal point are to be interchanged in PICTURE clauses and numeric literals. ┌──────────────────────────────────────────────1  ───SPECIAL-NAMES. ─┬──────────────────────────────────────────────2 ├─environment-name-1───────────────────────────3 │ └─environment-name-2───────────────────────────4 1──────────────────────────────────────────────────────────────────┐ │ 2──────────────────────────────────────────────────────────────────┼ 3─┬──┬mnemonic-name-1──────────────────────────────────────────────┤ └IS┘ │ 4┬┬──┬mnemonic-name-2┬────────────────────────────────────────────┬┘ │└IS┘ │ │ │ ├ON┬──────┬┬──┬cond-1┬─────────────────────┬┬┤ │ │ └STATUS┘└IS┘ │ │││ │ │ └OFF┬──────┬┬──┬cond-2┘││ │ │ └STATUS┘└IS┘ ││ │ └OFF┬──────┬┬──┬cond-2┬────────────────────┬┘│ │ └STATUS┘└IS┘ │ │ │ │ └ON┬──────┬┬──┬cond-1┘ │ │ └STATUS┘└IS┘ │ │ │ ├─ON┬──────┬┬──┬cond-1─┬─────────────────────┬┬──────────────────┘ │ └STATUS┘└IS┘ │ ││ │ └OFF┬──────┬┬──┬cond-2┘│ │ └STATUS┘└IS┘ │ └─OFF┬──────┬┬──┬cond-2┬─────────────────────┬┘ └STATUS┘└IS┘ │ │ └ON┬──────┬┬──┬cond-1─┘ └STATUS┘└IS┘ ─┬───────────────────────────────────────────────────────────────┬ │ ┌────────────────────────────────────────────────────────────┐│ │  ││ └─ALPHABET alphabet-name-1┬──┬┬STANDARD-1┬────────────────────┬┴┘ └IS┘├STANDARD-2┤ │ ├NATIVE────┤ │ ├EBCDIC────┘ │ │┌─────────────────────────────┐│ │ ││ └─literal-1┬──────────────────┬┴┘ ├┬THROUGH┬literal-2┤ │└THRU───┘ │ │ ┌──────────────┐ │ │  │ │ └──ALSO literal-3┴─┘ ┌──────────────────────────────────────────────────────────5  ──┬──────────────────────────────────────────────────────────6 │ ┌───────────────────────────────7 │ │ ┌────────────────────┐ │   │ └──SYMBOLIC─┬────────────┬────symbolic-character-1┴────────8 └─CHARACTERS─┘ 5────────────────────────────────────────────────────────┐ │ 6────────────────────────────────────────────────────────┼── 7────────────────────────────────┐ │ ┌────────┤ │  │ │ 8──────────────┬─────┬──integer-1┴─┬────────────────────┬┘ ├─ARE─┤ └─IN alphabet-name-2─┘ └─IS──┘ ┌─────────────────────────────────────────────────────────────┐  │ ──┬─────────────────────────────────────────────────────────────┼─ │ ┌──────────────────────────────────┐ │ │  │ │ └─CLASS class-name-1─┬──┬──literal-4┬───────────────────────┼─┘ └IS┘ └─┬─THROUGH─┬─literal-5─┘ └─THRU────┘ ──┬────────────────────────────┬──┬────────────────────────┬─┬─┬─ └CURRENCY┌────┬┬──┬literal-6─┘ └─DECIMAL-POINT┬──┬COMMA─┘ └.┘ └SIGN┘└IS┘ └IS┘ ═══ environment-name-1 ═══ Environment-name-1 represents the system devices or standard system actions taken by the compiler. Valid specifications for environment-name-1 are as follows: Environment- Meaning Allowed In name-1 SYSIN System logical input unit ACCEPT SYSIPT SYSOUT System logical output unit DISPLAY SYSLIST SYSLST SYSPUNCH System punch device DISPLAY SYSPCH CONSOLE Console typewriter ACCEPT, DISPLAY C01 - C12 Skip to channel 1 through WRITE ADVANCING 12, respectively CSP Suppress spacing WRITE ADVANCING S01-S05 Pocket select 1-5 WRITE ADVANCING on punch devices ═══ cond-1, cond-2 ═══ Condition-names follow the rules for user-defined names. At least 1 character must be alphabetic. The value associated with the condition-name is considered alphanumeric. A condition-name may be associated with the on status and/or off status of each UPSI switch specified. In the Procedure Division, the UPSI switch status is tested by a "switch status condition" using the associated condition-name. The result of the test is true if the UPSI switch is set to the value (0 or 1) corresponding to the specified condition-name. Each condition-name is the equivalent of a level-88 item; if you specify the associated mnemonic-name, it is considered the conditional variable and can be used for qualification. Condition-names specified in a containing program's SPECIAL-NAMES paragraph may be referenced from any contained program. ═══ ALPHABET Clause ═══  The ALPHABET alphabet-name-1 IS clause provides a means of relating an alphabet-name to a specified character code set or collating sequence.  It specifies a collating sequence when used in either: - The PROGRAM COLLATING SEQUENCE clause of the OBJECT-COMPUTER paragraph - The COLLATING SEQUENCE phrase of the SORT or MERGE statement.  It specifies a character code set when specified in either: - The FD entry CODE-SET clause - The SYMBOLIC CHARACTERS clause. ═══ literal-1, literal-2, literal-3 ═══  When you specify literal-1, literal-2, or literal-3, the alphabet-name must not be referred to in a CODE-SET clause. Do not specify a SYMBOLIC CHARACTER figurative constant as literal-1, literal-2 or literal-3.  Do not use DBCS literals in a user-specified collating sequence, and do not use floating-point literals in a user-specified collating sequence.  Literal-1, literal-2, and literal-3 specify that the collating sequence is to be determined by the program, according to the following rules: - The order in which literals appear specifies the ordinal number, in ascending sequence, of the character or characters in this collating sequence. - Each numeric literal you specify must be an unsigned integer and must have a value from 1 through 256. The value of each literal specifies the ordinal number, beginning with 1, of a character within the EBCDIC character set. - Each character in a nonnumeric literal represents that actual character in the EBCDIC character set. - Any EBCDIC characters that you do not explicitly specify assume positions in this collating sequence higher than any of the explicitly specified characters. - Within one ALPHABET-NAME clause, do not specify a given character more than once. - Each nonnumeric literal associated with a THROUGH or ALSO phrase must be 1 character in length. - When you specify the THROUGH phrase, the contiguous characters in the native character set beginning with the character specified by literal-1 and ending with the character specified by literal-2 are assigned successively ascending positions in this collating sequence. This sequence may be either ascending or descending within the original native character set. - When you specify the ALSO phrase, EBCDIC characters specified as literal-1, literal-3, etc., are assigned to the same position in this collating sequence. - When you specify the ALSO phrase and alphabet-name-1 is referenced in a SYMBOLIC CHARACTERS clause, only literal-1 is used to represent the character in the EBCDIC set. - The character having the highest ordinal position in this collating sequence is associated with the figurative constant HIGH-VALUE. - The character having the lowest ordinal position in this collating sequence is associated with the figurative constant LOW-VALUE. ═══ SYMBOLIC CHARACTERS Clause ═══ SYMBOLIC CHARACTERS symbolic-character-1 provides a means of specifying one or more symbolic characters. Symbolic-character-1 is a user-defined word (it may be a DBCS user-defined word) and must contain at least 1 alphabetic character. The same symbolic-character must appear only once in a SYMBOLIC CHARACTERS clause. ═══ Integer-1 ═══ The internal representation of symbolic-character-1 is the internal representation of the character that is represented in the specified character set. The following rules apply:  .There must be a one-to-one correspondence between occurrences of symbolic-character-1 and occurrences of integer-1 in a SYMBOLIC CHARACTERS clause.  If you specify the IN phrase, integer-1 specifies the ordinal position of the character represented in the character set named by alphabet-name-2. This ordinal position must exist.  If you do not specify the IN phrase, symbolic-character-1 represents the character whose ordinal position in the native character set is specified by integer-1. Note: Ordinal positions are numbered starting from 1. ═══ literal-4, literal-5 ═══  If numeric, literal-4 and literal-5 must be unsigned integers and must have a value greater than or equal to 1 and less than or equal to the number of characters in the alphabet specified. Each number corresponds to the ordinal position of each character in the EBCDIC collating series.  Do not specify literal-4 or literal-5 as floating-point or DBCS literals.  If nonnumeric, the literal is the actual EBCDIC character. Literal-4 and literal-5 must not specify a symbolic-character figurative constant. If the value of the nonnumeric literal contains multiple characters, each character in the literal is included in the set of characters identified by class-name.  If the nonnumeric literal is associated with a THROUGH phrase, the literal must be 1 character in length.  If you specify the THROUGH phrase, class-name includes those characters beginning with the value of literal-4 and ending with the value of literal-5. The characters specified by a THROUGH phrase may specify characters in either ascending or descending order. ═══ literal-6 ═══ Literal-6 must be a one-character, nonnumeric literal, and must not be any of the following:  Digits zero (0) through nine (9)  Uppercase alphabetic characters A B C D P R S V X Z  Lowercase alphabetic characters a through z  The space  Special characters * + - / , . ; ( ) =  A figurative constant  The hexadecimal values X'20' or X'21'  The uppercase alphabetic character G, if the COBOL program defines DBCS items with the PICTURE symbol G.  The uppercase alphabetic character N, if the COBOL program defines DBCS items with the PICTURE symbol N.  The uppercase alphabetic character E, if the COBOL program defines external floating-point data items. ═══ 1.8. Input-Output Section ═══ Description The Input-Output section of the Environment Division contains two paragraphs:  FILE-CONTROL paragraph  I-O-CONTROL paragraph ┌──────────────────────┐  │ ─────INPUT-OUTPUT SECTION. FILE-CONTROL. file-control-paragraph─┴─── ──┬────────────────────────────────────────────────────────┬───────── └──I-O-CONTROL. ──┬────────────────────────────────────┬─┘ │ ┌──────────────────────────────┐ │ │  │ │ └─input-output-control-paragraph─┴─.─┘ ═══ 1.9. FILE-CONTROL Paragraph ═══  The FILE-CONTROL paragraph associates each file in a COBOL program with an external data set, and specifies the file organization, access mode, and other information.  The FILE-CONTROL paragraph begins with the word "FILE-CONTROL" in Area A, followed by a separator period. The key word FILE-CONTROL may appear only once, at the beginning of the FILE-CONTROL paragraph.  The FILE-CONTROL paragraph must contain one and only one entry for each file described in an FD or SD entry in the Data Division. Within each entry, the SELECT clause must appear first. The other clauses may appear in any order.  The FILE-CONTROL paragraph has three formats: - QSAM and VSAM Sequential file entries - VSAM Indexed file entries - VSAM Relative file entries ═══ QSAM and VSAM Sequential File Entries ═══ Description The optional FILE-CONTROL paragraph associates each file in the COBOL program with an external data set, and specifies file organization, access mode, and other information. Format 1 (QSAM and VSAM Sequential File Entries) ───SELECT─────┬──────────┬─────────────file-name-1──────── └─OPTIONAL─┘ ┌────────────────┐  │ ──ASSIGN─┬──┬─assignment-name-1┴────────────────────────── └TO┘ ──┬──────────────────────────┬──────────────────────────── └─RESERVE integer─┬───────┬┘ ├─AREA──┤ └─AREAS─┘ ──┬────────────────────────────────┬────────────────────── └─┬─────────────────┬─SEQUENTIAL─┘ └─ORGANIZATION┬──┬┘ └IS┘ ──┬───────────────────────────────────────┬─────────────── └─PADDING┬─────────┬┬──┬┬─data-name-5─┬─┘ └CHARACTER┘└IS┘└─literal-1───┘ ──┬────────────────────────────────────────────┬────────── └─RECORD DELIMITER┬──┬┬─STANDARD-1────────┬──┘ └IS┘└─assignment-name-2─┘ ──────────┬────────────────────────────┬────────────────── └─ACCESS┬────┬┬──┬SEQUENTIAL─┘ └MODE┘└IS┘ ──┬─────────────────────────┬───────────────────────────── └─PASSWORD┬──┬data-name-6─┘ └IS┘ ───┬────────────────────────────────────────────┬──. ────── └┬────┬STATUS┬──┬data-name-1─┬─────────────┬─┘ └FILE┘ └IS┘ └─data-name-8─┘ ═══ VSAM Indexed File Entries ═══ Description The optional FILE-CONTROL paragraph associates each file in the COBOL program with an external data set, and specifies file organization, access mode, and other information. Format 2 (VSAM Indexed File Entries) ───SELECT─────┬──────────┬─────────────file-name-1───────── └─OPTIONAL─┘ ┌────────────────┐  │ ──ASSIGN┬──┬assignment-name-1┴───────────────────────────── └TO┘ ────┬──────────────────────────┬─────────────────────────── └─RESERVE integer─┬───────┬┘ ├─AREA──┤ └─AREAS─┘ ──┬─────────────────┬───INDEXED──────────────────────────── └─ORGANIZATION┬──┬┘ └IS┘ ───┬────────────────────────────────┬───────────────────── └─ACCESS┬────┬┬──┬┬─SEQUENTIAL─┬─┘ └MODE┘└IS┘├─RANDOM─────┤ └─DYNAMIC────┘ ──RECORD┬───┬┬──┬data-name-2─┬─────────────────────────┬── └KEY┘└IS┘ └─PASSWORD┬──┬data-name-6─┘ └IS┘ ┌─────────────────────────────────────────────────────1  ──┬─────────────────────────────────────────────────────2 └─ALTERNATE───RECORD──┬───┬┬──┬─data-name-3───────────3 └KEY┘└IS┘ 1─────────────────────────────────────────────────────┐ │ 2─────────────────────────────────────────────────────┼── 3──┬─────────────────────────┬─┬─────────────────┬────┘ └─PASSWORD┬──┬data-name-7─┘ └┬────┬DUPLICATES─┘ └IS┘ └WITH┘ ──┬─────────────────────────────────────────────┬─. ───── └┬────┬STATUS┬──┬─data-name-1─┬─────────────┬─┘ └FILE┘ └IS┘ └─data-name-8─┘ ═══ VSAM Relative File Entries ═══ Description The optional FILE-CONTROL paragraph associates each file in the COBOL program with an external data set, and specifies file organization, access mode, and other information. Format 3 (VSAM Relative File Entries) ───SELECT─────┬──────────┬──────────────file-name-1───────── └─OPTIONAL─┘ ┌────────────────┐  │ ──ASSIGN┬──┬assignment-name-1┴───────────────────────────── └TO┘ ────┬──────────────────────────┬─────────────────────────── └─RESERVE integer─┬───────┬┘ ├─AREA──┤ └─AREAS─┘ ──┬─────────────────┬────RELATIVE─────────────────────────── └─ORGANIZATION┬──┬┘ └IS┘ ─┬─────────────────────────────────────────────────────────┬ └ACCESS┬────┬┬──┬┬SEQUENTIAL┬────────────────────────────┬┘ └MODE┘└IS┘│ └RELATIVE┬───┬┬──┬data-name-4┤ │ └KEY┘└IS┘ │ └┬─RANDOM──┬RELATIVE┬───┬┬──┬data-name-4┘ └─DYNAMIC─┘ └KEY┘└IS┘ ──┬─────────────────────────┬─────────────────────────────── └─PASSWORD┬──┬data-name-6─┘ └IS┘ ──┬────────────────────────────────────────────┬─. ─────── └┬────┬STATUS┬──┬data-name-1─┬─────────────┬─┘ └FILE┘ └IS┘ └─data-name-8─┘ ═══ 1.10. ASSIGN Clause ═══ Description The ASSIGN clause associates the program's DD statement name for a file with the external name for the actual data set. If the file connector referenced by file-name-1 in the SELECT clause is an external file connector, all file control entries in the run unit that references this file connector must have a consistent specification for assignment-name-1 in the ASSIGN clause. For QSAM files and VSAM indexed and relative files, the name specified on the first assignment-name-1 must be identical. For VSAM sequential files, you must specify it as AS-name. QSAM File Format ───┬────────────┬──┬───────┬──name─── └──label-────┘ └──S-───┘ VSAM Sequential File Format ───┬─────────────┬──AS-name─── └───label-────┘ VSAM Indexed or Relative File Format ───┬─────────────┬──name─── └───label-────┘ ═══ name ═══ Name represents a required 1- to 8-character field that specifies the external name for this file. Under MVS it must be the name specified in the DD statement for this file. Name must conform to the rules for formation of a program-name. If assignment-name-1 is specified as a nonnumeric literal, name must follow the rules for formation of a program-name in the outermost program. In a sort or merge file, name is treated as a comment. ═══ data-name-2 ═══  Data-name-2 represents the prime RECORD KEY data item. Describe it as an alphanumeric item within a record description entry associated with the file. It must not reference a group item that contains a variable occurrence data item.  Data-name-2 may be qualified. Data-name-2 may be numeric, numeric-edited, alphanumeric-edited, alphabetic, floating-point (BOTH EXTERNAL AND INTERNAL), or a DBCS data item. The key is treated as an alphanumeric item for the input and output statements for the file named in the SELECT clause. When you specify data-name-2 as a DBCS item, a key specified on the READ statement must also be a DBCS data item.  The data description of data-name-2 and its relative location within the record must be the same as those used when the file was defined. ═══ data-name-8 ═══ Define data-name-8 as a group item of 6 bytes in the Working-Storage or Linkage Section of the Data Division.  The first 2 bytes of data-name-8 contain the VSAM return code in binary notation. The value for this code is defined (by VSAM) as 0, 8, or 12.  The next 2 bytes of data-name-8 contain the VSAM function code in the binary notation. The value for this code is defined (by VSAM) as 0, 1, 2, 3, 4, or 5.  The last 2 bytes of data-name-8 contain the VSAM feedback code in binary notation. The code value is 0 through 255. Specify data-name-8 only if the file is a VSAM file (that is, ESDS, KSDS, RRDS). If VSAM returns a nonzero return code, data-name-8 is set. If data-name-1 is set to zero, the content of data-name-8 is undefined. ═══ 1.11. I-O-CONTROL Paragraph ═══ Description  The I-O-CONTROL paragraph of the INPUT-OUTPUT SECTION specifies when checkpoints are to be taken and which storage areas are to be shared by different files. It also specifies information needed for efficient transmission of data between the external data set and the COBOL program. This paragraph is optional in a COBOL program.  The key word I-O-CONTROL may appear only once, at the beginning of the paragraph. The word I-O-CONTROL must begin in Area A and must be followed by a separator period.  Each clause within the paragraph may be separated from the next clause by a separator comma or a separator semicolon. The order in which I-O-CONTROL paragraph clauses are written is not significant. The I-O-CONTROL paragraph ends with a separator period.  The I-O-CONTROL paragraph has three formats: - Format 1 (QSAM Files) - Format 2 (VSAM Files) - Format 3 (SORT/MERGE Files) ═══ I-O-CONTROL Paragraph Format 1 (QSAM Files) ═══ Format 1 (QSAM Files) ──I-O-CONTROL.──────────────────────────────────────── ────┬────────────────────────────────────────────────── 1 │ │┌───────────────────────────────────────────────── 2 │ └─┬─RERUN──ON──assignment-name-1─────────────────── 3 │ ├─SAME─┬──────┬─┬────┬─┬───┬───────────────────── 4 │ └RECORD┘ └AREA┘ └FOR┘ ├─MULTIPLE FILE─┬────┬┬────────┬───────────────── 5 │ └TAPE┘└CONTAINS┘ │ ┌────────────┐ │  │ └──────APPLY WRITE-ONLY┬──┬──file-name-2─┴─────── 6 └ON┘ 1 ──────────────────────────────────────────────────┬── │ 2 ────────────────────────────────────────────────┐ │ │ │ 3 ─┬─────┬─┬integer-1 RECORDS┬┬──┬─file-name-1───┬┴.┘ └EVERY┘ └END─┬──┬┬─REEL─┬─┘└OF┘ │ └OF┘└─UNIT─┘ │ ┌────────────┐ │  │ │ 4 ──file-name-3──file-name-4──┴──────────────────┤ ┌────────────────────────────────┐ │  │ │ 5 ───file-name-5─┬────────────────────┼──────────┤ └─POSITION integer-2─┘ │ 6 ───────────────────────────────────────────────┘ ═══ I-O-CONTROL Paragraph Format 2 (VSAM Files) ═══ Format 2 (VSAM Files) ──I-O-CONTROL.───────────────────────────────────────── ───┬────────────────────────────────────────────────────1 │┌───────────────────────────────────────────────────2 │ └─┬RERUN──ON──assignment-name-1──────────────────────3 │ │ └─SAME─┬────────┬─┬──────┬┬─────┬─file-name-3──────4 └─RECORD─┘ └─AREA─┘└─FOR─┘ 1─────────────────────────────────────────────────┬───── 2──────────────────────────────────────────────┐ │ │ │ 3─┬─────┬──integer-1 RECORDS─┬──┬──file-name-1─┼.─┘ └EVERY┘ ┌────────────┐ └OF┘ │  │ │ 4──────────────file-name-4─┴───────────────────┘ ═══ I-O-CONTROL Paragraph Format 3 (Sort/Merge Files) ═══ Format 3 (Sort/Merge Files) ─I-O-CONTROL.─────────────────────────────────────────────────────────── ─┬─────────────────────────────────────────────────────────────────────┬ │ ┌───────────────────────────────────────────────────────────────┐ │ │  │ │ └─┬─RERUN ON assignment-name-1────────────────────────────────────┼─.─┘ │ │ │ │ └─SAME─┬────────────┬─┬──────┬┬─────┬─file-name-3──file-name-4──┘ ├─RECORD─────┤ └─AREA─┘└─FOR─┘ ├─SORT───────┤ └─SORT-MERGE─┘ ═══ RERUN Clause (SORT/MERGE files) ═══  The RERUN clause specifies that checkpoint records are to be taken. Subject to the restrictions given with each phrase, you can specify more than one RERUN clause.  Do not use the RERUN clause with files that have been defined with the EXTERNAL attribute.  In the I-O-CONTROL paragraph, when you specify the RERUN clause, checkpoint records are written at logical intervals determined by the sort/merge program during execution of each SORT or MERGE statement in the program. When you omit the RERUN clause, checkpoint records are not written.  There may be only one Format 3 I-O-CONTROL paragraph in a program. Do not specify it in contained programs; it will have a global effect on all SORT and MERGE statements in the program unit. ═══ assignment-name-1 (QSAM File Format) ═══ Description Assignment-name-1 represents the external data set for the checkpoint file. It must not be the same assignment-name as that specified in any ASSIGN clause throughout the entire program, including contained and containing programs. Assignment-name-1 must reside on a tape or direct access device, and must be a QSAM file: ───┬──────────────┬──┬───────┬──name─── └────label-────┘ └──S-───┘ ═══ SAME RECORD AREA ═══  The SAME RECORD AREA clause specifies that two or more files are to use the same main storage area for processing the current logical record. All the files may be open at the same time. A logical record in the shared storage area is considered to be both of the following: - A logical record of each opened output file in the SAME RECORD AREA clause - A logical record of the most recently read input file in the SAME RECORD AREA clause.  For QSAM files, the SAME clause is treated as documentation.  For VSAM files, the SAME clause is treated as if equivalent to the SAME RECORD AREA. ═══ 1.12. Data Division ═══ Description The Data Division of a COBOL source program describes, in a structured manner, all the data to be processed by the object program. In a COBOL source program, the Data Division is optional. The Data Division is divided into three sections. Each section has a specific logical function within a COBOL source program, and each may be omitted from the source program when that logical function is not needed. If you include these sections, they must be written in the order shown: File Section Defines the structure of data files (including sort-merge files). Working-Storage Section Describes records and subordinate data items that are not part of data files but are developed and processed by the program. Linkage Section Describes data made available by another program. It appears in the called program and describes data items that are referred to by the calling and the called programs. ──DATA DIVISION.────────────────────────────────────────── ─┬────────────────────────────────────────────────────────┬ │ ┌────────────────────────────────────────┐│ │  ││ └─FILE SECTION.┬────────────────────────────────────────┼┘ │ │ └file-description-entry────────────item-1┘ ─┬───────────────────────────────────────────────────────┬─ │ ┌───────────────────────────┐│ │  ││ └WORKING-STORAGE SECTION.──┬───────────────────────────┼┘ ├record-description-entry───┤ └data-item-description-entry┘ ─┬───────────────────────────────────────────────────┬──── │ ┌─────────────────────────────┐ │ │  │ │ └─LINKAGE SECTION. ─┬─────────────────────────────┼─┘ ├─record-description-entry────┤ └─data-item-description-entry─┘ where item-1 is: ┌────────────────────────┐  │ ───────record-description-entry─┴─────── ═══ 1.13. Linkage Section ═══ Description The Linkage Section describes data made available from another program. Record description entries and data item description entries in the Linkage Section provide names and descriptions, but storage within the program is not reserved because the data area exists elsewhere. You can use any data description clause to describe items in the Linkage Section with the following exceptions:  The VALUE clause may not be specified for items other than level-88 items.  The EXTERNAL clause may not be specified.  The GLOBAL clause may be specified as an IBM extension. Like the Working-Storage Section, the Linkage Section has three formats:  Format 1 (All Data Division Sections): Use Format 1 for data description entries in all Data Division sections. Specific rules and restrictions for each clause are noted under discussion of the individual clause.  Format 2 (RENAMES Clause -- Level-66 Entry): Format 2 regroups previously defined items.  Format 3 (Condition-Name VALUE Clause -- Level-88 Entry): Format 3 associates a single value, multiple values, and/or range(s) of values with a condition-name. ═══ 1.14. Working-Storage Section ═══ Description The Working-Storage Section describes data records that are not part of data files but are developed and processed by the program. It also describes data items whose values are assigned in the source program and do not change during execution of the object program. The Working-Storage Section may also describe external data records that are shared by programs throughout the run unit. The Working-Storage Section must begin with the section header WORKING-STORAGE SECTION, followed by a separator period. The Working-Storage Section contains record description entries and data description entries for independent data items, called data item description entries. A data description entry specifies the characteristics of a data item. A data description entry has three formats:  Format 1 (All Data Division Sections): Use Format 1 for data description entries in all Data Division sections. Specific rules and restrictions for each clause are noted under discussion of the individual clause.  Format 2 (RENAMES Clause -- Level-66 Entry): Format 2 regroups previously defined items.  Format 3 (Condition-Name VALUE Clause -- Level-88 Entry): Format 3 associates a single value, multiple values, and/or range(s) of values with a condition-name. ═══ Format 1 (All Data Division Sections) ═══ Description Use Format 1 for data description entries in all Data Division sections. A space, a separator comma, or a separator semicolon must separate clauses. Note: You can write the clauses in any order, with two exceptions:  If you specify data-name or FILLER, it must immediately follow the level-number.  When you specify the REDEFINES clause, it must immediately follow data-name or FILLER, if either is specified. If you do not specify data-name or FILLER, the REDEFINES clause must immediately follow the level-number. Specific rules and restrictions for each clause are noted under the discussion of the individual clause. Format 1 (All Data Division Sections) ──level─number──┬─────────────┬─────────────────── ├──data─name──┤ └──FILLER─────┘ ───┬──────────────────┬──────────────────────────── └─REDEFINES clause─┘ ───┬────────────────────────┬──┬─────────────────┬─ └─BLANK WHEN ZERO clause─┘ └─EXTERNAL clause─┘ ───┬───────────────┬──┬──────────────────┬───────── └─GLOBAL clause─┘ └─JUSTIFIED clause─┘ ───┬───────────────┬──┬────────────────┬─────────── └─OCCURS clause─┘ └─PICTURE clause─┘ ───┬─────────────┬──┬─────────────────────┬──────── └─SIGN clause─┘ └─SYNCHRONIZED clause─┘ ───┬──────────────┬──┬──────────────┬────────────── └─USAGE clause─┘ └─VALUE clause─┘ ═══ 1.15. Format 2 (RENAMES Clause -- Level-66 Entry) ═══ Description Format 2 (RENAMES Clause -- Level-66 Entry) regroups previously defined items by specifying alternative, possibly overlapping, groupings of elementary data items. You must use the level number 66 for data description entries that contain the RENAMES clause. A level-66 entry cannot rename another level-66 entry, nor can it rename a level-01, level-77, or level-88 entry. One or more RENAMES entries can be written for a logical record. All RENAMES entries associated with one logical record must immediately follow that record's last data description entry. Level number 66 and data-name-1 are not a part of the RENAMES clause itself and are included in the format below only for clarity. Format 2 (RENAMES Clause -- Level-66 Entry) ──66 data─name─1 RENAMES data-name-2──┬───────────────────────────┬── ├──THROUGH──┬──data-name-3──┘ └──THRU─────┘ ═══ data-name-2, data-name-3 ═══ Data-name-2 and data-name-3 identify the original grouping of data items; that is, they must name elementary or group items within the associated level-01 entry, and must not be the same data-name. Both data-names may be qualified. The OCCURS clause must not be specified in the data entries for data-name-2 and data-name-3, or for any group entry to which they are subordinate. In addition, the OCCURS DEPENDING ON clause must not be specified for any item defined between data-name-2 and data-name-3. When data-name-3 is specified, data-name-1 is treated as a group item that includes all elementary items:  Starting with data-name-2 (if it is an elementary item) or the first elementary item within data-name-2 (if it is a group item)  Ending with data-name-3 (if it is an elementary item) or the last elementary item within data-name-3 (if it is a group item). The key words THROUGH and THRU are equivalent. The leftmost character in data-name-3 must not precede the leftmost character in data-name-2; the rightmost character in data-name-3 must not precede the rightmost character in data-name-2. This means that data-name-3 may not be totally subordinate to data-name-2. When data-name-3 is not specified, all of the data attributes of data-name-2 become the data attributes for data-name-1. That is:  When data-name-2 is a group item, data-name-1 is treated as a group item.  When data-name-2 is an elementary item, data-name-1 is treated as an elementary item. ═══ data-name-1 ═══  Data-name-1 must be an elementary unsigned integer.  The number of character positions in the record must be placed into the data item referenced by data-name-1 before any RELEASE, REWRITE, START, or WRITE statement is executed for the file.  The execution of a DELETE, RELEASE, REWRITE, START, or WRITE statement, or the unsuccessful execution of a READ or RETURN statement does not alter the content of the data item referenced by data-name-1.  After the successful execution of a READ or RETURN statement for the file, the contents of the data item referenced by data-name-1 indicate the number of character positions in the record just read. ═══ 1.16. Level-Number ═══ Description Level-number specifies the hierarchy of data within a record and identifies special-purpose data entries. In Format 1, level-number can be any number from 01-49 or 77.  Level-numbers 01 and 77 must begin in Area A and be followed either by a separator period or by a space followed by its associated data-name, FILLER, or appropriate data description clause.  Level-numbers 02 through 49 can begin in Areas A or B and must be followed by a space or a separator period.  Level-numbers 66 and 88 can begin in Areas A or B and must be followed by a space. You can substitute single-digit level-numbers 1 through 9 for level-numbers 01 through 09. ═══ 1.17. EXTERNAL Clause ═══ Description The EXTERNAL clause specifies that the storage associated with a data item is associated with the run unit rather than with any particular program within the run unit. You can specify the EXTERNAL clause only in data description entries in the Working-Storage Section whose level-number is 01. You cannot specify it in the Linkage Section or in the File Section. ────────EXTERNAL────────────────────────────────── ═══ 1.18. GLOBAL Clause ═══ Description The GLOBAL clause specifies that a data-name is available to every program contained within the program that declares it, as long as the contained program itself does not have a declaration for that name. All data-names subordinate to or condition-names or indexes associated with a global name are global names. You can specify the GLOBAL clause in the Working-Storage Section, the File Section, and the Linkage Section, but only specify this clause in Data Description Entries whose level-number is 01. ───────GLOBAL─────────────────────────────────── ═══ 1.19. BLANK WHEN ZERO Clause ═══ Description The BLANK WHEN ZERO clause specifies that an item contains nothing but spaces when its value is zero. You can specify the BLANK WHEN ZERO clause only for elementary numeric or numeric-edited items (with the exception of external floating point). These items must be described, either implicitly or explicitly, as USAGE IS DISPLAY.  Do not specify the BLANK WHEN ZERO clause for level-66 or level-88 items.  Do not specify the BLANK WHEN ZERO clause for the same entry as the PICTURE symbols S or *. The BLANK WHEN ZERO clause is not allowed for any of the following: - Items described with the USAGE IS INDEX clause - DBCS items - Items described with the USAGE IS POINTER or USAGE IS PROCEDURE-POINTER clause - External or internal floating-point items ───BLANK┬────┬─┬──ZERO────┬─── └WHEN┘ ├──ZEROS───┤ └──ZEROES──┘ ═══ 1.20. JUSTIFIED Clause ═══ Description The JUSTIFIED clause overrides standard positioning rules for a receiving item of the alphabetic or alphanumeric categories. You can specify JUSTIFIED only at the elementary level. You cannot specify the JUSTIFIED clause for numeric, numeric-edited, or alphanumeric-edited items. Also, you cannot specify the JUSTIFIED clause in descriptions of items described with the USAGE IS INDEX clause. The JUSTIFIED clause is not allowed for:  Items described as USAGE IS POINTER or USAGE IS PROCEDURE-POINTER  External or internal floating-point items ───┬──JUSTIFIED──┬─┬─────┬── └──JUST───────┘ └RIGHT┘ ═══ 1.21. OCCURS Clause ═══ Description The OCCURS clause specifies tables whose elements can be referred to by indexing or subscripting. The OCCURS and USAGE IS INDEX clauses are the two Data Division clauses used for table handling. The OCCURS clause cannot be specified in a data description entry that:  Has a level number of 01, 66, 77, or 88  Describes a redefined data item. However, a redefined item can be subordinate to an item containing an OCCURS clause. The OCCURS clause has two formats:  Format 1 (Fixed-length tables)  Format 2 (Variable-length tables) ═══ Format 1 (Fixed-Length Tables) ═══ Description Format 1 of the OCCURS clause specifies fixed-length tables. Format 1 (Fixed-Length Tables) ──OCCURS integer─2─┬───────┬─────────────── └─TIMES─┘ ┌─────────────────────────────────────────────┐  │ ─┬─────────────────────────────────────────────┼───────── │ ┌───────────┐ │ │  │ │ └─┬─ASCENDING──┬──┬────────┬────data─name─2─┴─┘ └─DESCENDING─┘ └─KEY IS─┘ ─┬────────────────────────────────┬────────────────────── │ ┌────────────┐ │ │  │ │ └─INDEXED─┬────┬─index─name─1─┴──┘ └─BY─┘ ═══ ASCENDING/DESCENDING KEY Phrase ═══ With the ASCENDING/DESCENDING KEY phrase, data is arranged in ascending or descending order, depending on the key word specified, according to the values contained in data-name-2. The data-names are listed in their descending order of significance. When you specify the ASCENDING/DESCENDING KEY phrase, the following rules apply:  Keys must be listed in decreasing order of significance.  The total number of keys for a given table element must not exceed 12.  You must arrange the data in the table in ASCENDING or DESCENDING sequence according to the collating sequence in use.  A key may have DISPLAY, BINARY, PACKED-DECIMAL, or COMPUTATIONAL usage.  The sum of the lengths of all the keys associated with one table element must not exceed 255.  A key may have COMPUTATIONAL-1, COMPUTATIONAL-2, COMPUTATIONAL-3, or COMPUTATIONAL-4 usage.  The ASCENDING/DESCENDING KEY phrase (for a SEARCH ALL statement only) can be specified in the OCCURS clause for a DBCS item.  A key that is specified without qualifiers and it is not a unique name will be implicitly qualified with the subject of the OCCURS clause and all qualifiers of the OCCURS clause subject. ═══ index-name-1 ═══ Index-name-1 must follow the rules for the formation of user-defined words. At least 1 character must be alphabetic. Each index-name specifies an index to be created by the compiler for use by the program. These index-names are not data-names, and are not identified elsewhere in the COBOL program. Instead, they can be regarded as private special registers for the use of this object program only. As such, they are not data, or part of any data hierarchy. Each index-name must be unique. In one table entry, up to 12 index-names may be specified. ═══ Format 2 (Variable-Length Tables) ═══ Description The OCCURS DEPENDING ON clause specifies variable-length tables. Format 2 (Variable-Length Tables) ──OCCURS────────┬────────────┬─integer-2──┬───────┬───── └integer-1 TO┘ └─TIMES─┘ ──DEPENDING─┬────┬data─name─1─────────────────────────── └─ON─┘ ┌─────────────────────────────────────────────┐  │ ───┬─────────────────────────────────────────────┼─────── │ ┌───────────┐ │ │  │ │ └─┬─ASCENDING──┬──┬────────┬────data─name─2─┴─┘ └─DESCENDING─┘ └─KEY IS─┘ ───┬────────────────────────────────┬──────────────────── │ ┌────────────┐ │ │  │ │ └─INDEXED─┬────┬─index─name─1─┴──┘ └─BY─┘ ═══ 1.22. PICTURE Clause ═══ Description The PICTURE clause specifies the general characteristics and editing requirements of an elementary item. You must specify a PICTURE clause for every elementary item except an index data item, the subject of the RENAMES clause, USAGE COMP-1, and USAGE COMP-2 items. The PICTURE character string, which may contain a maximum of 30 characters, is made up of certain COBOL characters used as symbols. The allowable combinations determine the category of the elementary data item. Allowable characters include: A, B, E, G, N, P, S, V, X, Z, 9, 0, /, , (comma), . (period), +, -, CR, DB, *, and $. ───┬──PICTURE─┬─────┬────┬──character─string───────────── └──PIC─────┘ └─IS─┘ ═══ 1.23. REDEFINES Clause ═══ Description The REDEFINES clause allows you to use different description entries to describe the same computer storage area. When you specify the REDEFINES clause, it must be the first entry following data-name-1 or FILLER. If you do not specify data-name-1 or FILLER, REDEFINES must be the first entry following the level-number. The level-numbers of data-name-1 and data-name-2 must be identical and must not be level 66 or level 88. ──level-number──┬───────────────┬─REDEFINES data─name─2── ├──data─name─1──┤ └──FILLER───────┘ ═══ 1.24. SIGN Clause ═══ Description The SIGN clause specifies the position and the mode of representation of the operational sign for a numeric entry. You can specify SIGN clause only for a signed numeric data description data entry (that is, one whose PICTURE character-string contains an S) or for a group item that contains at least one such elementary entry. You must specify, explicitly or implicitly, USAGE IS DISPLAY. The SIGN clause is treated as documentation for external floating-point items. For internal floating-point items, the SIGN clause is invalid and will result in an S-level diagnostic message. ──┬──────────────┬─┬─LEADING──┬─┬─────────────────────┬── └─SIGN──┬────┬─┘ └─TRAILING─┘ └SEPARATE─┬─────────┬─┘ └─IS─┘ └CHARACTER┘ ═══ 1.25. SYNCHRONIZED Clause ═══ Description The SYNCHRONIZED clause specifies the alignment of an elementary item on a natural boundary in storage. The SYNCHRONIZED clause may appear at the elementary level or at level-01, in which case every elementary item within this level-01 item is synchronized. ───┬──SYNCHRONIZED──┬──┬─────────┬─────────────────────── └──SYNC──────────┘ ├──LEFT───┤ └──RIGHT──┘ ═══ 1.26. USAGE Clause ═══ Description The USAGE clause specifies the format of a data item in computer storage. You can specify the USAGE clause for a data description entry with a level-number other than 66 or 88. However, if you specify USAGE at the group level, USAGE applies to each elementary item in the group. The usage of an elementary item must not contradict the usage of a group to which the elementary item belongs. The USAGE clause specifies the format in which data is represented in storage. The format may be restricted if certain Procedure Division statements are used. When you do not specify the USAGE clause at either the group or elementary level, it is assumed that usage is DISPLAY. ───┬────────────┬──┬──BINARY───────────┬── └──USAGE─┬──┬┘ ├──COMP─────────────┤ └IS┘ ├──COMP-1───────────┤ ├──COMP-2───────────┤ ├──COMP-3───────────┤ ├──COMP-4───────────┤ ├──COMPUTATIONAL────┤ ├──COMPUTATIONAL-1──┤ ├──COMPUTATIONAL-2──┤ ├──COMPUTATIONAL-3──┤ ├──COMPUTATIONAL-4──┤ ├──DISPLAY──────────┤ ├──DISPLAY-1────────┤ ├──INDEX────────────┤ ├──PACKED-DECIMAL───┤ ├──POINTER──────────┤ └──PROCEDURE-POINTER┘ ═══ 1.27. VALUE Clause ═══ Description The VALUE clause specifies the initial contents of a data item or the value or values associated with a condition-name. The VALUE clause has three formats:  Format 1 (Literal Value Clause)  Format 2 (Condition-Name Value Clause)  Format 3 (NULL Value Clause) ═══ Literal VALUE Clause ═══ Description The Literal VALUE Clause specifies the initial value of a data item. If the item is numeric, all VALUE clause literals must be numeric. All numeric literals in a VALUE clause of an item must have a value that is within the range of values indicated by the PICTURE clause for that item. If the item is an elementary or group alphabetic, alphanumeric, alphanumeric-edited, or numeric-edited item, the VALUE clause literal must be non-numeric. Literal VALUE Clause ───VALUE──┬────┬──literal──────────────────────────────── └─IS─┘ ═══ Condition-Name VALUE Clause (Level-88 Entry) ═══ Description The Condition-Name VALUE Clause associates a single value, multiple values, and/or range(s) of values with a condition-name. Condition-Name VALUE Clause (Level-88 Entry) ───88 condition─name──┬─VALUE──┬────┬───┬───────────────── │ └─IS─┘ │ └─VALUES─┬─────┬──┘ └─ARE─┘ ┌──────────────────────────────────────┐  │ ────literal-1────┬────────────────────────┼──.────────── └┬─THROUGH─┬──literal-2──┘ └─THRU────┘ ═══ NULL Value Clause ═══ Description The Data Description Entry Format 3 (NULL Value Clause) assigns a pointer data item (an item defined as USAGE IS POINTER or USAGE IS PROCEDURE-POINTER) with the initial value of an invalid address. NULL/NULLS also applies to PROCEDURE-POINTER. The value of NULL is zero. You can specify VALUE IS NULL only for elementary items that are described implicitly or explicitly as USAGE IS POINTER or USAGE IS PROCEDURE-POINTER. NULL Value Clause ───VALUE┬──┬─┬──NULL───┬─── └IS┘ └──NULLS──┘ ═══ 1.28. Data Division -- File and Sort Description Entries ═══ Description The File Section defines the structure of data files. The File Section must begin with the header FILE SECTION, followed by a separator period. In a COBOL program, the File Description (FD) Entry (or Sort Description (SD) Entry for sort/merge files) represents the highest level of organization in the File Section. The order in which the optional clauses follow the FD or SD entry is not important. The File Section must contain a level indicator for each input and output file.  For all files except sort/merge, the File Section must contain an FD entry.  For each sort or merge file, the File Section must contain an SD entry. The File Description Entry has three formats:  Format 1 (Sequential Files)  Format 2 (Relative/Indexed Files)  Format 3 (Sort/Merge Files) ═══ Format 1 (Sequential Files) ═══ Description The File Section must contain a level indicator for each input and output file. For all files except sort/merge, the File Section must contain an FD entry. The last clause in the FD entry must be immediately followed by a separator period. Format 1 (Sequential Files) ──FD file-name-1──┬──────────────┬──┬─────────────┬─────────── └┬──┬─EXTERNAL─┘ └─┬──┬─GLOBAL─┘ └IS┘ └IS┘ ──┬──────────────────────────────────────────────────────┬───── └─BLOCK─┬────────┬┬────────────┬─integer-2─┬CHARACTERS─┤ └CONTAINS┘└integer-1 TO┘ └RECORDS────┘ ──┬──────────────────────────────────────────────────────────── 1 └RECORD┬┬────────┬─integer-3─┬──────────┬──────────────────── 2 │└CONTAINS┘ └CHARACTERS┘ ├┬────────┬─integer-4 TO integer-5─┬──────────┬─────── 3 │└CONTAINS┘ └CHARACTERS┘ └┬──┬─VARYING─┬──┬┬────┬┬─────────────────┬─────────── 4 └IS┘ └IN┘└SIZE┘└┬────┬─integer-6─┘ └FROM┘ 1 ──────────────────────────────────────────────────────────┬──── 2 ──────────────────────────────────────────────────────────┤ │ 3 ──────────────────────────────────────────────────────────┤ │ 4 ──┬────────────┬─┬──────────┬──┬────────────────────────┬─┘ └TO integer-7┘ └CHARACTERS┘ └DEPENDING┬──┬data-name-1┘ └ON┘ ──┬────────────────────────────────────────┬─────────────────── └─LABEL─┬RECORD─┬──┬─┬──┬─STANDARD─────┬─┘ │ └IS┘ │ ├─OMITTED──────┤ └RECORDS┬───┬┘ │┌────────────┐│ └ARE┘ │ ││ └─data-name-2─┴┘ ──┬──────────────────────────────────────────────┬───────────── │ ┌─────────────────────────────────┐│ │  ││ └─VALUE OF────system-name-1┬──┬──┬─data-name-3┼┘ └IS┘ └─literal-1──┘ ─┬───────────────────────────────┬┬──────────────────────────── 5 │ ┌──────────┐│└LINAGE┬──┬┬data-name-5┬───── 6 │  ││ └IS┘└integer-8──┘ └DATA┬RECORD─┬──┬─┬─data-name-4┴┘ │ └IS┘ │ └RECORDS┬───┬┘ └ARE┘ 5 ─────────────────────────────────────────────────────────────── 7 6 ──┬─────┬┬──────────────────────────────┬────────────────────── 8 └LINES┘└┬────┬FOOTING┬──┬┬data-name-6┬┘ └WITH┘ └AT┘└integer-9──┘ 7 ──────────────────────────────────────────────────────────────┬ 8 ┬───────────────────────────┬─┬──────────────────────────────┬┘ └┬─────┬┬──┬TOP┬data-name-7┬┘ └┬─────┬┬──┬BOTTOM┬data-name-8┬┘ └LINES┘└AT┘ └integer-10─┘ └LINES┘└AT┘ └integer-11─┘ ─┬───────────────────────┬┬───────────────────────────┬─.────── │ │└CODE-SET┬──┬alphabet-name-1┘ └RECORDING┬────┬┬──┬mode┘ └IS┘ └MODE┘└IS┘ ═══ Format 2 (Relative/Indexed Files) ═══ Description The File Section must contain a level indicator for each input and output file. For all files except sort/merge, the File Section must contain an FD entry. The last clause in the FD entry must be immediately followed by a separator period. Format 2 (Relative/Indexed Files) ──FD file─name-1──┬──────────────┬──┬─────────────┬──────── └┬──┬─EXTERNAL─┘ └─┬──┬─GLOBAL─┘ └IS┘ └IS┘ ──┬──────────────────────────────────────────────────────┬── └─BLOCK─┬────────┬┬────────────┬─integer-2─┬CHARACTERS─┤ └CONTAINS┘└integer-1 TO┘ └RECORDS────┘ ──┬───────────────────────────────────────────────────────── 1 └RECORD┬┬────────┬─integer-3─┬──────────┬───────────────── 2 │└CONTAINS┘ └CHARACTERS┘ ├┬────────┬─integer-4 TO integer-5─┬──────────┬──── 3 │└CONTAINS┘ └CHARACTERS┘ └┬──┬─VARYING─┬──┬┬────┬┬──────────────────┬─────── 4 └IS┘ └IN┘└SIZE┘└┬─────┬─integer-6─┘ └FROM─┘ 1 ──────────────────────────────────────────────────────────┬─ 2 ──────────────────────────────────────────────────────────┤ │ 3 ──────────────────────────────────────────────────────────┤ │ 4 ──┬────────────┬─┬──────────┬──┬────────────────────────┬─┘ └TO integer-7┘ └CHARACTERS┘ └DEPENDING┬──┬data-name-1┘ └ON┘ ──┬─────────────────────────────────────────┬─────────────── └─LABEL─┬─RECORD─┬───┬┬──┬─STANDARD─────┬─┘ │ └IS─┘│ │ │ └─RECORDS┬───┬┘ └─OMITTED──────┘ └ARE┘ ──┬──────────────────────────────────────────────┬────────── │ ┌────────────────────────────────┐ │ │  │ │ └─VALUE OF────system-name-1┬──┬┬─data-name-3─┼─┘ └IS┘└─literal-1───┘ ──┬───────────────────────────────────┬──.────────────────── │ ┌───────────┐ │ │  │ │ └DATA─┬─RECORD─┬───┬┬─data-name-4─┴─┘ │ └IS─┘│ └─RECORDS┬───┬┘ └ARE┘ ═══ Format 3 (Sort/Merge Files) ═══ Description The File Section must contain a level indicator for each input and output file. For each sort or merge file, the File Section must contain an SD entry. You must write an SD entry for each sort or merge file in the program. The last clause in the SD entry must be immediately followed by a separator period. The following example illustrates a File Section entry for a sort or merge file: SD SORT-FILE. 01 SORT-RECORD PICTURE X(80). Format 3 (Sort/Merge Files) ────────SD file-name-1─────────────────────────────────── ──┬─────────────────────────────────────────────────────── 1 └RECORD┬┬────────┬─integer-3─┬──────────┬─────────────── 2 │└CONTAINS┘ └CHARACTERS┘ ├┬────────┬─integer-4 TO integer-5─┬──────────┬── 3 │└CONTAINS┘ └CHARACTERS┘ └┬──┬─VARYING─┬──┬┬────┬┬─────────────────┬────── 4 └IS┘ └IN┘└SIZE┘└┬────┬─integer-6─┘ └FROM┘ 1 ─────────────────────────────────────────────────────────┬ 2 ─────────────────────────────────────────────────────────┤ │ 3 ─────────────────────────────────────────────────────────┤ │ 4 ──┬────────────┬─┬──────────┬──┬────────────────────────┬┘ └TO integer-7┘ └CHARACTERS┘ └DEPENDING┬──┬data-name-1┘ └ON┘ ──┬───────────────────────────────────┬──.──────────────── │ ┌───────────┐ │ │  │ │ └DATA─┬─RECORD─┬───┬┬─data-name-4─┴─┘ │ └IS─┘│ └─RECORDS┬───┬┘ └ARE┘ ═══ 1.29. RECORD Clause ═══ The RECORD Clause has three formats: Format 1 specifies the number of character positions for fixed-length records: ───RECORD┬────────┬integer-3┬──────────┬── └CONTAINS┘ └CHARACTERS┘ Format 2 specifies the number of character positions for either fixed or variable-length records. Fixed-length records are obtained when all 01 record description entry lengths are the same. The Format 2 RECORD CONTAINS clause is never required, because the minimum and maximum record lengths are determined from the record description entries. ───RECORD┬────────┬integer-4 TO integer-5─┬──────────┬ └CONTAINS┘ └CHARACTERS┘ Format 3 specifies variable-length records: ─RECORD┬──┬VARYING┬──┬┬────┬┬───────────────┬┬────────────┬┬──────────┬ └IS┘ └IN┘└SIZE┘└┬────┬integer-6┘└TO integer-7┘└CHARACTERS┘ └FROM┘ ──┬──────────────────────────┬────────────────────────────────────────── └─DEPENDING┬──┬data-name-1─┘ └ON┘ ═══ RECORDING MODE Clause ═══ The RECORDING MODE clause specifies the format of the physical records in a QSAM file. The clause is ignored for a VSAM file. The permitted values for RECORDING MODE are: Recording Mode F (Fixed): All the records in a file are the same length, and each is wholly contained within one block. Recording Mode V (Variable): The records may be either fixed or variable in length, and each must be wholly contained within one block. Recording Mode U (Fixed or Variable): The records may be either fixed or variable in length. Recording Mode S (Spanned): The records may be either fixed or variable in length and may be larger than a block. ═══ 1.30. Procedure Division ═══ Description The Procedure Division is optional in a COBOL source program. The Procedure Division consists of optional declaratives, and procedures that contain sections and/or paragraphs, sentences, and statements. The Procedure Division has two formats:  Procedure Division (Format 1)  Procedure Division (Format 2) Click here for help with individual Procedure Division Statements. ═══ 1.31. Procedure Division (Format 1) ═══ Description The structure of the Procedure Division (Format 1) is as follows: ───PROCEDURE DIVISION─┬───────────────────┬─.───── │ ┌─────────┐ │ │  │ │ └─USING data-name-1─┘ ──┬──────────────────────────────────────────────── 1 │ ┌────────────────────────────┐ │  │ └─DECLARATIVES. sect. USE statement.──para───┴─── 2 1 ───────────────────────────┬───────────────────── │ │ 2 ───────END DECLARATIVES. ──┘ ┌─────────────────┐  │ ─────sect.──────para───┴─────────────────────────── where sect is: ─────sect-name SECTION─┬─────────────────┬─────── └─priority-number─┘ where para is: ─────┬───────────────────────────┬─────────────── │ ┌───────────────────────┐ │ │  │ │ └─para-name. ─┬───────────┼─┘ │ ┌───────┐ │ │  │ │ └─statement─┘ ═══ 1.32. Procedure Division (Format 2) ═══ Description The structure of the Procedure Division (Format 2) is as follows: ┌────────────────────────┐  │ ─PROCEDURE DIVISION─┬─────────────────────┬─. para─name. ─┬────────────┼─ │ ┌───────────┐ │ │ ┌────────┐ │ │  │ │ │  │ │ └─USING data─name─1─┴─┘ └─statement┴─┘ ═══ 1.33. USING Phrase ═══ Description  The USING phrase makes data items defined in a calling program available to a called subprogram. The USING phrase is required only if the object program is to be invoked by a CALL statement and that statement includes a USING phrase.  Each USING identifier in a calling program may be a data item of any level in the Data Division.  An identifier may appear more than once in a Procedure Division USING phrase. The last value passed to it by a CALL USING statement is used.  Data items defined in the Linkage Section of the called program may be referenced within the Procedure Division of that program if, and only if, they satisfy one of the following conditions: - They are operands of the USING phrase of the Procedure Division header or the ENTRY statement. - They are operands of ADDRESS OF or CALL . . . BY REFERENCE ADDRESS OF. - They are defined with a REDEFINES or RENAMES clause, the object of which satisfies the above conditions. - They are items subordinate to any item that satisfies the condition in the rules above. - They are condition-names or index-names associated with data items that satisfy any of the above conditions. The USING phrase is valid with the following:  The Procedure Division header of a called subprogram: The USING phrase is valid in the Procedure Division header of a called subprogram entered at the beginning of the nondeclaratives portion; each USING identifier must be defined as a level-01 or level-77 item in the Linkage Section of the called subprogram. A data item in the USING phrase of the Procedure Division header may have a REDEFINES clause in its data description entry.  The ENTRY statement of a called subprogram: In a called subprogram entered at the first executable statement following and ENTRY statement, the USING option is valid in the ENTRY statement; each USING identifier must be defined as a level-01 or level-77 item in the Linkage Section of the called subprogram.  The CALL statement of a called subprogram: In a calling program, the USING phrase is valid for the CALL statement; each USING identifier must be defined as a level-01, level-77, or an elementary item in the Data Division. The USING phrase is specified in the Procedure Division header if, and only if, this program is a subprogram invoked by a CALL statement that itself contains a USING phrase. That is, for each CALL USING statement in a calling program, a corresponding USING phrase must be specified in a called subprogram. The identifiers specified in a CALL USING statement name data items available to the calling program that may be referred to in the called program; a given identifier may appear more than once. These items are defined in any Data Division section. ═══ 1.34. DECLARATIVES ═══ Description Declaratives provide one or more special-purpose sections that are executed when an exception condition occurs.  Preface the entire group of Declarative Sections with the key word DECLARATIVES. Write it on the line after the Procedure Division header. Specify the end of the group with the key words END DECLARATIVES. The key words DECLARATIVES and END DECLARATIVES must begin in Area A and be followed by a separator period. No other text may appear on the same line..  When you specify Declarative Sections, you must group them at the beginning of the Procedure Division. When Declarative Sections are specified, you need not divide the entire Procedure Division into sections.  Begin each Declarative Section with a USE sentence that identifies the section's function. When an exception condition occurs, the series of procedures that follow the USE sentence specify the actions to be taken. End each Declarative Section with another section-name followed by a USE sentence, or with the key words END DECLARATIVES. ═══ 1.35. Procedure Division Statements ═══ Description A Procedure Division statement is a syntactically valid combination of identifiers and symbols (literals, relational-operators, and so forth) beginning with a COBOL verb. There are four categories of statements:  Imperative: Specifies an unconditional action to be taken by the program, or is a conditional statement terminated by its explicit scope terminator.  Conditional: Specifies that the truth value of a condition is to be determined, and that the subsequent action of the object program is dependent on this truth value.  Delimited scope: Uses an explicit scope terminator to turn a conditional statement into an imperative statement; the resulting imperative statement can then be nested. Explicit scope terminators may also be used, however, to terminate the scope of an imperative statement.  Compiler-directing: Directs the compiler to take specific actions during compilation of the program. COBOL statements can also be categorized according to the type of operations they perform:  Arithmetic statements perform computations.  Data manipulation statements move and inspect data.  Input/output statements transfer data to and from files stored on external media, and control low-volume data that is obtained from or sent to an input/output device.  Procedure-branching statements allow statements, sentences, and paragraphs in the Procedure Division to be executed non-sequentially. For help with individual Procedure Division statements, select from the following list. ACCEPT INSPECT ADD MERGE ALTER MOVE CALL MULTIPLY CANCEL OPEN CLOSE PERFORM COMPUTE READ CONTINUE RELEASE DELETE RETURN DISPLAY REWRITE DIVIDE SEARCH ENTER SET ENTRY SORT EVALUATE START EXIT STOP EXIT PROGRAM STRING GOBACK SUBTRACT GO TO UNSTRING IF WRITE INITIALIZE ═══ 1.36. ACCEPT Statement ═══ Description The ACCEPT statement transfers data into the specified identifier. There is no editing or error checking of the incoming data. The ACCEPT statement has two formats:  Format 1 (Data Transfer)  Format 2 (System Information Transfer) ═══ Format 1 (Data Transfer) ═══ Description Format 1 of the ACCEPT statement transfers data from an input/output device into the specified identifier. When you omit the FROM phrase, the system input device is assumed. Format 1 is useful for exceptional situations when operator intervention (to supply a given message, code, or exception indicator) is required. The operator must have the appropriate messages with which to reply. Format 1 (Data Transfer Format) ──ACCEPT identifier ──┬──────────────────────────────┬─────────────── └─FROM─┬──mnemonic─name─────┬──┘ └──environment─name──┘ ═══ 1.37. Format 2 (System Information Transfer) ═══ Description Format 2 of the ACCEPT statement transfers system information contained in the specified conceptual data items DATE, DAY, DAY-OF-WEEK, or TIME into the identifier. The transfer must follow the rules for the MOVE statement without the CORRESPONDING phrase. Format 2 is useful for transferring system information into the identifier. Follow the rules for the MOVE statement without the CORRESPONDING phrase when making the transfer. Format 2 (System Information Transfer Format) ──ACCEPT identifier FROM──┬──DATE─────────┬─── ├──DAY──────────┤ ├──DAY─OF─WEEK──┤ └──TIME─────────┘ ═══ 1.38. ADD Statement ═══ Description The ADD statement sums two or more numeric operands and stores the results.  Format 1 (ADD)  Format 2 (ADD with GIVING)  Format 3 (ADD with CORRESPONDING) ═══ Format 1 (ADD) ═══ Description In Format 1, all identifiers or literals preceding the word TO are added together; the resulting sum is added to and stored in identifier-2. This process is repeated for each successive occurrence of identifier-2, in the left-to-right order in which identifier-2 is specified. Format 1 (ADD) ┌────────────────┐ ┌─────────────────────────┐  │  │ ───ADD──┬──identifier─1──┼──TO──identifier─2──┬───────────┼────────── └──literal─1─────┘ └──ROUNDED──┘ ────┬──────────────────────────────────────────────┬────────────────── └──┬────┬───SIZE ERROR imperative─statement─1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬────────────── └─NOT───┬────┬───SIZE ERROR imperative─statement─2──┘ └─ON─┘  ──┬─────────┬──────────────────────────────────────────────────────── └─END─ADD─┘ ═══ Format 2 (ADD with GIVING) ═══ Description In Format 2, the values of the operands preceding the word GIVING are added together, and the sum is stored as the new value of each data item referenced by identifier-3. Format 2 (ADD with GIVING) ┌────────────────┐  │ ───ADD──┬──identifier─1──┼────┬────┬─────┬──identifier─2──┬────────── └──literal─1─────┘ └─TO─┘ └──literal─2─────┘ ┌───────────────────────────┐  │ ──GIVING───identifier─3──┬───────────┼──────────────────────────────── └──ROUNDED──┘ ────┬──────────────────────────────────────────────┬────────────────── └──┬────┬───SIZE ERROR imperative─statement─1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬────────────── └─NOT───┬────┬───SIZE ERROR imperative─statement─2──┘ └─ON─┘  ──┬─────────┬──────────────────────────────────────────────────────── └─END─ADD─┘ ═══ Format 3 (ADD with CORRESPONDING) ═══ Description In Format 3, elementary data items within identifier-1 are added to and stored in the corresponding elementary items within identifier-2. Format 3 (ADD with CORRESPONDING) ───ADD──┬─CORRESPONDING─┬─identifier─1 TO identifier─2──┬─────────┬── └─CORR──────────┘ └─ROUNDED─┘ ────┬──────────────────────────────────────────────┬────────────────── └──┬────┬───SIZE ERROR imperative─statement─1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬────────────── └─NOT───┬────┬───SIZE ERROR imperative─statement─2──┘ └─ON─┘  ──┬─────────┬──────────────────────────────────────────────────────── └─END-ADD─┘ ═══ 1.39. ALTER Statement ═══ Description The ALTER statement changes the transfer point specified in a GO TO statement. Note: The ALTER statement is an obsolete language element and encourages the use of unstructured programming practices. It is to be deleted from the next revision of the COBOL 85 Standard. The EVALUATE statement provides the same function as the ALTER statement and helps ensure that your program will be well structured. Format ┌──────────────────────────────────────────────────────┐  │ ───ALTER procedure─name─1 TO──┬──────────────┬──procedure─name─2┴── └──PROCEED TO──┘ ═══ 1.40. CALL Statement ═══ Description The CALL statement transfers control from one object program to another within the run unit. The program containing the CALL statement is the calling program; the program identified in the CALL statement is the called subprogram. Called programs may contain CALL statements; however, a called program must not execute a CALL statement that directly or indirectly calls the calling program. You can use the CALL statement to take advantage of Language Environment/370 Callable Services. For more information, see the COBOL/370 Programming Guide or the CEL User's Guide.  Format 1 (CALL)  Format 2 (CALL ON EXCEPTION) ═══ Format 1 (CALL) ═══ Description The program containing the CALL statement is the calling program; the program identified in the CALL statement is the called subprogram. Format 1 (CALL) ──CALL──┬──identifier-1──┬─────────────────────────────────────── └──literal-1─────┘ ──┬─────────────────────────────────────────────────────────────┬─ │ ┌───────────────────────────────────────────────────┐│ │ │ ┌────────────────────────────┐││ │   │││ └─USING──┬─┬───────────────────┬─┬─────────────┬identifier-2┼┼┘ │ └─┬────┬─REFERENCE──┘ ├─ADDRESS OF──┘ ││ │ └─BY─┘ └─file-name-1──────────────┘│ │ │ │ ┌──────────────────────────────────┐│ │  ││ └┬────┬─CONTENT─┬──┬──────────┬────────identifier-2┼┘ └─BY─┘ │ ├ADDRESS OF┤ │ │ └LENGTH OF─┘ │ └────literal-2─────────────────────┘ ──┬──────────────────────────────────────┬──────────────────────── └─┬──┬OVERFLOW imperative-statement-1──┘ └ON┘ ──┬────────────┬───────────────────────────────────────────────── └──END─CALL──┘ ═══ Format 2 (CALL ON EXCEPTION) ═══ Description The program containing the CALL statement is the calling program; the program identified in the CALL statement is the called subprogram. Format 2 (CALL ON EXCEPTION) ──CALL──┬──identifier-1──┬─────────────────────────────────────── └──literal-1─────┘ ──┬─────────────────────────────────────────────────────────────┬─ │ ┌───────────────────────────────────────────────────┐│ │ │ ┌───────────────────────────┐ ││ │   │ ││ └─USING──┬─┬──────────────────┬┬─────────────┬─identifier-2┼─┼┘ │ └─┬────┬─REFERENCE─┘├─ADDRESS OF──┘ │ │ │ └─BY─┘ └─file-name-1───────────────┘ │ │ │ │ ┌─────────────────────────────────┐│ │  ││ └─┬────┬─CONTENT─┬─┬────────────┬─────identifier-2─┼┘ └─BY─┘ │ ├─ADDRESS OF─┤ │ │ └─LENGTH OF──┘ │ └───literal-2─────────────────────┘ ──┬───────────────────────────────────────┬────────────────────── └─┬──┬EXCEPTION imperative-statement-1──┘ └ON┘ ──┬───────────────────────────────────────────┬────────────────── └──NOT┬──┬EXCEPTION imperative-statement-2──┘ └ON┘ ──┬────────────┬───────────────────────────────────────────────── └──END─CALL──┘ ═══ 1.41. CANCEL Statement ═══ Description The CANCEL statement ensures that the next time the referenced subprogram is called, it will be entered in its initial state. No action is taken when you use a CANCEL statement to cancel the following types of programs:  A program that has not been dynamically called in this run unit by another COBOL/370, VS COBOL II, or OS/VS COBOL program, or  A program that has been called and subsequently canceled. ┌────────────────┐ │ │  │ ────CANCEL──┬──identifier─1──┼────────────────────────────────────── └──literal─1─────┘ ═══ 1.42. CLOSE Statement ═══ Description The CLOSE statement terminates the processing of volumes and files, with optional rewind and/or lock or removal, where applicable. With file lock, the compiler ensures that this file cannot be opened again during execution of the object program.  Format 1 (Sequential Files)  Format 2 (Indexed and Relative Files) ═══ Format 1 (Sequential Files Format) ═══ Description The CLOSE statement terminates the processing of volumes and files, with optional rewind and/or lock or removal, where applicable. With file lock, the compiler ensures that this file cannot be opened again during execution of the object program. Format 1 (Sequential Files) ┌──────────────────────────────────────────────────────┐  │ ──CLOSE file-name-1─┬──────────────────────────────────────────┼──── └┬─┬─REEL─┬────┬────────────────────┬──┬───┘ │ └─UNIT─┘ ├─────┬──REMOVAL─────┘ │ │ └─FOR─┘ │ └─┬──────┬─────┬─NO REWIND─┬──────────┘ └─WITH─┘ └─LOCK──────┘ ═══ Format 2 (Indexed and Relative Files) ═══ Description The CLOSE statement terminates the processing of volumes and files, with optional rewind and/or lock or removal, where applicable. You may execute it only for a file in an open mode. Format 2 (Indexed and Relative Files Format) ┌─────────────────────────────────┐  │ ──CLOSE file─name─1─┬─────────────────────┼──────────────────────── └────┬──────┬───LOCK──┘ └─WITH─┘ ═══ 1.43. COMPUTE Statement ═══ Description The COMPUTE statement assigns the value of an arithmetic expression to one or more data items. It allows you to combine arithmetic operations without the restrictions on receiving data items that the rules for the ADD, SUBTRACT, MULTIPLY, and DIVIDE statements impose. When you need to combine arithmetic operations, using the COMPUTE statement may be more efficient than writing a series of separate arithmetic statements. ┌────────────────────────┐  │ ───COMPUTE identifier─1──┬──────────┬────────────────── └─ROUNDED──┘ ──┬ = ────┬─arithmetic─expression────────────────────── └─EQUAL─┘ ───┬────────────────────────────────────────┬─────────── └─┬──┬SIZE ERROR imperative─statement─1──┘ └ON┘ ───┬────────────────────────────────────────────┬─────── └──NOT┬──┬SIZE ERROR imperative─statement─2──┘ └ON┘ ───┬───────────────┬─────────────────────────────────── └──END-COMPUTE──┘ ═══ arithmetic-expression ═══ When the COMPUTE statement is executed, the value of arithmetic-expression is calculated, and this value is stored as the new value of each data item referenced by identifier-1. An arithmetic-expression consisting of a single identifier, literal, or numeric function allows you to set the value of the data item(s) referenced by identifier-1 equal to the value of that identifier, literal, or numeric function. Click here for a description of arithmetic expressions. ═══ 1.44. CONTINUE Statement ═══ Description The CONTINUE statement allows you to specify a no operation statement. CONTINUE indicates that no executable instruction is present. You can use the CONTINUE statement anywhere a conditional statement or an imperative statement may be used. It has no effect on the execution of the program. ──────CONTINUE──────────────────────────────────────────── ═══ 1.45. DELETE Statement ═══ Description The DELETE statement removes a record from an indexed or relative file. For indexed files, you may reuse the key for record addition. For relative files, the space is then available for a new record with the same RELATIVE KEY value. When the DELETE statement is executed, the associated file must be open in I-O mode. ───DELETE file─name────┬────────┬──────────────────────── └─RECORD─┘ ───┬─────────────────────────────────────────────────┬──── └─INVALID───┬─────┬───imperative─statement─1──────┘ └─KEY─┘ ───┬─────────────────────────────────────────────────┬──── └─NOT INVALID───┬─────┬───imperative─statement─2──┘ └─KEY─┘ ──┬─────────────┬──────────────────────────────────────── └─END─DELETE──┘ ═══ 1.46. INVALID KEY/NOT INVALID KEY ═══ For files in sequential access mode, the INVALID KEY and NOT INVALID KEY phrases must not be specified. For files in random or dynamic access mode, the DELETE statement execution results depend on the file organization: indexed or relative. The DELETE statement removes the record identified by the contents of the prime RECORD KEY data item (for VSAM indexed files), or the RELATIVE KEY data item (for VSAM relative files). If the file does not contain such a record, an INVALID KEY condition exists. For files in random or dynamic access mode, both the INVALID KEY phrase and the EXCEPTION/ERROR procedure may be omitted. Click here for further information about the INVALID KEY condition. ═══ 1.47. DISPLAY Statement ═══ Description The DISPLAY statement transfers the contents of each operand to the output device. The contents are displayed on the output device in the order from left to right in which the operands are listed. The size of the sending field is the total character count of all operands listed. Format ┌──────────────┐  │ ──DISPLAY──┬─identifier─1─┼─┬──────────────────────────┬─ └─literal─1────┘ └─UPON─┬─mnemonic─name────┬┘ └─environment─name─┘ ───┬───────────────────┬─── └┬────┬NO ADVANCING─┘ └WITH┘ ═══ identifier-1 ═══ If identifier-1 is numeric and is not described as an external decimal, the identifier is converted automatically to external format as follows:  Binary or internal decimal are converted to external decimal. Negative signed values cause a low-order sign overpunch.  Internal floating-point numbers are converted to external floating-point numbers for display such that: - A COMP-1 item will display as if it had an external floating-point PICTURE clause of -.9(8)E-99 - A COMP-2 item will display as if it had an external floating-point PICTURE clause of -.9(17)E-99. No other identifiers require conversion. POINTER data items are converted to an external decimal number that would have a picture clause of PIC 9(10). PROCEDURE-POINTER data items may not be specified in a DISPLAY statement. INDEX names or data items may not be specified in a DISPLAY statement. DBCS data items are transferred to the sending field of the output device. For proper results, the output device must be able to recognize DBCS shift-out and shift-in control characters. You can specify both DBCS and non-DBCS operands in a single DISPLAY statement. ═══ WITH NO ADVANCING ═══ When you specify WITH NO ADVANCING, the positioning of the output device will not be changed following the display of the last operand. If the output device is capable of positioning to a specific character position, it will remain positioned at the character position immediately following the last character of the last operand displayed. If the output device is not capable of positioning to a specific character position, only the vertical position, if applicable, is affected. This may cause overprinting. If you do not specify WITH NO ADVANCING, then after the last operand has been transferred to the output device, the positioning of the output device will be reset to the leftmost position of the next line of the device. ═══ 1.48. DIVIDE Statement ═══ Description The DIVIDE statement divides one numeric data item into/by other(s) and sets the values of data items equal to the quotient and remainder.  Format 1 (DIVIDE)  Format 2 (DIVIDE GIVING)  Format 3 (DIVIDE GIVING with REMAINDER) ═══ Format 1 (DIVIDE) ═══ Description In Format 1 of the DIVIDE statement, the value of identifier-1 or literal-2 is divided into the value identifier-2, and the quotient is then placed in identifier-2. This process is repeated for each successive occurrence of identifier-2. Format 1 (DIVIDE) ┌──────────────────────┐  │ ──DIVIDE─┬──identifier─1──┬─INTO identifier─2─┬─────────┼ └──literal─1─────┘ └─ROUNDED─┘ ────┬──────────────────────────────────────────────┬────── └──┬────┬───SIZE ERROR imperative─statement─1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬── └─NOT───┬────┬───SIZE ERROR imperative─statement─2──┘ └─ON─┘ ──┬────────────┬───────────────────────────────────────── └─END─DIVIDE─┘ ═══ Format 2 (DIVIDE GIVING) ═══ Description In Format 2, the value of identifier-1 or literal-1 is divided into/by the value of identifier-2 or literal-2. The value of the quotient is stored in each data item referenced in the GIVING phrase by identifier-3. Format 2 (DIVIDE GIVING) ──DIVIDE──┬──identifier─1──┬──┬──INTO──┬─┬─identifier─2─┬ └──literal─1─────┘ └──BY────┘ └─literal─2────┘ ┌─────────────────────────┐  │ ──GIVING identifier─3──┬───────────┼────────────────────── └──ROUNDED──┘ ────┬──────────────────────────────────────────────┬────── └──┬────┬───SIZE ERROR imperative─statement─1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬── └─NOT───┬────┬───SIZE ERROR imperative─statement─2──┘ └─ON─┘ ──┬────────────┬───────────────────────────────────────── └─END─DIVIDE─┘ ═══ Format 3 (DIVIDE GIVING with REMAINDER) ═══ Description In Format 3, the value of identifier-1 or literal-1 is divided into/by identifier-2 or literal-2. The value of the quotient is stored in identifier-3, and the value of the remainder is stored in identifier-4. Format 3 (DIVIDE GIVING with REMAINDER) ──DIVIDE──┬──identifier─1──┬──┬──INTO──┬─┬─identifier─2─┬ └──literal─1─────┘ └──BY────┘ └─literal─2────┘ ──GIVING identifier─3──┬───────────┬────────────────────── └──ROUNDED──┘ ──REMAINDER identifier─4────────────────────────────────── ────┬──────────────────────────────────────────────┬────── └──┬────┬───SIZE ERROR imperative─statement─1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬── └─NOT───┬────┬───SIZE ERROR imperative─statement─2──┘ └─ON─┘ ──┬────────────┬───────────────────────────────────────── └─END─DIVIDE─┘ ═══ 1.49. ENTER Statement ═══ Description The ENTER statement is obsolete and will be deleted from the next revision of the ANSI Standard. It is syntax-checked during compilation, but has no effect on the execution of the program. ENTER allows for the use of more than one source language in the same source program. The COBOL/370 compiler allows only COBOL in the source program. ──ENTER language─name────┬────────────────┬────── . ───── └──routine─name──┘ ═══ 1.50. ENTRY Statement ═══ Description The ENTRY statement establishes an alternate entry point into a COBOL called subprogram. Execution of the called program begins at the first executable statement following the ENTRY whose literal corresponds to the CALL statement literal or identifier. When a CALL statement naming the alternate entry point is executed in a calling program, control is transferred to the next executable statement following the ENTRY statement. ───ENTRY literal──┬──────────────────────┬─── │ ┌──────────┐ │ │  │ │ └──USING──data-name-1──┘ ═══ literal ═══ Literal must be nonnumeric and must follow the rules for formation of a program-name. It must not match the program-id or any other ENTRY literal in this program. ═══ 1.51. EVALUATE Statement ═══ Description The EVALUATE statement provides a shorthand notation for a series of nested IF statements. It can evaluate multiple conditions. That is, the IF statement can be made up of compound conditions. The subsequent action of the object program depends on the results of these evaluations. ──EVALUATE─┬──identifier─1──┬─┬─────────────────────────┬── ├──literal─1─────┤ │ ┌────────────────────┐ │ ├──expression─1──┤ │  │ │ ├──TRUE──────────┤ └─ALSO─┬──identifier─2──┼─┘ └──FALSE─────────┘ ├──literal─2─────┤ ├──expression─2──┤ ├──TRUE──────────┤ └──FALSE─────────┘ ┌───────────────────────────────────────────────────┐ ├────────────────────────────┐ │  │ │ ──WHEN phrase─1─┬──────────────┼─imperative─statement─1───── │ ┌───────────┐│ │  ││ └ALSO phrase─2┴┘ ──┬───────────────────────────────────┬─┬──────────────┬─── └─WHEN OTHER imperative─statement─2─┘ └─END-EVALUATE─┘ where phrase─1 is: ─┬─ANY──────────────────────────────────────────────────┬── ├─condition─1──────────────────────────────────────────┤ ├─TRUE─────────────────────────────────────────────────┤ ├─FALSE────────────────────────────────────────────────┤ └─┬───┬─┬─identifier─3─┬─┬────────────────────────────┬┘ └NOT┘ ├─literal─3────┤ └┬─THROUGH─┬─┬─identifier─4─┬┘ └─arith─exp─1──┘ └─THRU────┘ ├─literal─4────┤ └─arith─exp─2──┘ where phrase-2 is: ─┬─ANY──────────────────────────────────────────────────┬── ├─condition─2──────────────────────────────────────────┤ ├─TRUE─────────────────────────────────────────────────┤ ├─FALSE────────────────────────────────────────────────┤ └─┬───┬─┬─identifier─5─┬─┬────────────────────────────┬┘ └NOT┘ ├─literal─5────┤ └┬─THROUGH─┬─┬─identifier─6─┬┘ └─arith─exp─3──┘ └─THRU────┘ ├─literal─6────┤ └─arith─exp─4──┘ ═══ arithmetic-expression ═══ Any selection subject in which expression-1, expression-2, ... is specified as an arithmetic expression, and any selection object without the NOT or THRU phrase in which arithmetic-expression-1 and/or arithmetic-expression-3 is specified, are assigned numeric values according to the rules for evaluating an arithmetic expression. Click here for a description of arithmetic expressions. ═══ 1.52. EXIT Statement ═══ Description The EXIT statement provides a common end point for a series of paragraphs. It assigns a name to a given point in a program, and has no other effect on the compilation or execution of the program. The EXIT statement must be preceded by a paragraph-name and must appear in a sentence by itself. This sentence does not need to be the only sentence in the paragraph. ───paragraph─name. EXIT. ──────────────────────────────── ═══ 1.53. EXIT PROGRAM Statement ═══ Description The EXIT PROGRAM statement specifies the end of a called program and returns control to the calling program. Do not use EXIT PROGRAM in a declarative procedure where you have specified the GLOBAL phrase. The EXIT PROGRAM statement need not be the last statement in the sequence of imperative statements, but the statements following the EXIT PROGRAM will not be performed if a CALL statement is active. ────EXIT PROGRAM. ─────────────────────────────────────── ═══ 1.54. GOBACK STATEMENT ═══ Description The GOBACK statement specifies the logical end of a called program. It functions like the EXIT PROGRAM statement when coded as a part of a called program, and like the STOP RUN statement when coded in a main program. In a sentence, the GOBACK statement should appear as the only statement or as the last statement in a series of imperative statements, because any statements following GOBACK are not executed. ───GOBACK──────────────────────────────────────────────── ═══ 1.55. GO TO Statement ═══ Description The GO TO statement transfers control from one part of the Procedure Division to another. GO TO has four formats:  Format 1 (Unconditional GO TO)  Format 2 (Conditional GO TO)  Format 3 (Altered GO TO)  Format 4 (MORE-LABELS GO TO) ═══ 1.56. Unconditional GO TO ═══ Description The unconditional GO TO statement transfers control to the first statement in the paragraph or section named in procedure-name, unless GO TO has been modified by an ALTER statement. Although unconditional GO TO need not be the last statement in a series of imperative statements, statements following the GO TO are not executed. Unconditional GO TO ──GO───┬────┬────procedure─name────────────────────────── └─TO─┘ ═══ 1.57. Conditional GO TO ═══ Description The conditional GO TO statement transfers control to one of a series of procedures, depending on the value of the identifier. Conditional GO TO ┌───────────────┐  │ ───GO─┬──┬──procedure─name─1┴─DEPENDING──┬──┬─identifier─ └TO┘ └ON┘ ═══ identifier ═══ Identifier must be a numeric elementary data item which is an integer.  If 1, control is transferred to the first statement in the procedure named by the first occurrence of procedure-name-1;  If 2, control is transferred to the first statement in the procedure named by the second occurrence of procedure-name-1, and so forth.  If the value of identifier is anything other than a value within the range of 1 through n, (where n is the number of procedure-names specified in this GO TO statement), no control transfer occurs. Instead, control passes to the next statement in the normal sequence of execution. ═══ 1.58. Altered GO TO ═══ Description The Altered GO TO statement transfers control to the first statement of the paragraph named in the ALTER statement. An ALTER statement referring to the paragraph containing this GO TO statement must have been performed before this GO TO is performed. The Altered GO TO statement must be contained in a paragraph that consists only of the paragraph-name followed by an unconditional or altered GO TO statement. If an ALTER statement referring to the paragraph containing this GO TO statement has not been executed before this GO TO statement is executed, this GO TO statement acts like a CONTINUE statement. Altered GO TO ──GO───┬────┬───.──────────────────────────────────────── └─TO─┘ ═══ 1.59. MORE-LABELS GO TO ═══ Description The GO TO MORE-LABELS statement can only be specified in a LABEL declarative. For more information, see the COBOL/370 Programming Guide. MORE-LABELS GO TO ──GO───┬────┬───MORE-LABELS.───────────────────────────── └─TO─┘ ═══ 1.60. IF Statement ═══ Description The IF statement evaluates a condition and provides for alternative actions in the object program, depending on the evaluation. ──IF─condition──┬───────┬────────────────────────────────────────── └─THEN──┘ ┌────────────┐  │ ─────┬───statement-1─┴─┬─────────────────────────────────────────── └──NEXT SENTENCE──┘ ─────┬────────────────────────────┬───────────────┬────────┬─────── │ ┌────────────┐ │ └─END-IF─┘ │  │ │ └─ELSE─┬─statement-2─┴──┬────┘ └─NEXT SENTENCE──┘ ═══ 1.61. INITIALIZE Statement ═══ Description The INITIALIZE statement sets selected categories of data fields to predetermined values; it is functionally equivalent to one or more MOVE statements. ┌────────────┐  │ ─INITIALIZE───identifier-1─────────────────────────────────── ─┬──────────────────────────────────────────────────────────┬─ │ ┌───────────────────────────────────────────┐│ │  ││ └──REPLACING──┬─ALPHABETIC─────────┬┬────┬BY┬─identifier-2┼┘ ├─ALPHANUMERIC───────┤└DATA┘ └─literal-1───┘ ├─NUMERIC────────────┤ ├─ALPHANUMERIC-EDITED┤ ├─NUMERIC-EDITED─────┤ ├─DBCS───────────────┤ └─EGCS───────────────┘ ═══ identifier-1 ═══ Identifier-1 is the receiving area. You can specify a subscripted item for identifier-1. You can initialize a complete table only by specifying identifier-1 as a group that contains the complete table. The description for the data item referenced by identifier-1 or any items subordinate to identifier-1 may not contain the DEPENDING phrase of the OCCURS clause. A floating-point data item or literal may be used anywhere a numeric identifier or literal is specified. The data description entry for identifier-1 must not contain a RENAMES clause. An index data item may not be an operand of INITIALIZE. You can use a DBCS data item or literal anywhere an identifier or literal is specified. DBCS items refer to double byte character data. You can specify special registers for identifier-1 only if they are valid receiving fields for the implied MOVE statements. ═══ REPLACING phrase ═══ When you use the REPLACING phrase:  Make the category of identifier-2 or literal-1 compatible with the category indicated in the corresponding REPLACING phrase, according to the rules for MOVE. A floating-point data item or floating-point literal will be treated as if it is in the NUMERIC category.  Do not repeat the same category in a REPLACING phrase. When you do not use the REPLACING phrase:  SPACE is the implied sending field for alphabetic, alphanumeric, alphanumeric-edited, and DBCS items.  ZERO is the implied sending field for numeric and numeric-edited items. ═══ 1.62. INSPECT Statement ═══ Description The INSPECT statement specifies that characters or groups of characters in a data item are to be counted (tallied), replaced, or both. The INSPECT statement will:  Count the occurrence of a specific character (alphabetic, numeric, or special character) in a data item.  Fill all or portions of a data item with specified characters, such as spaces or zeros.  Convert all occurrences of specific characters in a data item to user-supplied replacement characters. The INSPECT statement has four formats:  Format 1 (INSPECT/TALLYING)  Format 2 (INSPECT/REPLACING)  Format 3 (INSPECT/TALLYING/REPLACING)  Format 4 (INSPECT/CONVERTING) Note: If any identifiers or literals in the INSPECT statement are DBCS items, then all of them must be DBCS items, except for the count field (identifier-2), which cannot be a DBCS item. If the identifiers and literals other than identifier-2 are DBCS items, then DBCS characters, not bytes of data, are tallied in identifier-2. ═══ Format 1 (INSPECT/TALLYING) ═══ Format 1 (INSPECT/TALLYING) ─INSPECT identifier─1 TALLYING ────────────────────────── ┌─────────────────────────────────────────────────────┐ │ ┌────────────────────────────────────┤ │ │ ┌──────────┐ │    │ │ ─identifier─2 FOR─┬─CHARACTERS─┬──────────┼────────────┼── │ └─phrase─1─┘ │ │ │ │ ┌────────────────────────┐│ │ │ ┌────────┤│ │   ││ ├─ALL─────┬┬─identifier─3─┬┬────────┼┘ └─LEADING─┘└─literal─1────┘└phrase─1┘ where phrase─1 is: ─┬─BEFORE─┬───┬─────────┬───┬─identifier─4─┬───── └─AFTER──┘ └─INITIAL─┘ └─literal─2────┘ ═══ Format 2 (INSPECT/REPLACING) ═══ Format 2 (INSPECT/REPLACING) ─INSPECT identifier─1 REPLACING─────────────────────────── ┌──────────────────────────────────────────────────────┐ │ ┌──────────┐ │   │ │ ─┬─CHARACTERS BY─┬─identifier─5─┬─┬──────────┼──────────┼─ │ └─literal─3────┘ └─phrase─1─┘ │ │ │ │ ┌──────────────────────────────────────────┐│ │ │ ┌────────┤│ │   ││ ├─ALL─────┬┬─identifier─3─┬BY┬─identifier─5─┬┬────────┼┘ ├─LEADING─┤└─literal─1────┘ └─literal─3────┘└phrase─1┘ └─FIRST───┘ where phrase─1 is: ─┬─BEFORE─┬───┬─────────┬───┬─identifier─4─┬────── └─AFTER──┘ └─INITIAL─┘ └─literal─2────┘ ═══ Format 3 (INSPECT/TALLYING/REPLACING) ═══ Format 3 (INSPECT/TALLYING/REPLACING) ─INSPECT identifier─1 TALLYING ─────────────────────────── ┌─────────────────────────────────────────────────────┐ │ ┌────────────────────────────────────┤ │ │ ┌──────────┐ │    │ │ ─identifier─2 FOR─┬─CHARACTERS─┬──────────┼────────────┼─── │ └─phrase─1─┘ │ │ │ │ ┌────────────────────────┐│ │ │ ┌────────┤│ │   ││ ├─ALL─────┬┬─identifier─3─┬┬────────┼┘ └─LEADING─┘└─literal─1────┘└phrase─1┘ ─────REPLACING───────────────────────────────────────────── ┌──────────────────────────────────────────────────────┐ │ ┌──────────┐ │   │ │ ─┬─CHARACTERS BY─┬─identifier─5─┬─┬──────────┼──────────┼─ │ └─literal─3────┘ └─phrase─1─┘ │ │ │ │ ┌──────────────────────────────────────────┐│ │ │ ┌────────┤│ │   ││ ├─ALL─────┬┬─identifier─3─┬BY┬─identifier─5─┬┬────────┼┘ ├─LEADING─┤└─literal─1────┘ └─literal─3────┘└phrase─1┘ └─FIRST───┘ where phrase─1 is: ─┬─BEFORE─┬───┬─────────┬───┬─identifier─4─┬──── └─AFTER──┘ └─INITIAL─┘ └─literal─2────┘ ═══ Format 4 (INSPECT/CONVERTING) ═══ Format 4 (INSPECT/CONVERTING) ─INSPECT identifier─1 CONVERTING─┬identifier─6─┬────── └─literal─4───┘ ┌──────────┐  │ ────TO────┬─identifier─7─┬─┬──────────┼──────────────── └─literal─5────┘ └─phrase─1─┘ where phrase─1 is: ─┬─BEFORE─┬───┬─────────┬───┬─identifier-4─┬──── └─AFTER──┘ └─INITIAL─┘ └─literal-2────┘ ═══ BEFORE and AFTER Phrases (All Formats) ═══ You cannot specify more than one BEFORE phrase and one AFTER phrase for any one ALL, LEADING, CHARACTERS, FIRST, or CONVERTING phrase. If you specify more than one BEFORE or AFTER phrases, the rules for counting and replacing are modified. When you specify the BEFORE phrase, counting and/or replacing of the inspected item begins at the leftmost character and continues until the first occurrence of the delimiter is reached. If no delimiter is present in the inspected item, counting and/or replacing continues toward the rightmost character. When you specify the AFTER phrase, counting and/or replacing of the inspected item begins with the first character to the immediate right of the delimiter and continues toward the rightmost character in the inspected item. If no delimiter is present in the inspected item, no counting or replacement takes place. ═══ CONVERTING Phrase (Format 4) ═══ A string of replacement values may be expressed by the CONVERTING phrase. The size of the receiving location (identifier-7 or literal-5) must be the same size as the sending location (identifier-6 or literal-4). When a figurative constant is used as literal-5, the size of the figurative constant is equal to the size of literal-4 or identifier-6. The same character must not appear more than once, either in literal-4 or identifier-6. A Format 4 INSPECT statement is interpreted and executed as if a Format 2 INSPECT statement had been written with a series of ALL phrases (one for each character of literal-4), specifying the same identifier-1. The effect is as if each single character of literal-4 were referenced as literal-1, and the corresponding single character of literal-5 referenced as literal-3. Correspondence between the characters of literal-4 and the characters of literal-5 is by ordinal position within the data item. If identifier-4, identifier-6, or identifier-7 occupies the same storage area as identifier-1, the result of the execution of this statement is undefined, even if they are defined by the same data description entry. ═══ 1.63. MERGE Statement ═══ Description The MERGE statement combines two or more identically sequenced files (files that have already been sorted according to an identical set of ascending/descending keys) on one or more keys and makes records available, in merged order, to an output file. MERGE may appear anywhere in the Procedure Division except in a Declarative Section or the Output Procedure Phrase. ─MERGE file─name─1────────────────────────────────────── ┌────────────────────────────────────────────────┐ │ ┌───────────┐ │   │ │ ───┬────┬──┬─ASCENDING──┬───┬─────┬───data─name─1─┴─┴──── └─ON─┘ └─DESCENDING─┘ └─KEY─┘ ──┬────────────────────────────────────────────────┬───── └┬─────────┬──SEQUENCE──┬────┬───alphabet─name─1─┘ └COLLATING┘ └─IS─┘ ┌───────────┐  │ ─USING file─name─2 file─name─3─┴───────────────────────── ──┬─OUTPUT PROCEDURE─────┬────┬─proc─name─1──────────────1 │ ┌───────────┐ └─IS─┘ │  │ └─GIVING file─name─4─┴─────────────────────────────────2 1─┬──────────────────────────┬─┬───────────────────────── └─┬─THROUGH─┬─proc─name─2──┘ │ └─THRU────┘ │ 2──────────────────────────────┘ ═══ data-name-1 ═══ Data-name-1 specifies a KEY data item on which the merge will be based. Each data-name must identify a data item in a record associated with file-name-1. In MERGE, the data names following the word KEY are listed from left to right in order of decreasing significance without regard to how they are divided into KEY phrases. The left-most data-name is the major key, the next data-name is the next most significant key, and so forth. The following rules apply:  A specific key data item must be physically located in the same position and have the same data format in each input file. However, it does not need to have the same data-name.  If file-name-1 contains variable length records, all of the KEY data-items must be contained within the first n character positions of the record, where n equals the minimum records size specified for file-name-1.  KEY data items must not contain an OCCURS clause or be subordinate to an item that contains OCCURS.  KEY data items may be qualified.  KEY data items may not be group items that contain variable occurrence data items.  KEY data items may be floating-point items.  KEY data items may not be variably-located. ═══ 1.64. MOVE Statement ═══ Description The MOVE statement transfers data from one area of storage to one or more other areas of storage. The MOVE statement has two formats:  Format 1 (MOVE)  Format 2 (MOVE with CORRESPONDING) ═══ Format 1 (MOVE) ═══ Description The MOVE statement transfers data from one area of storage to one or more other areas. Format 1 (MOVE) ┌────────────┐  │ ───MOVE──┬─identifier-1─┬─TO identifier-2─┴──────────── └─literal-1────┘ ═══ Format 2 (MOVE with CORRESPONDING) ═══ Description When you specify Format 2, both identifiers must be group items. Do not specify an index data item in a MOVE statement. Format 2 (MOVE with CORRESPONDING) ──MOVE─┬─CORRESPONDING─┬─identifier-1 TO identifier-2────── └─CORR──────────┘ ═══ 1.65. MULTIPLY Statement ═══ Description The MULTIPLY statement multiplies numeric items and sets the values of data items equal to the results. The MULTIPLY statement has two formats:  Format 1 (MULTIPLY)  Format 2 (MULTIPLY with GIVING) ═══ Format 1 (MULTIPLY) ═══ Description In Format 1, the value of identifier-1 is multiplied by the value of identifier-2. For each successive occurrence of identifier-2, the multiplication takes place in the left-to-right order in which identifier-2 is specified. You can use floating-point data items and literals anywhere a numeric data item or literal can be specified. The composite of operands may be more than 18 digits. Format 1 (MULTIPLY) ┌────────────────────┐  │ ──MULTIPLY─┬─identifier-1─┬─BY identifier-2──┬───────┼─ └───literal-1──┘ └ROUNDED┘ ────┬───────────────────────────────────────────────┬─── └──┬────┬──SIZE ERROR imperative-statement-1────┘ └─ON─┘ ────┬─────────────────────────────────────────────────┬─ └─NOT──┬────┬──SIZE ERROR imperative-statement-2──┘ └─ON─┘ ────┬───────────────┬─────────────────────────────────── └─END-MULTIPLY──┘ ═══ Format 2 (MULTIPLY with GIVING) ═══ Description In Format 2, the value of identifier-1 or literal-1 is multiplied by the value of identifier-2 or literal-2. The product is then stored in the data items referenced by identifier-3. Format 2 (MULTIPLY with GIVING) ──MULTIPLY─┬──identifier-1─┬─BY─┬─identifier-2─┬────── └───literal-1───┘ └──literal-2───┘ ┌───────────────────────┐  │ ──GIVING identifier-3──┬─────────┼───────────────────── └─ROUNDED─┘ ───┬───────────────────────────────────────────────┬─── └──┬────┬──SIZE ERROR imperative-statement-1────┘ └─ON─┘ ───┬─────────────────────────────────────────────────┬─ └─NOT──┬────┬──SIZE ERROR imperative-statement-2──┘ └─ON─┘ ────┬───────────────┬────────────────────────────────── └─END-MULTIPLY──┘ ═══ 1.66. OPEN Statement ═══ Description The OPEN statement initiates the processing of files and checks and/or writes labels. The OPEN statement's format varies depending upon whether you are using QSAM or VSAM files. You can specify both QSAM and VSAM files in a single OPEN statement. The OPEN statement has two formats:  Format 1 (QSAM Files)  Format 2 (VSAM Files) ═══ Format 1 (QSAM Files) ═══ Description In Format 1 of the OPEN statement, you must specify at least one of the phrases: INPUT, OUTPUT, I-O, or EXTEND. The INPUT, OUTPUT, I-O, and EXTEND phrases may appear in any order. Format 1 (QSAM Files) ┌────────────────────────────────────────────┐ │ ┌───────────────────────────────┐ │   │ │ ───OPEN─┬─INPUT───file-name-1─┬──────────────────┼───┼──── │ ├──REVERSED────────┤ │ │ └─┬────┬NO REWIND──┘ │ │ └WITH┘ │ │ ┌────────────────────────────────┐ │ │  │ │ ├─OUTPUT───file-name-2─┬──────────────────┼──┤ │ └─┬────┬NO REWIND──┘ │ │ ┌───────────┐ └WITH┘ │ │  │ │ ├─I-O───file-name-3┴─────────────────────────┤ │ ┌───────────┐ │ │  │ │ └─EXTEND───file-name-4┴──────────────────────┘ ═══ Format 2 (VSAM Files) ═══ Description In Format 2 of the OPEN statement, you must specify at least one of the phrases INPUT, OUTPUT, I-O or EXTEND with the OPEN key word. The INPUT, OUTPUT, I-O and EXTEND phrases may appear in any order. Format 2 (VSAM Files) ┌──────────────────────────┐ │ ┌─────────┐ │   │ │ ───OPEN──┬──INPUT───file-name-1───┼─── │ ┌─────────┐ │ │  │ │ ├─OUTPUT───file-name-2───┤ │ ┌─────────┐ │ │  │ │ ├─I-O───file-name-3──────┤ │ ┌─────────┐ │ │  │ │ └─EXTEND───file-name-4───┘ ═══ 1.67. PERFORM Statement ═══ Description The PERFORM statement explicitly transfers control to one or more procedures and, after execution of the specified procedure(s), implicitly returns control to the next executable statement. The PERFORM statement can be: An out-of-line PERFORM statement. (Procedure-name-1 is specified.) An in-line PERFORM statement. (Procedure-name-1 is omitted.) An in-line PERFORM must be delimited by the END-PERFORM phrase. The in-line and out-of-line formats cannot be combined. For example, if you specify procedure-name-1, you must not specify imperative-statement and the END-PERFORM phrase. The PERFORM statement has four formats:  Format 1 (Basic PERFORM)  Format 2 (PERFORM with TIMES)  Format 3 (PERFORM with UNTIL)  Format 4 (PERFORM with VARYING) ═══ Format 1 (Basic PERFORM) ═══ Description The procedure(s) referenced in the basic PERFORM statement are executed once, and control then passes to the next executable statement. Format 1 (Basic PERFORM) ──PERFORM─┬─procedure-name-1───────────────────────────1 │ │ │ └────────────────────────────────────────────2 1────┬────────────────────────────┬─────┬─────────────── ├─THROUGH─┬─procedure-name-2─┘ │ └─THRU────┘ │ │ 2───imperative-statement END-PERFORM───┘ ═══ Format 2 (PERFORM with TIMES) ═══ Description In Format 2 (PERFORM with TIMES), the procedure(s) referenced are executed the number of times specified by the value in identifier-1 or integer-1. Control then passes to the next executable statement. Format 2 (PERFORM with TIMES) ───PERFORM─┬─procedure-name-1─────────────────────────1 │ │ │ └─phrase-1 imperative-statement────────────2 1────┬────────────────────────────┬─phrase-1──┬──────── ├─THROUGH─┬─procedure-name-2─┘ │ └─THRU────┘ │ │ 2────END-PERFORM──────────────────────────────┘ where phrase-1 is: ────┬identifier-1─┬──TIMES───────────────────────────── └─integer-1───┘ ═══ Format 3 (PERFORM with UNTIL) ═══ Description In Format 3 (PERFORM with UNTIL), the procedure(s) referenced are performed until the condition specified by the UNTIL phrase is true. Control then passes to next executable statement following the PERFORM statement. Format 3 (PERFORM with UNTIL) ───PERFORM─┬─procedure-name-1─────────────────────────1 │ │ │ └─phrase-1 imperative-statement────────────2 1────┬────────────────────────────┬─phrase-1──┬──────── ├─THROUGH─┬─procedure-name-2─┘ │ └─THRU────┘ │ │ 2────END-PERFORM──────────────────────────────┘ where phrase-1 is: ────┬────────────────────────┬──UNTIL condition-1─────── └─┬──────┬─TEST─┬─BEFORE─┤ └─WITH─┘ └─AFTER──┘ ═══ Format 4 (PERFORM with VARYING) ═══ Description Format 4 (PERFORM with VARYING) increases or decreases the value of one or more identifiers or index-names according to the rules for the VARYING phrase. The Format 4 PERFORM statement can serially search an entire 7-dimensional table. Format 4 (PERFORM with VARYING) ───PERFORM─┬─procedure-name-1───────────────────────── 1 │ │ │ └─phrase-1 imperative-statement──────────── 2 1 ────┬────────────────────────────┬─phrase-1──┬──────── ├─THROUGH─┬─procedure-name-2─┘ │ └─THRU────┘ │ │ 2 ────END-PERFORM──────────────────────────────┘ where phrase-1 is: ───┬────────────────────────┬─VARYING─┬─identifier-2─┬── └─┬──────┬─TEST─┬─BEFORE─┤ └─index-name-1─┘ └─WITH─┘ └─AFTER──┘ ───FROM┬identifier-3┬BY┬identifier-4┬UNTIL condition-1── ├index-name-2┤ └literal-2───┘ └literal-1───┘ ───┬─────────────────────────────────────────────────── 3 │ ┌───────────────────────────────────────────────── 4 │  └─AFTER─┬─identifier-5─┬─FROM─┬─identifier-6─┬─BY─── 5 └─index-name-3─┘ ├─index-name-4─┤ └─literal-3────┘ 3 ────────────────────────────────────────┬───────────── 4 ──────────────────────────────────────┐ │ │ │ 5 ───┬─identifier-7─┬─UNTIL condition-2─┴─┘ └─literal-4────┘ ═══ 1.68. VARYING Phrase ═══ The following rules apply to the VARYING phrase, regardless of how many variables are specified: 1. In the VARYING/AFTER phrases, when an index-name is specified: a) The index-name is initialized and incremented or decremented according to the rules for the INDEXED BY phrase of the OCCURS clause. b) In the associated FROM phrase, an identifier must be described as an integer and have a positive value; a literal must be a positive integer. c) In the associated BY phrase, an identifier must be described as an integer; a literal must be a nonzero integer. 2. In the FROM phrase, when an index-name is specified: a) In the associated VARYING/AFTER phrase, an identifier must be described as an integer. It is initialized, as described in the SET statement. b) In the associated BY phrase, an identifier must be described as an integer and have a nonzero value; a literal must be a nonzero integer. 3. In the BY phrase, identifiers and literals must have nonzero values. 4. Changing the values of identifiers and/or index-names in the VARYING, FROM, and BY phrases during execution changes the number of times the procedures are executed. ═══ 1.69. READ Statement ═══ Description For sequential access, the READ statement makes the next logical record from a file available to the object program. For random access, the READ statement makes a specified record from a direct-access file available to the object program. When the READ statement is executed, the associated file must be open in INPUT or I-O mode. The READ statement has two formats:  Format 1 (Sequential Access Mode)  Format 2 (Random Access Mode) ═══ Format 1 (Sequential Access Mode) ═══ Description Use Format 1 for all files in sequential access mode. Format 1 (Sequential Access Mode) retrieves the next logical record from the file. The file organization determines the next record accessed. Format 1 (Sequential Access Mode) ───READ file-name-1─┬────┬─┬──────┬─┬─────────────────┬ └NEXT┘ └RECORD┘ └INTO identifier-1┘ ────┬───────────────────────────────────┬─────────────── └─┬────┬─END imperative-statement-1─┘ └─AT─┘ ────┬───────────────────────────────────────┬─────────── └─NOT─┬────┬─END imperative-statement-2─┘ └─AT─┘ ────┬──────────┬──────────────────────────────────────── └─END-READ─┘ ═══ Format 2 (Random Access Mode) ═══ Description You must specify Format 2 (Random Access Mode) for VSAM indexed and VSAM relative files in random access mode, and for files in the dynamic access mode when record retrieval is random. Format 2 (Random Access Mode) ───READ file-name-1─┬────────┬─┬───────────────────┬─── └─RECORD─┘ └─INTO identifier-1─┘ ───┬────────────────────────┬─────────────────────────── └─KEY─┬────┬─data-name-1─┘ └─IS─┘ ───┬────────────────────────────────────────────┬──────── └─INVALID───┬─────┬───imperative-statement-3─┘ └─KEY─┘ ───┬────────────────────────────────────────────────┬────── └─NOT INVALID───┬─────┬───imperative-statement-4─┘ └─KEY─┘ ───┬──────────┬───────────────────────────────────────── └─END-READ─┘ ═══ 1.70. INVALID KEY/NOT INVALID KEY ═══ VSAM Indexed Files Execution of a Format 2 READ statement causes the key of reference to be compared with the corresponding key data item in the file records, until the first record having an equal value is found. The file position indicator is positioned to this record, which is then made available. If no record can be so identified, an INVALID KEY condition exists, and READ statement execution is unsuccessful. VSAM Relative Files Execution of a Format 2 READ statement sets the file position indicator pointer to the record whose relative record number is contained in the RELATIVE KEY data item, and makes that record available. If the file does not contain such a record, an INVALID KEY condition exists, and READ statement execution is unsuccessful. Click here for further information about the invalid key condition. ═══ 1.71. AT END Phrase ═══ If the file position indicator indicates that no next logical record exists, or that an optional input file is not present, the following actions occur in the order specified: 1. A value derived from setting the file position indicator is placed into the I-O status associated with file-name-1 to indicate the at end condition. 2. If the AT END phrase is specified in the statement causing the condition, control is transferred to imperative-statement-1 in the AT END phrase. Any USE AFTER STANDARD EXCEPTION procedure associated with file-name-1 is not executed. 3. If the AT END phrase is not specified and a USE AFTER STANDARD EXCEPTION procedure is associated with the file, that procedure is executed, and control then returns to the next executable statement following the end of the READ statement. If the AT END phrase is not specified, a USE AFTER STANDARD EXCEPTION procedure does not have to be associated with file-name-1. When the at end condition occurs, execution of the READ statement is unsuccessful. The contents of the associated record area are undefined and the file position indicator is set to indicate that no valid next record has been established. ═══ 1.72. NOT AT END Phrase ═══ If an at end condition does not occur during the execution of a READ statement, the AT END phrase, if specified, is ignored, and the following actions occur: 1. The file position indicator is set and the I-O status associated with file-name-1 is updated. 2. If an exception condition other than an at end condition exists, control is transferred to the end of the READ statement following the execution of any USE AFTER STANDARD EXCEPTION procedure applicable to file-name-1. If no USE AFTER STANDARD EXCEPTION procedure is specified, control is transferred to the end of the READ statement or to imperative-statement-2, if specified. 3. If no exception condition exists, the record is made available in the record area and any implicit move resulting from the presence of an INTO phrase is executed. Control is transferred to the end of the READ statement or to imperative-statement-2, if specified. In the latter case, execution continues according to the rules for each statement specified in imperative-statement-2. If a procedure branching or conditional statement which causes explicit transfer of control is executed, control is transferred in accordance with the rules for that statement; otherwise, upon completion of the execution of imperative-statement-2, control is transferred to the end of the READ statement. ═══ 1.73. RELEASE Statement ═══ Description The RELEASE statement transfers records from an input/output area to the initial phase of a sorting operation. You can only use the RELEASE statement within the range of an input procedure associated with a SORT statement. Within an INPUT PROCEDURE, you must specify at least one RELEASE statement. When the RELEASE statement is executed, the current contents of record-name-1 are placed in the sort file; that is, made available for the beginning of the sorting operation. ───RELEASE record-name-1───┬───────────────────┬─────────── └─FROM identifier-1─┘ ═══ 1.74. RETURN Statement ═══ Description The RETURN statement transfers records from the end of a sorting or merging operation to an OUTPUT PROCEDURE. Use the RETURN statement only within the range of an OUTPUT PROCEDURE associated with a SORT or MERGE statement. Within the OUTPUT PROCEDURE, you must specify at least one RETURN statement. Execution of the RETURN statement makes the next record from file-name-1 available for processing by the OUTPUT PROCEDURE. ───RETURN file-name-1──┬────────┬──┬───────────────────┬─ └─RECORD─┘ └─INTO identifier-1─┘ ────┬────┬───END imperative-statement-1─────────────────── └─AT─┘ ────┬────────────────────────────────────┬─┬────────────┬─ └─NOT┬──┬─END imperative-statement-2─┘ └─END-RETURN─┘ └AT┘ ═══ INTO identifier-1 ═══ The result of the execution of a RETURN statement with the INTO phrase is equivalent to the application of the following two rules in the order specified: 1. The execution of the same RETURN statement without the INTO phrase. 2. The moving of the current record from the record area to the area specified by identifier-1 according to the rules for the MOVE statement without the CORRESPONDING phrase. The size of the current record is determined by rules specified for the RECORD clause. If the file description entry contains a RECORD IS VARYING clause, the implied move is a group move. The implied MOVE statement does not occur if the execution of the RETURN statement was unsuccessful. Any subscripting or reference modification associated with identifier-1 is evaluated after the record has been read and immediately before it is moved to the data item. The record is available both in the record area and in identifier-1. Identifier-1 (the record-area) may be a floating-point or DBCS data item. The record areas associated with file-name-1 and identifier-1 must not be the same storage area. You can specify the INTO phrase in a RETURN statement if one or both of the following are true: 1. Only one record description is subordinate to the sort-merge file description entry. 2. All record-names associated with file-name-1 and identifier-1 describe a group item or an elementary alphanumeric item. ═══ 1.75. REWRITE Statement ═══ Description The REWRITE statement logically replaces an existing record in a direct-access file. When the REWRITE statement is executed, the associated direct-access file must be open in I-O mode. ──REWRITE record-name-1───┬───────────────────┬────────── └─FROM identifier-1─┘ ───┬─────────────────────────────────────────┬──────────── └─INVALID─┬─────┬──imperative-statement-1─┘ └─KEY─┘ ───┬───────────────────────────────────────┬┬───────────┬─ └─NOT INVALID┬───┬imperative-statement-2┘└END-REWRITE┘ └KEY┘ ═══ 1.76. INVALID KEY/NOT INVALID KEY ═══ An INVALID KEY condition exists when any one of the following conditions is true:  The access mode is sequential, and the prime RECORD KEY of the record to be replaced does not equal the prime RECORD KEY of the last-retrieved record from the file.  The access mode is dynamic or random, and the prime RECORD KEY of the record to be replaced does not equal the prime RECORD KEY of any record in the file.  The alternate RECORD KEY of the record to be replaced, for which DUPLICATES are not allowed, equals the corresponding data item of a record already in the file. Click here for further information about the INVALID KEY condition. ═══ 1.77. SEARCH Statement ═══ Description The SEARCH statement searches a table of an element that satisfies the specified condition, and adjusts the associated index to indicate that element. The SEARCH statement has two formats:  Format 1 (Serial Search)  Format 2 (Binary Search) ═══ Format 1 (Serial Search) ═══ Description Format 1 (Serial Search) statement executes a serial search beginning at the current index setting. Format 1 (Serial Search) ──SEARCH identifier-1─┬──────────────────────────┬─────────── └─VARYING─┬─identifier-2─┬─┘ └─index-name-1─┘ ───┬───────────────────────────────────────┬────────────────── └───┬────┬───END imperative-statement-1─┘ └─AT─┘ ┌─────────────────────────────────────────┐  │ ───WHEN condition-1─┬─imperative-statement-2─┼─┬────────────┬─ └─NEXT SENTENCE──────────┘ └─END-SEARCH─┘ ═══ Format 2 (Binary Search) ═══ Description The Format 2 Binary Search statement executes a binary search. The search index does not need to be initialized by SET statements, because its setting is varied during the search operation so that its value is at no time less than the occurrence value of the first table element, nor ever greater than the occurrence value of the last table element. The index used is always that associated with the first index-name specified in the OCCURS clause. Format 2 (Binary Search) ───SEARCH ALL identifier-1───┬────────────────────1 └─┬────┬─────────────2 └─AT─┘ 1───────────────────────────────────────┬─────────── 2───END imperative-statement-1──────────┘ ───WHEN─┬─data-name-1─┬────┬─┬─EQUAL─┬────┬─┬──────3 │ └─IS─┘ │ └─TO─┘ │ │ └─ = ──────────┘ └─condition-name-1─────────────────────────4 3───┬─identifier-3────────────┬───────────────────── ├─literal-1───────────────┤ └─arithmetic-expression-1─┤ 4─────────────────────────────┘ ┌────────────────────────────────────────────────5  ──┬────────────────────────────────────────────────6 └─AND──┬─data-name-2─┬────┬─┬─EQUAL─┬────┬─┬─────7 │ └─IS─┘ │ └─TO─┘ │ │ └─ = ──────────┘ └─condition-name-2────────────────────────8 5──────────────────────────────┐ │ 6──────────────────────────────┼──────────────────── 7───┬─identifier-4────────────┬┤ ├─literal-2───────────────┤│ └─arithmetic-expression-2─┘│ 8──────────────────────────────┘ ───┬─imperative-statement-2───┬────────────┬──┬──── │ └─END-SEARCH─┘ │ └─NEXT SENTENCE────────────────────────────┘ ═══ arithmetic-expression-1, arithmetic-expression-2 ═══ In Format 2 of the SEARCH statement, arithmetic-expression-1 or arithmetic-expression-2 may be any arithmetic expression, with the following restriction: no identifier in the arithmetic expression may be an ASCENDING/DESCENDING KEY data item for identifier-1 or an item that is subscripted by the first index-name for identifier-1. Click here for a description of arithmetic expressions. ═══ index-name-1 ═══ If index-name-1 is an index for identifier-1, this index is used for the search. Otherwise, the first (or only) index name is used. If index-name-1 is an index for another table element, then the first (or only) index-name for identifier-1 is used for the search. The occurrence number represented by index-name-1 is increased by the same amount as the search index-name and at the same time. When you omit this index-name-1, the first (or only) index-name for identifier-1 is used for the search. If indexing is used to search a table without an INDEXED BY clause, correct results are ensured only if both the table defined with the index and the table defined without the index have table elements of the same length and with the same number of occurrences. ═══ identifier-1 ═══ Identifier-1 can be a data item subordinate to a data item that contains an OCCURS clause; that is, it can be a part of a two to seven dimensional table. In this case, the data description entry must specify an INDEXED BY phrase for each dimension of the table. Identifier-1 must refer to all occurrences within the table element; that is, it must not be subscripted or reference-modified. Identifier-1 cannot be an INDEX data item. It can be a DBCS item if you have defined the ASCENDING/DESCENDING KEY as a DBCS item, but it cannot be a floating-point data item or a POINTER data item. The Data Division description of identifier-1 must contain an OCCURS clause with the INDEXED BY option and the KEY IS phrase. In the WHEN phrase, if you explicitly or implicitly specify an ASCENDING/DESCENDING KEY data item, you must also specify all preceding ASCENDING/DESCENDING KEY data-names for identifier-1. ═══ 1.78. SET Statement ═══ Description The SET statement is used to perform one of the following operations: 1. Placing values associated with table elements into indexes associated with index-names 2. Incrementing or decrementing an occurrence number 3. Setting the status of an external switch to ON or OFF 4. Moving data to condition names to make conditions true 5. Setting USAGE IS POINTER data items to a data address 6. Setting USAGE IS PROCEDURE-POINTER data items to an entry address. Index-names are related to a given table through the INDEXED BY phrase of the OCCURS clause; they are not further defined in the program. When the sending and receiving fields in a SET statement share part of their storage (that is, the operands overlap), the result of the execution of such SET statement is undefined. The SET statement has six Formats:  Format 1 (SET for basic table handling)  Format 2 (SET for adjusting indexes)  Format 3 (SET for external switches)  Format 4 (SET for condition names)  Format 5 (SET for USAGE IS POINTER data items)  Format 6 (SET for USAGE IS PROCEDURE-POINTER data items) ═══ Format 1 (SET for basic table handling) ═══ Description When this form of the SET statement is executed, the current value of the receiving field is replaced by the value of the sending field (with conversion). Format 1 (SET for basic table handling) ┌──────────────┐  │ ───SET─┬─index-name-1─┼─TO ───┬─index-name-2─┬──────── └─identifier-1─┘ ├─identifier-2─┤ └─integer-1────┘ ═══ Format 2 (SET for adjusting indexes) ═══ Description When this form of the SET statement is executed, the value of the receiving field is increased (UP BY) or decreased (DOWN BY) by a value corresponding to the value in the sending field. Format 2 (SET for adjusting indexes) ┌────────────┐  │ ───SET index-name-3─┴┬─UP BY───┬──┬─identifier-3─┬──── └─DOWN BY─┘ └─integer-2────┘ ═══ Format 3 (SET for external switches) ═══ Description When this form of the SET statement is executed, the status of each external switch associated with the specified mnemonic-name is switched ON or OFF. Format 3 (SET for external switches) ┌─────────────────────────────────┐ │ ┌───────────────┐ │   │ │ ───SET─────mnemonic-name-1─┴─TO───┬─ON──┬─┴─────────── └─OFF─┘ ═══ Format 4 (SET for condition names) ═══ Description When this form of the SET statement is executed, the value associated with a condition name is placed in its conditional variable according to the rules of the VALUE phrase. Format 4 (SET for condition names) ┌────────────────┐  │ ───SET condition-name-1─┴─TO TRUE───────────────────── ═══ Format 5 (SET for USAGE IS POINTER data items) ═══ Description When this form of the SET statement is executed, the current value of the receiving field is replaced by the address value contained in the sending field. Format 5 (SET for USAGE IS POINTER data items) ┌───────────────────────────┐ │ │  │ ───SET──┬──identifier-4─────────────┼───────────────── └──ADDRESS OF identifier-5──┘ ───TO──┬──identifier-6─────────────┬─────────────────── ├──ADDRESS OF identifier-7──┤ ├──NULL─────────────────────┤ └──NULLS────────────────────┘ ═══ Format 6 (SET for USAGE IS PROCEDURE-POINTER data items) ═══ Description When this form of the SET statement is executed, the current value of the receiving field is replaced by the address value contained in the sending field. Format 6 (SET for USAGE IS PROCEDURE-POINTER data items) ┌───────────────────────────────┐  │ ──SET────procedure-pointer-data-item-1─┴────── ───TO──┬─procedure-pointer-data-item-2─┬───── ├─ENTRY───┬──identifier-8───────┤ │ └──literal-1──────────┤ ├─NULL──────────────────────────┤ └─NULLS─────────────────────────┘ ═══ 1.79. SORT Statement ═══ Description The SORT statement accepts records from one or more files, sorts them according to the specified keys, and makes the sorted records available either through an OUTPUT PROCEDURE or in an output file. The SORT statement may appear anywhere in the Procedure Division except in the declarative portion. ┌─────────────────────────────────────1 │  ───SORT file-name-1──┬────┬──┬─ASCENDING──┬─┬─────┬────────2 └─ON─┘ └─DESCENDING─┘ └─KEY─┘ 1─────────────────────────┐ ┌────────────┐ │  │ │ 2────data-name-1───┴──────┴────────────────────────────────── ────┬──────────────────────────────────────┬──────────────── └─┬──────┬───DUPLICATES───┬──────────┬─┘ └─WITH─┘ └─IN ORDER─┘ ────┬─────────────────────────────────────────────┬───────── └─┬───────────┬─SEQUENCE─┬──┬─alphabet-name-1─┘ └─COLLATING─┘ └IS┘ ┌──────────┐  │ ────┬─USING file-name-2──┴────────────────────────────────── 3 └─INPUT PROCEDURE──┬────┬──procedure-name-1───────────── 4 └─IS─┘ 3 ────────────────────────────────────┬─────────────────────── 4 ────┬──────────────────────────────┬┘ └─┬─THROUGH─┬─procedure-name-2─┘ └─THRU────┘ ┌───────────┐  │ ────┬─GIVING file-name-3─┴────────────────────────────────── 5 └─OUTPUT PROCEDURE─┬────┬─procedure-name-3────────────── 6 └─IS─┘ 5 ────────────────────────────────────┬─────────────────────── 6 ────┬──────────────────────────────┬┘ └─┬─THROUGH─┬─procedure-name-4─┘ └─THRU────┘ ═══ data-name-1 ═══ Data-name-1 specifies a KEY data item on which the SORT statement will be based. Each such data-name must identify a data item in a record associated with file-name-1. The data-names following the word KEY are listed from left to right in the SORT statement in order of decreasing significance without regard to how they are divided into KEY phrases. The leftmost data-name is the major key, the next data-name is the next most significant key, and so forth. The following rules apply: 1. A specific KEY data item must be physically located in the same position and have the same data format in each input file. However, it does not need to have the same data-name. 2. If file-name-1 has more than one record description, then the KEY data-items need to be described in only one of the record descriptions. 3. If file-name-1 contains variable length records, all of the KEY data-items must be contained in only one of the record descriptions. 4. KEY data-items must not contain an OCCURS clause or be subordinate to an item that contains an OCCURS clause. 5. KEY data-items may be qualified. 6. KEY data-items may not be group items that contain variable occurrence data items. 7. KEY data-items may be floating-point items. 8. KEY data-items may not be variably located. ═══ 1.80. START Statement ═══ Description The START statement positions an indexed or relative file for subsequent sequential record retrieval. When the START statement is executed, the associated indexed or relative file must be open in either INPUT or I-O mode. ───START file-name─┬────────────────────────────────── 1 └─KEY─┬────┬─────────────────────── 2 └─IS─┘ 1 ──────────────────────────────────────────────────┬──── 2 ────┬─EQUAL─┬────┬─────────────────────┬─data-name┘ │ └─TO─┘ │ ├─ = ──────────────────────────────┤ ├─GREATER─┬──────┬─────────────────┤ │ └─THAN─┘ │ ├─ > ──────────────────────────────┤ ├─NOT LESS─┬──────┬────────────────┤ │ └─THAN─┘ │ ├─NOT < ───────────────────────────┤ ├─GREATER─┬──────┬─OR EQUAL─┬────┬─┤ │ └─THAN─┘ └─TO─┘ │ └─ >= ─────────────────────────────┘ ─┬──────────────────────────────────────────┬────────── └─INVALID─┬─────┬──imperative-statement-1──┘ └─KEY─┘ ─┬──────────────────────────────────────┬─┬─────────┬── └NOT INVALID┬───┬imperative-statement-2┘ └END-START┘ └KEY┘ ═══ 1.81. INVALID KEY/NOT INVALID KEY ═══ If the comparison is not satisfied by any record in the file, an invalid key condition exists; the position of the file position indicator is undefined, and (if specified) the INVALID KEY imperative-statement is executed. You can omit both the INVALID KEY phrase and the EXCEPTION/ERROR procedure. Click here for further information about the INVALID KEY condition. ═══ 1.82. STOP Statement ═══ Description The STOP statement halts execution of the object program either permanently or temporarily. ───STOP─┬──RUN──────┬─────────────────────── └──literal──┘ ═══ 1.83. STRING Statement ═══ Description The STRING statement strings together the partial or complete contents of two or more data items or literals into one single data item. One STRING statement can replace a series of MOVE statements. When the STRING statement is executed, data is transferred from the sending field to the receiving field. After the STRING statement is executed, only that part of the receiving field where the system transfers data will change. The rest of the receiving field contains the data that was present before executing the STRING statement. ┌───────────────────────────────────────────1 ├──────────────┐  │ ──STRING──┬─identifier-1─┼─DELIMITED──┬────┬──────────2 └─literal-1────┘ └─BY─┘ 1───────────────────┐ │ │ 2──┬─identifier-2─┬─┴──INTO identifier-3──────────────── ├─literal-2────┤ └─SIZE─────────┘ ──┬────────────────────────────────┬─────────────────── └─┬──────┬──POINTER identifier-4─┘ └─WITH─┘ ──┬─────────────────────────────────────────┬────────── └──┬────┬─OVERFLOW imperative-statement-1─┘ └─ON─┘ ──┬─────────────────────────────────────────────┬────── └─NOT──┬────┬─OVERFLOW imperative-statement-2─┘ └─ON─┘ ──┬────────────┬─────────────────────────────────────── └─END-STRING─┘ ═══ 1.84. SUBTRACT Statement ═══ Description The SUBTRACT statement subtracts one numeric item, or the sum of two or more numeric items from one or more numeric items, and stores the result. The SUBTRACT statement has three formats:  Format 1 (SUBTRACT)  Format 2 (SUBTRACT with GIVING)  Format 3 (SUBTRACT with CORRESPONDING) ═══ Format 1 (SUBTRACT) ═══ Description In Format 1 (SUBTRACT), all identifiers or literals preceding the key word FROM are added together. This sum is then subtracted from and stored immediately in identifier-2. This process is repeated for each successive occurrence of identifier-2, in the left-to-right order in which identifier-2 is specified. Format 1 (SUBTRACT) ┌──────────────┐ ┌───────────────────┐  │  │ ──SUBTRACT─┬─identifier-1─┼FROM─identifier-2┬───────┼─ └─literal-1────┘ └ROUNDED┘ ──┬──────────────────────────────────────────┬───────── └─┬────┬─SIZE ERROR imperative-statement-1─┘ └─ON─┘ ──┬───────────────────────────────────────────────┬──── └─NOT──┬────┬─SIZE ERROR imperative-statement-2─┘ └─ON─┘ ──┬──────────────┬───────────────────────────────────── └─END-SUBTRACT─┘ ═══ Format 2 (SUBTRACT with GIVING) ═══ Description In Format 2 (SUBTRACT with GIVING), all identifiers or literals preceding the key word FROM are added together and this sum is subtracted from identifier-2 or literal-2. The result of the subtraction is stored as the new value of each data item referenced by identifier-3. Format 2 (SUBTRACT with GIVING) ┌──────────────┐  │ ──SUBTRACT─┬─identifier-1─┼FROM─┬─identifier-2─┬────── └─literal-1────┘ └─literal-2────┘ ┌──────────────────────┐  │ ──GIVING───identifier-3─┬─────────┼──────────────────── └─ROUNDED─┘ ──┬──────────────────────────────────────────┬───────── └─┬────┬─SIZE ERROR imperative-statement-1─┘ └─ON─┘ ──┬───────────────────────────────────────────────┬──── └─NOT──┬────┬─SIZE ERROR imperative-statement-2─┘ └─ON─┘ ──┬──────────────┬───────────────────────────────────── └─END-SUBTRACT─┘ ═══ Format 3 (SUBTRACT with CORRESPONDING) ═══ Description In Format 3 (SUBTRACT with CORRESPONDING), elementary data items within identifier-1 are subtracted from the corresponding elementary data items within identifier-2, where the results are stored. Format 3 (SUBTRACT with CORRESPONDING) ──SUBTRACT─┬─CORRESPONDING─┬────────────────────────── └─CORR──────────┘ ──identifier-1 FROM identifier-2──┬─────────┬────────── └─ROUNDED─┘ ──┬──────────────────────────────────────────┬───────── └─┬────┬─SIZE ERROR imperative-statement-1─┘ └─ON─┘ ──┬───────────────────────────────────────────────┬──── └─NOT──┬────┬─SIZE ERROR imperative-statement-2─┘ └─ON─┘ ──┬──────────────┬───────────────────────────────────── └─END-SUBTRACT─┘ ═══ 1.85. UNSTRING Statement ═══ Description The UNSTRING statement causes contiguous data in a sending field to be separated and placed into multiple receiving fields. You can use one UNSTRING statement instead of multiple MOVE statements. Note: This element may exhibit different behavior when the CMPR2 compiler option is in effect. ──UNSTRING identifier-1────────────────────────────── ──┬───────────────────────────────────────────────────1 └─DELIMITED──┬────┬──┬─────┬─┬─identifier-2─┬───────2 └─BY─┘ └─ALL─┘ └─literal-1────┘ 1─────────────────────────────────┬──────────────────── 2──┬────────────────────────────┬─┘ │ │ │ ┌────────────────────────┐│ │  ││ └─OR┬─────┬─┬─identifier-3──┼┘ └─ALL─┘ └─literal-2─────┘ ┌────────────────────────────────────────────3  ──INTO───identifier-4─┬──────────────────────────────┬4 └─DELIMITER──┬──┬─identifier-5─┘ └IN┘ 3──────────────────────────────┐ │ 4──┬───────────────────────────┼─────────────────────── └─COUNT─┬────┬─identifier-6─┘ └─IN─┘ ──┬───────────────────────────────┬─────────────────── └─┬──────┬─POINTER identifier-7─┘ └─WITH─┘ ──┬──────────────────────────────┬──────────────────── └─TALLYING─┬────┬─identifier-8─┘ └─IN─┘ ──┬─────────────────────────────────────────┬───────── └──┬────┬─OVERFLOW imperative-statement-1─┘ └─ON─┘ ──┬────────────────────────────────────────────┬────── └─NOT─┬────┬─OVERFLOW imperative-statement-2─┘ └─ON─┘ ──┬──────────────┬──────────────────────────────────── └─END-UNSTRING─┘ ═══ 1.86. WRITE Statement ═══ Description The WRITE statement releases a logical record for an output or input/output file. When the WRITE statement is executed, the associated QSAM file must be open in OUTPUT or EXTEND mode, the associated VSAM file must go in OUTPUT mode, and the associated VSAM file must be open in OUTPUT, I-O, or EXTEND mode. The WRITE statement has four formats:  Format 1 (QSAM Sequential Files)  Format 2 (VSAM Sequential Files)  Format 3 (VSAM Indexed Files)  Format 4 (VSAM Relative Files) ═══ Format 1 (QSAM Sequential Files) ═══ Description QSAM files are sequentially organized. ADVANCING and END-OF-PAGE control the vertical positioning of each line on a printed page. However, do not specify both ADVANCING and END-OF-PAGE in a single WRITE statement. If the printed page is held on an intermediate device (e.g., a disk), the format, when edited or browsed, may appear different than the expected output. Format 1 (QSAM Sequential Files) ───WRITE record-name-1──┬───────────────────┬─────────────── └─FROM identifier-1─┘ ─┬───────────────────────────────────────────────────────┬───1 ├┬─BEFORE─┬─┬───────────┬─┬─┬─identifier-2─┬─┬───────┬─┬┘ │└─AFTER──┘ └─ADVANCING─┘ │ └─integer-1────┘ ├─LINE──┤ │ │ │ └─LINES─┘ │ │ ├─mnemonic-name-1────────────┤ │ └─PAGE───────────────────────┘ ├──────────────────────────────────────────────────────┬────2 └───────INVALID──┬──────┬───imperative-statement-1─────┘ └─KEY──┘ 1───┬────────────────────────────────────────────────────┬───3 └─┬─────┬─┬──END-OF-PAGE─┬─imperative-statement-2────┘ └─AT──┘ └─────EOP──────┘ 2───┬────────────────────────────────────────────────────┬───4 └──NOT INVALID──┬──────┬─────imperative-statement-3──┘ └─KEY──┘ 3───┬────────────────────────────────────────────────────┬┬── └──NOT─┬────┬┬─END-OF-PAGE─┬─imperative-statement-4──┘│ └─AT─┘└────EOP──────┘ │ 4─────────────────────────────────────────────────────────┘ ───END-WRITE──────────────────────────────────────────────── ═══ 1.87. Format 2 (VSAM Sequential Files) ═══ Description The WRITE statement releases a logical record for an output or input/output file. When the WRITE statement is executed, the associated QSAM file must be open in OUTPUT or EXTEND mode, and the associated VSAM file must be open in OUTPUT, I-O, or EXTEND mode. Format 2 (VSAM Sequential Files) ───WRITE record-name-1─┬───────────────────┬─┬───────────┬─ └─FROM identifier-1─┘ └─END-WRITE─┘ ═══ 1.88. Format 3 (VSAM Indexed Files) ═══ Description The WRITE statement releases a logical record for an output or input/output file. When the WRITE statement is executed, the associated QSAM file must be open in OUTPUT or EXTEND mode, and the associated VSAM file must be open in OUTPUT, I-O, or EXTEND mode. Format 3 (VSAM Indexed Files) ───WRITE record-name-1──┬─────────────────┬──────────── └FROM identifier-1┘ ───┬─────────────────────────────────────────┬───────── └─INVALID──┬─────┬─imperative-statement-1─┘ └─KEY─┘ ───┬──────────────────────────────────────┬─┬─────────┬ └NOT INVALID┬───┬imperative-statement-2┘ └END-WRITE┘ └KEY┘ ═══ 1.89. Format 4 (VSAM Relative Files) ═══ Description The WRITE statement releases a logical record for an output or input/output file. When the WRITE statement is executed, the associated QSAM file must be open in OUTPUT or EXTEND mode, and the associated VSAM file must be open in OUTPUT, I-O, or EXTEND mode. Format 4 (VSAM Relative Files) ───WRITE record-name-1──┬─────────────────┬────────────── └FROM identifier-1┘ ───┬─────────────────────────────────────────┬─────────── └─INVALID──┬─────┬─imperative-statement-1─┘ └─KEY─┘ ───┬──────────────────────────────────────┬─┬─────────┬── └NOT INVALID┬───┬imperative-statement-2┘ └END-WRITE┘ └KEY┘ ═══ 1.90. INVALID KEY (QSAM Sequential Files) ═══ When you specify the INVALID KEY phrase and attempt to write beyond the externally defined boundaries of the file, the INVALID KEY imperative statement is executed. You can omit both the INVALID KEY phrase and the EXCEPTION/ERROR procedure. Click here for further information about the invalid key condition. ═══ 1.91. INVALID KEY (VSAM Indexed Files) ═══ You can omit both the INVALID KEY phrase and the EXCEPTION/ERROR procedure. When an attempt is made to write beyond the externally defined boundaries of the file, WRITE statement execution is unsuccessful and an EXCEPTION/ERROR condition exists. The status key, if specified, is updated, and if an explicit or implicit EXCEPTION/ERROR procedure is specified for the file, the procedure is executed. An invalid key condition is caused by any of the following:  The access mode is sequential and the file is opened OUTPUT, and the value of the prime record key is not greater than that of the previous record.  The file is opened OUTPUT or I-O and the value of the prime record key equals that of an already existing record.  An attempt is made to write beyond the externally defined boundaries of the file. When the invalid key condition is recognized, WRITE statement execution is unsuccessful, and the contents of the record are unaffected. Program execution proceeds according to the rules described under invalid key condition. ═══ 1.92. INVALID KEY (VSAM Relative Files) ═══ You can omit both the INVALID KEY phrase and the EXCEPTION/ERROR procedure. INVALID KEY conditions that apply to a relative file in OPEN OUTPUT mode also apply to one in OPEN EXTEND mode. An invalid key condition is caused by any of the following:  An attempt is made to write beyond the externally defined boundaries of the file.  The access mode is random or dynamic and the RELATIVE KEY data item specifies a record that already exists in the file.  The number of significant digits in the relative record number is larger than the size of the relative key data item for the file. When the invalid key condition is recognized, WRITE statement execution is unsuccessful, and the contents of the record are unaffected. Program execution proceeds according to the rules described under invalid key condition. ═══ 1.93. Intrinsic Functions ═══ An intrinsic function is a function that performs a mathematical, character, or logical operation, and thereby allows you to make reference to a data item whose value is derived automatically during the execution of the object program. There are three types of functions:  Alphanumeric  Integer  Numeric Functions are elementary data items and return alphanumeric, numeric, or integer values. Functions may not serve as receiving operands. The values returned by some functions are determined by the arguments specified in the function-identifier when the functions are evaluated. Some functions require no arguments; others require a fixed number of arguments, and still others allow a variable number of arguments. An argument must be one of the following:  an identifier  an arithmetic expression  a literal other than a figurative constant  a special-register  a function-identifier. When a function allows an argument to be repeated a variable number of times, you may refer to a table by specifying the data-name and any qualifiers that identify the table. This must be followed immediately by subscripting where one or more of the subscripts is the word ALL. Note: The evaluation of an ALL subscript must result in at least one argument, or the value returned by the function will be undefined. This situation can be diagnosed at run-time by specifying the SSRANGE compiler option and the CHECK run-time option. An argument may not be a DBCS literal or data item. For help with individual intrinsic functions, select from the following list: ACOS Function MIDRANGE Function ANNUITY Function MIN Function ASIN Function MOD Function ATAN Function NUMVAL Function CHAR Function NUMVAL-C Function COS Function ORD Function CURRENT-DATE Function ORD-MAX Function DATE-OF-INTEGER Function ORD-MIN Function DAY-OF-INTEGER Function PRESENT-VALUE Function FACTORIAL Function RANDOM Function INTEGER Function RANGE Function INTEGER-OF-DATE Function REM Function INTEGER-OF-DAY Function REVERSE Function INTEGER-PART Function SIN Function LENGTH Function SQRT Function LOG Function STANDARD-DEVIATION Function LOG10 Function SUM Function LOWER-CASE Function TAN Function MAX Function UPPER-CASE Function MEAN Function VARIANCE Function MEDIAN Function WHEN-COMPILED Function ═══ 1.94. ACOS Function ═══ Description The ACOS function returns a numeric value in radians that approximates the arccosine of the argument specified. The function type is numeric. The returned value is greater than or equal to zero and less than or equal to pi. ───FUNCTION ACOS (argument-1)────────────────────────────── ═══ 1.95. ANNUITY Function ═══ Description The ANNUITY function returns a numeric value that approximates the ratio of an annuity paid at the end of each period, for a given number of periods, at a given interest rate, to an initial value of one. The number of periods is specified by argument-2, and the rate of interest is specified by argument-1. The function type is numeric. ───FUNCTION ANNUITY ( argument-1 argument-2)──────────────────────── ═══ 1.96. ASIN Function ═══ Description ASIN returns a numeric value in radians that approximates the arcsine of the argument. The returned value is greater than or equal to -pi/2 and less than or equal to +pi/2. The function type is numeric. Format ───FUNCTION ASIN (argument-1)────────────────────────────────────── ═══ 1.97. ATAN Function ═══ Description ATAN returns a numeric value in radians that approximates the arctangent of the argument. The returned value is greater than -pi/2 and less than +pi/2. The function type is numeric. Format ───FUNCTION ATAN (argument-1)────────────────────────────────────── ═══ 1.98. CHAR Function ═══ Description CHAR returns a one-character alphanumeric value that is a character in the program collating sequence having the ordinal position equal to the value of the argument specified. The function type is alphanumeric. ───FUNCTION CHAR (argument-1)────────────────────────────────────── ═══ 1.99. COS Function ═══ Description The COS function returns a numeric value that approximates the cosine of an angle or arc, expressed in radians, that is specified by the argument. The returned value is greater than or equal to -1 and less than or equal to +1. The function type is numeric. ───FUNCTION COS (argument-1)─────────────────────────────────────── ═══ 1.100. CURRENT-DATE Function ═══ Description The CURRENT-DATE function returns a 21-character alphanumeric value that represents the calendar date, time of day, and local time differential from Greenwich Mean Time provided by the system on which the function is evaluated. The function type is alphanumeric. ───FUNCTION CURRENT-DATE─────────────────────────────────────────── ═══ CURRENT-DATE ═══  Characters 1-8 represent standard date format (YYYYMMDD, where Y=year, M=month, D=day).  Characters 9-14 represent standard time format (HHMMSS, where H=hour, M=minute, S=second).  Characters 15-16 represent the hundredths of a second.  Character 17, a '+' or '-', indicates if the time indicated is behind or ahead of Greenwich Mean Time.  Characters 18-19 (00-12) indicate the number of hours that the reported time is behind Greenwich Mean time. (00-13) indicate the number of hours that the reported time is ahead of Greenwich Mean time.  Characters 20-21 (00-59) indicate the additional number of minutes that the reported time is ahead of or behind Greenwich Mean Time. ═══ 1.101. DATE-OF-INTEGER Function ═══ Description The DATE-OF-INTEGER function converts a date in the Gregorian calendar from integer date form to standard date form (YYYYMMDD). The function type is integer. The function result is an eight-digit integer. ───FUNCTION DATE-OF-INTEGER (argument-1)─────────────────────────── ═══ 1.102. DAY-OF-INTEGER Function ═══ Description The DAY-OF-INTEGER function converts a date in the Gregorian calendar from integer date form to Julian date form (YYYYDDD). The function type is integer. The function result is a seven-digit integer. ───FUNCTION DAY-OF-INTEGER (argument-1)──────────────────────────── ═══ 1.103. FACTORIAL Function ═══ Description The FACTORIAL function returns an integer that is the factorial of argument specified. The function type is integer. ───FUNCTION FACTORIAL (argument-1)───────────────────────────────── ═══ 1.104. INTEGER Function ═══ Description The INTEGER function returns the greatest integer value that is less than or equal to argument-1. The function type is integer. ───FUNCTION INTEGER (argument-1)─────────────────────────────────── ═══ 1.105. INTEGER-OF-DATE Function ═══ Description The INTEGER-OF-DATE function converts a date in the Gregorian calendar from standard date form (YYYYMMDD) to integer date form. The function type is integer. The function result is a seven-digit integer with a range from 1 to 3,067,671. Format ───FUNCTION INTEGER-OF-DATE (argument-1)─────────────────────────── ═══ 1.106. INTEGER-OF-DAY Function ═══ Description The INTEGER-OF-DAY function converts a date in the Gregorian calendar from Julian date form (YYYYDDD) to integer date form. The function type is integer. The function result is a seven-digit integer. ───FUNCTION INTEGER-OF-DAY (argument-1)──────────────────────────── ═══ 1.107. INTEGER-PART Function ═══ Description The INTEGER-PART function returns an integer that is the integer portion of argument specified. The function type is integer. The function result is an integer intermediate value. ───FUNCTION INTEGER-PART (argument-1)────────────────────────────── ═══ 1.108. LENGTH Function ═══ Description LENGTH returns an integer equal to the length of the argument in bytes. The function type is integer. The function result is a nine-digit integer. ───FUNCTION LENGTH (argument-1)────────────────────────────── ═══ 1.109. LOG Function ═══ Description LOG returns a numeric value that approximates the logarithm to the base e (natural log) of argument-1. The function type is numeric. Format ───FUNCTION LOG (argument-1)─────────────────────────────────────── ═══ 1.110. LOG10 Function ═══ Description The LOG10 function returns a numeric value that approximates the logarithm to the base 10 of argument-1. The function type is numeric. ───FUNCTION LOG10 (argument-1)───────────────────────────────────── ═══ 1.111. LOWER-CASE Function ═══ Description The LOWER-CASE function returns a character string that is the same length as the argument specified with each uppercase letter replaced by the corresponding lowercase letter. The function type is alphanumeric. Format ───FUNCTION LOWER-CASE (argument-1)──────────────────────────────── ═══ 1.112. MAX Function ═══ Description The MAX function returns the content of the argument that contains the maximum value. The function type depends on the argument types. When the argument type is alphabetic or alphanumeric, the function type is alphanumeric; when the argument type is all integer, the function type is integer; and when the argument type is numeric (not all integer), the function type is numeric. ┌───────────────┐  │ ───FUNCTION MAX (─── argument-1 ──┴─)────────────────────────────── ═══ 1.113. MEAN Function ═══ Description The MEAN function returns a numeric value that approximates the arithmetic average of its arguments. The function type is numeric. ┌───────────────┐  │ ───FUNCTION MEAN (──── argument-1 ──┴─)──────────────────────────── ═══ 1.114. MEDIAN Function ═══ Description The MEDIAN function returns the content of the argument whose value is the middle value in of the list formed by arranging the arguments in sorted order. The function type is numeric. If the number of occurrences referenced by the argument is odd, the returned value is such that at least half of the occurrences referenced by the argument are greater than or equal to the value and at least half are less than or equal. If the number of occurrences referenced by the argument is even, the returned value is the arithmetic mean of the values referenced by the two middle occurrences. ┌───────────────┐  │ ───FUNCTION MEDIAN (──── argument-1 ──┴─)────────────────────────── ═══ 1.115. MIDRANGE Function ═══ Description The MIDRANGE function returns a numeric value that approximates the arithmetic average of the minimum argument and maximum argument. The function type is numeric. ┌───────────────┐  │ ───FUNCTION MIDRANGE (──── argument-1 ──┴─)──────────────────────── ═══ 1.116. MIN Function ═══ Description The MIN function returns the content of the argument that contains the minimum value. The function type depends on the argument types. When the argument type is alphabetic or alphanumeric, the function type is alphanumeric; when the argument type is all integer, the function type is integer; and when the argument type is numeric (not all integer), the function type is numeric. ┌───────────────┐  │ ───FUNCTION MIN (─── argument-1 ──┴─)────────────────────────────── ═══ 1.117. MOD Function ═══ Description The MOD function returns an integer value that is argument-1 modulo argument-2. The function type is integer. The function result is an integer with as many digits as the shorter of argument-1 and argument-2. ───FUNCTION MOD (argument-1 argument-2)──────────────────────────── ═══ 1.118. NUMVAL Function ═══ Description The NUMVAL function returns a numeric value represented by the alphanumeric character string specified in an argument. The function strips away any leading or trailing blanks in the string, producing a numeric value that can be used in an arithmetic context. The returned value is an approximation of the numeric value represented by argument-1. The function type is numeric. ───FUNCTION NUMVAL (argument-1)───────────────────────── Argument-1 must be a non-numeric literal or an alphanumeric data item whose content has one of the following formats: ──┬─────┬┬─────┬┬─────┬┬─digit─┬───────────┬┬┬─────┬── └space┘├─ + ─┤└space┘│ └─. ─┬─────┬┘│└space┘ └─ - ─┘ │ └digit┘ │ └─. digit────────────┘ or ──┬─────┬┬─digit─┬───────────┬┬┬─────┬┬─────┬┬─────┬── └space┘│ └─. ─┬─────┬┘│└space┘├─ + ─┤└space┘ │ └digit┘ │ ├─ - ─┤ └─. digit────────────┘ ├─CR──┤ └─DB──┘ ═══ 1.119. NUMVAL-C Function ═══ Description The NUMVAL-C function returns a numeric value represented by the alphanumeric character string specified as argument-1. Any optional currency sign specified by argument-2 and any optional commas preceding the decimal point are stripped away, producing a numeric value that can be used in arithmetic expressions. The returned value is an approximation of the numeric value represented by argument-1. The function type is numeric. ──FUNCTION NUMVAL-C (argument-1─┬────────────┬─)─────────────────── │ │ └─argument-2─┘ Argument-1 must be a non-numeric literal or an alphanumeric data item whose content has one of the following formats: ─┬─────┬┬───┬┬─────┬┬──┬┬─────┬┬digit┬─────────┬┬─────────┬┬┬─────┬ └space┘├ + ┤└space┘└cs┘└space┘│ │┌───────┐│└. ┬─────┬┘│└space┘ └ - ┘ │ │  ││ └digit┘ │ │ └─, digit┴┘ │ └. digit────────────────────┘ or ─┬─────┬┬──┬┬─────┬┬digit┬─────────┬┬─────────┬┬┬─────┬┬───┬┬─────┬ └space┘└cs┘└space┘│ │┌───────┐│└. ┬─────┬┘│└space┘├ + ┤└space┘ │ │ ││ └digit┘ │ ├ - ┤ │ └─, digit┴┘ │ ├CR─┤ └─. digit───────────────────┘ └DB─┘ ═══ 1.120. ORD Function ═══ Description The ORD function returns an integer value that is the ordinal position of its argument in the collating sequence for the program. The lowest ordinal position is 1. The function type is integer. The function result is a three-digit integer. ───FUNCTION ORD (argument-1)─────────────────────────────────────── ═══ 1.121. ORD-MAX Function ═══ Description The ORD-MAX function returns a value that is the ordinal number of the position, in the argument list, of the argument that contains the maximum value. The function type is integer. ┌────────────────┐  │ ───FUNCTION ORD-MAX (──── argument-1 ──┴─)───────────────────────── ═══ 1.122. ORD-MIN Function ═══ Description The ORD-MIN function returns a value that is the ordinal number of the argument that contains the minimum value. The function type is integer. ┌───────────────┐  │ ───FUNCTION ORD-MIN (──── argument-1 ──┴─)───────────────────────── ═══ 1.123. PRESENT-VALUE Function ═══ Description The PRESENT-VALUE function returns a value that approximates the present value of a series of future period-end amounts specified by argument-2 at a discount rate specified by argument-1. The function type is numeric. ┌───────────────┐  │ ───FUNCTION PRESENT-VALUE ( argument-1───argument-2────┴─)───────── ═══ 1.124. RANDOM Function ═══ Description The RANDOM function returns a numeric value that is a pseudo-random number from a rectangular distribution. The function type is numeric. ───FUNCTION RANDOM ──┬────────────────┬──────────────────────────── │ │ └(──argument-1──)┘ ═══ argument-1 ═══  If you specify argument-1, it must be zero or a positive integer, up to and including (10**18) - 1. However, only those values from zero up to and including 2,147,483,645 will yield a distinct sequence of pseudo-random numbers.  Argument-1 is the seed value used to generate a sequence of pseudo-random numbers. If a subsequent reference within a run unit specifies argument-1, a new sequence of random numbers will start.  If the first reference to this function in the run unit does not specify argument-1, the seed value used will be zero.  In each case, subsequent references (within a run unit) without specifying argument-1 return the next number in the current sequence. ═══ 1.125. RANGE Function ═══ Description The RANGE function returns a value that is equal to the value of the maximum argument minus the value of the minimum argument. The function type depends on the argument type. For example, if the argument types are integer, the function type is integer; if at least one argument type is numeric, the function type is numeric. ┌───────────────┐  │ ───FUNCTION RANGE (─── argument-1 ──┴─)──────────────────────────── ═══ 1.126. REM Function ═══ Description The REM function returns a numeric value whose value is the remainder of argument-1 divided by argument-2. The function type is numeric. ───FUNCTION REM (argument-1 argument-2)──────────────────────────── ═══ 1.127. REVERSE Function ═══ Description The REVERSE function returns a character string of exactly the same length of the argument, whose characters are exactly the same as those specified in the argument, except that they are in the reverse order. The function type is alphanumeric. ───FUNCTION REVERSE (argument-1)─────────────────────────────────── ═══ 1.128. SIN Function ═══ Description The SIN function returns a numeric value that approximates the sin of an angle or arc, expressed in radians, that is specified by the argument. The returned value is greater than or equal to -1 and less than or equal to +1. The function type is numeric. ───FUNCTION SIN (argument-1)─────────────────────────────────────── ═══ 1.129. SQRT Function ═══ Description The SQRT function returns a numeric value that approximates the square root of the argument specified. The returned value is the absolute value of the approximation of the square root of the argument specified. The function type is numeric. ───FUNCTION SQRT (argument-1)────────────────────────────────────── ═══ 1.130. STANDARD-DEVIATION Function ═══ Description The STANDARD-DEVIATION function returns a numeric value that approximates the standard deviation of its arguments. The function type is numeric. ┌───────────────┐  │ ───FUNCTION STANDARD-DEVIATION (─── argument-1 ──┴─)─────────────── ═══ 1.131. SUM Function ═══ Description The SUM function returns a value that is the sum of the arguments. The function type depends on the argument type. For example, if the argument types are integer, the function type is integer; if the argument types are numeric, the function type is numeric. ┌───────────────┐  │ ───FUNCTION SUM (─── argument-1 ──┴─)────────────────────────────── ═══ 1.132. TAN Function ═══ Description The TAN function returns a numeric value that approximates the tangent of an angle or arc, expressed in radians, that is specified by the argument. The function type is numeric. ───FUNCTION TAN (argument-1)─────────────────────────────────────── ═══ 1.133. UPPER-CASE Function ═══ Description The UPPER-CASE function returns a character string that is the same length as the argument specified, with the lowercase letters replaced by corresponding uppercase letters. The function type is alphanumeric. ───FUNCTION UPPER-CASE (argument-1)──────────────────────────────── ═══ 1.134. WHEN-COMPILED Function ═══ Description The WHEN-COMPILED function returns the date and time the program was compiled as provided by the system on which the program was compiled. The function type is alphanumeric. ───FUNCTION WHEN-COMPILED────────────────────────────────────────── Reading from left to right, the 21 character positions in the value returned can be interpreted as follows:  Characters 1-8 represent standard date format (YYYYMMDD, where Y=year, M=month, D=day).  Characters 9-14 represent standard time format (HHMMSS, where H=hour, M=minute, S=second).  Characters 15-16 represent the hundredths of a second.  Character 17, a '+' or '-', indicates if the time indicated is behind or ahead of Greenwich Mean Time.  Characters 18-19 (00-12) indicate the number of hours that the reported time is behind Greenwich Mean time. (00-13) indicate the number of hours that the reported time is ahead of Greenwich Mean time.  Characters 20-21 (00-59) indicate the additional number of minutes that the reported time is ahead of or behind Greenwich Mean Time. ═══ 1.135. VARIANCE Function ═══ Description The VARIANCE function returns a numeric value that approximates the variance of its arguments. The function type is numeric. ┌───────────────┐  │ ───FUNCTION VARIANCE (─── argument-1 ──┴─)───────────────────────── ═══ 1.136. Compiler-Directing Statements ═══ Description The compiler's main job is to translate your COBOL program into language that the computer can process (object code). The compiler also lists errors in your source statements and provides supplementary information to aid you in debugging and tuning your program. You can direct and control compilation with the following:  Compiler-directing statements  Compiler options. A compiler-directing statement begins with a compiler-directing verb that causes the compiler to perform a specific operation during compilation.  For help with individual compiler-directing statements, select from the following list: BASIS READY or RESET TRACE CBL(PROCESS) REPLACE CONTROL(CBL) SERVICE LABEL COPY SERVICE RELOAD DELETE SKIP1/2/3 EJECT TITLE INSERT USE ═══ 1.137. BASIS Compiler-Directing Statement ═══ Description The BASIS Statement is an extended source program library statement. It provides a complete COBOL program as the source for a compilation. A complete program may be included as an entry in a user's library and may be used as the source for a compilation. Compiler input is a BASIS statement, optionally followed by any number of INSERT and/or DELETE statements. After the execution of a BASIS statement, the source file remains unchanged. Note: If INSERT or DELETE statements are used to modify the COBOL source program provided by a BASIS statement, the sequence field of the COBOL source program must contain numeric sequence numbers in ascending order. ───┬───────────────────┬──BASIS─┬basis-name┬─ └──sequence-number──┘ └literal-1─┘ ═══ 1.138. CBL (PROCESS) Compiler-Directing Statement ═══ Description CBL(PROCESS) allows you to specify compiler options to be used in the compilation of the program. ───┬─────CBL─────┬────┬──────────────┬────── └───PROCESS───┘ └─options─list─┘ Compiler Options-list: For help with individual compiler options, select from the following list: ADV MAP APOST NAME AWO NUMBER BUFSIZE NUMPROC CMPR2 OBJECT COMPILE OFFSET CURRENCY OPTIMIZE DATA OUTDD DBCS QUOTE DECK RENT DISK SEQUENCE DUMP SIZE DYNAM SOURCE FASTSRT SPACE FLAG SSRANGE FLAGMIG TERMINAL FLAGSAA TEST FLAGSTD TRUNC LANGUAGE VBREF LIB WORD LINECOUNT XREF LIST ZWB ═══ 1.139. CONTROL(*CBL) Compiler-Directing Statement ═══ Description CONTROL(*CBL) allows you to selectively display or suppress the listing of source code, object code, and storage maps throughout the source program. The *CONTROL and *CBL statements are synonymous. Whenever you use *CONTROL, *CBL is accepted as well. ───┬──*CONTROL───┬────┬───SOURCE────┬────┬───┬─── └────*CBL─────┘ ├───NOSOURCE──┤ └─.─┘ ├───LIST──────┤ ├───NOLIST────┤ ├───MAP───────┤ └───NOMAP─────┘ ═══ 1.140. COPY Compiler-Directing Statement ═══ Description The COPY statement is a library statement that places prewritten text in a COBOL program. Prewritten source program entries can be included in a source program at compile time. Thus, an installation can use standard file descriptions, record descriptions, or procedures without recoding them. These entries and procedures can then be saved in user-created libraries; they can then be included in the source program by means of the COPY statement. The effect of processing a COPY statement is that the library text associated with text-name is copied into the source program, logically replacing the entire COPY statement, beginning with the word COPY and ending with the period, inclusive. When the REPLACING phrase is not specified, the library text is copied unchanged. ───COPY─┬text-name┬─┬───────────────────────┬──┬────────────┬── └literal-1┘ ├──OF──┬──┬library-name┬┘ └──SUPPRESS──┘ └──IN──┘ └─literal-2──┘ ──┬────────────────────────────────────┬─. ────────────────── │ ┌────────────────────┐ │ │  │ │ └──REPLACING operand-1 BY operand-2──┘ ═══ REPLACING ═══ When you specify REPLACING, the library text is copied, and each properly matched occurrence of operand-1 within the library text is replaced by the associated operand-2. Either operand, or both, may be a DBCS data-name or DBCS literal. DBCS data-names may be from 1 to 14 DBCS characters in length; DBCS literals may be a maximum of 28 DBCS characters long. DBCS data-names and literals may not be continued across lines. Each operand may consist of one of the following:  Pseudo-text 1. A sequence of character-strings and/or separators bounded by, but not including, pseudo-text-1 delimiters (= =). Both characters of each pseudo-text-1 delimiter must appear on one line; however, character-strings within pseudo-text-1 can be continued. 2. Any individual character-string within pseudo-text-1 may be up to 323 characters long. 3. Pseudo-text-1 refers to pseudo-text when used for operand-1, and pseudo-text-2 refers to pseudo-text when used for operand-2. 4. Pseudo-text-1 must not be null, nor may it consist solely of space characters and/or comment lines. 5. Embedded blanks are used in the text comparison process to indicate multiple text words. 6. Pseudo-text must not contain the word COPY. 7. Pseudo-text-1 may consist solely of the separator comma or separator semicolon. 8. Pseudo-text-2 may be null; it may consist solely of space characters and/or comment lines. 9. Pseudo-text may contain DBCS character-strings. Pseudo-text containing DBCS characters may not be continued across lines.  Identifier - May be defined in any Data Division section  Literal - May be numeric or non-numeric - May be a DBCS literal  Word - May be any single COBOL word (except COPY) ═══ 1.141. DELETE Compiler-Directing Statement ═══ Description The DELETE statement is an extended source library statement. It removes COBOL statements from the source program included by a BASIS statement. ───┬───────────────────┬──DELETE sequence─number─field─── └──sequence─number──┘ ═══ 1.142. EJECT Compiler-Directing Statement ═══ Description  The EJECT statement specifies that the next source statement is to be printed at the top of the next page.  The EJECT statement must be the only statement on the line. You may write it in either Area A or Area B, and you may terminate it with a separator period.  The EJECT statement has no effect on the compilation of the source program itself. ──EJECT──┬─────┬─── └─ . ─┘ ═══ 1.143. INSERT Compiler-Directing Statement ═══ Description The INSERT statement is a library statement that adds COBOL statements to the source program included by a BASIS statement. New source program statements following the INSERT statement may include USAGE DISPLAY-1 (DBCS) items. Note: If you use INSERT or DELETE statements to modify the COBOL source program provided by a BASIS statement, the sequence field of the COBOL source program must contain numeric sequence-numbers in ascending order. Any INSERT or DELETE statements referring to these sequence-numbers must occur in ascending order. ───┬───────────────────┬──INSERT sequence─number─field─── └──sequence─number──┘ ═══ 1.144. READY or RESET TRACE Compiler-Directing Statement ═══ Description The READY or RESET TRACE statement is accepted by COBOL/370 for source level compatibility with OS/VS COBOL. It can only appear in the Procedure Division, and has no effect for COBOL/370. ───┬────READY────┬────TRACE─────. ───────── └────RESET────┘ ═══ 1.145. REPLACE Compiler-Directing Statement ═══ Description The REPLACE statement replaces source program text. It provides a means of applying a change to an entire COBOL source program, or part of a source program, without manually having to find and modify all places that need to be changed. The REPLACE statement may occur anywhere in the source program where a character-string may occur. It must be preceded by a separator period, except when it is the first statement in a separately compiled program. It must be ended by a separator period.  REPLACE Statement (Format 1)  REPLACE Statement (Format 2) ═══ REPLACE Compiler-Directing Statement (Format 1) ═══ Description  The REPLACE statement replaces source program text. It provides a means of applying a change to an entire COBOL source program, or part of a source program, without manually having to find and modify all places that need to be changed.  In Format 1 of the REPLACE statement, each matched occurrence of pseudo-text-1 in the source program is replaced by the corresponding pseudo-text-2.  If you do not specify Format 2 of the REPLACE statement, a given occurrence of the REPLACE statement is in effect from the point at which it is specified until the next occurrence of the statement or until the end of the separately compiled program, respectively. ┌────────────────────────────────────┐  │ ───REPLACE ==pseudo─text─1== BY ==pseudo─text─2==. ─── ═══ REPLACE Compiler-Directing Statement (Format 2) ═══ Description Any text replacement currently in effect is discontinued with the REPLACE OFF form of REPLACE. If you do not specify this format (Format 2), a given occurrence of the REPLACE statement is in effect from the point at which it is specified until the next occurrence of the statement or until the end of the separately compiled program, respectively. ───REPLACE OFF. ─── ═══ 1.146. SERVICE LABEL Compiler-Directing Statement ═══ Description The SERVICE LABEL statement is generated by the CICS preprocessor to indicate control flow. It is not intended for general use. ───SERVICE LABEL─── ═══ 1.147. SERVICE RELOAD Compiler-Directing Statement ═══ Description The SERVICE RELOAD statement is accepted by COBOL/370 for source level compatibility with OS/VS COBOL and DOS/VS COBOL. It is for use under CICS only, and can appear only in the Procedure Division. It has no effect for COBOL/370. ──SERVICE RELOAD identifier─1────────────── ═══ 1.148. SKIP1/2/3 Compiler-Directing Statement ═══ Description The SKIP 1/2/3 statements specify blank lines that the compiler should add when printing the source listing. SKIP statements have no effect on the compilation of the source program itself. ──┬──SKIP1──┬──┬─────┬─── ├──SKIP2──┤ └─ . ─┘ └──SKIP3──┘ ═══ 1.149. TITLE Compiler-Directing Statement ═══ Description The TITLE statement specifies a title to be printed at the top of each page of the source listing produced during compilation. If no TITLE statement is found, a title containing the identification of the compiler and the current release level is generated. The title is left-justified on the title-line. The TITLE statement:  Forces a new page immediately, if the SOURCE compiler option is in effect  Is not printed on the source listing  Has no other effect on compilation  Has no effect on program execution ──TITLE literal──┬─────┬───────────────────────────────────────────── └─ . ─┘ ═══ 1.150. USE Compiler-Directing Statement ═══ Description USE is a compiler-directing statement that has three declaratives:  EXCEPTION/ERROR Declarative  LABEL Declarative  DEBUGGING Declarative. ═══ EXCEPTION/ERROR Declarative ═══ Description  The EXCEPTION/ERROR declarative specifies procedures for input/output exception or error handling that are to be executed in addition to the standard system procedures.  The EXCEPTION/ERROR procedures are activated when an input/output error occurs during execution of a READ, WRITE, REWRITE, START, OPEN, CLOSE, or DELETE statement.  The words EXCEPTION and ERROR are synonymous and may be used interchangeably. ──USE─┬────────┬─AFTER─┬──────────┬─┬─EXCEPTION─┬───── └─GLOBAL─┘ └─STANDARD─┘ └─ERROR─────┘ ┌─────────┐  │ ──PROCEDURE─┬────┬─┬─file-name-1─┬───────────────────── └─ON─┘ ├─INPUT───────┤ ├─OUTPUT──────┤ ├─I-O─────────┤ └─EXTEND──────┘ ═══ LABEL Declarative ═══ Description The LABEL declarative provides you with label-handling procedures. ───USE─┬────────┬─AFTER─┬────────┬─┬─────────────┬──┬────────┬─── └─GLOBAL─┘ └STANDARD┘ ├──BEGINNING──┤ ├──FILE──┤ └──ENDING─────┘ ├──REEL──┤ └──UNIT──┘ ┌─────────┐  │ ──LABEL PROCEDURE─┬────┬─┬─file-name-1─┬──────────────────────── └─ON─┘ ├─INPUT───────┤ ├─OUTPUT──────┤ ├─I-O─────────┤ └─EXTEND──────┘ ═══ GLOBAL ═══ The GLOBAL keyword is used when establishing declarative precedence for nested programs. Special precedence rules are followed when programs are contained within other programs. In applying these rules, only the first qualifying declarative will be selected for execution. The declarative that is selected for execution must satisfy the rules for execution of that declarative. The order of precedence for selecting a declarative is: 1. A file-specific declarative (that is, a declarative of the form USE AFTER ERROR ON file-name-1) within the program that contains the statement that caused the qualifying condition. 2. A file-specific declarative with the GLOBAL attribute within a program directly or indirectly containing the program that contains the statement that caused the qualifying condition. 3. A mode-specific declarative (that is, a declarative of the form USE AFTER ERROR ON INPUT) within the program that contains the statement that caused the qualifying condition. 4. A mode-specific declarative with the GLOBAL attribute within a program directly or indirectly containing the program that contains the statement that caused the qualifying condition. ═══ DEBUGGING Declarative ═══ Description Note: Debugging sections are obsolete language elements and are to be deleted from the next revision of the ANSI Standard. Debugging sections are permitted only in the outermost program; they are not valid in nested programs. All debugging statements must be written together in a section immediately after the DECLARATIVES header. Except for the USE FOR DEBUGGING sentence itself, within the debugging procedure there must be no reference to any non-declarative procedures. ┌───────────────┐  │ ───USE─┬───┬─DEBUGGING─┬──┬─┬─procedure-name-1┴┬──── └FOR┘ └ON┘ └─ALL PROCEDURES───┘ ═══ 1.151. ADV Option ═══ Description With ADV in effect, the compiler adds 1 byte to the record length for the printer control character. ─────┬─ADV───┬───────────────── └─NOADV─┘ ═══ 1.152. APOST Option ═══ Description APOST specifies an apostrophe (') as the delimiter for literals. QUOTE specifies a quotation mark (") as the delimiter character for literals. ─────┬─QUOTE─┬───────────────── └─APOST─┘ ═══ 1.153. AWO Option ═══ Description With AWO specified, the APPLY WRITE-ONLY clause will be in effect if any file in the program is physical sequential with blocked V-mode records. The clause will be in effect even if it was not specified within the program. ─────┬─AWO───┬───────────────── └─NOAWO─┘ ═══ 1.154. BUFSIZE Option ═══ Description BUFSIZE allocates an amount of main storage to the buffer for each compiler work data set (where 1K=1024 bytes decimal). ─────BUFSIZE(┬─nnnnn─┬)──────── └─nnnK──┘ ═══ 1.155. CMPR2 Option ═══ Description CMPR2 aids in the migration of programs written for VS COBOL II Release 2 to the COBOL/370 level. It causes the compiler to generate code that is compatible with code generated by VS COBOL II Release 2. ─────┬─CMPR2───┬─────────────── └─NOCMPR2─┘ ═══ 1.156. COMPILE Option ═══ Description COMPILE forces full compilation even with serious errors; all diagnostics and object code are generated. Note: You should not attempt to execute the object code generated if the compilation resulted in serious errors; the results could be unpredictable or an abnormal termination could occur. ─────┬─COMPILE──────────┬────── ├─NOCOMPILE────────┤ └─NOCOMPILE(┬─W─┬)─┘ ├─E─┤ └─S─┘ ═══ 1.157. CURRENCY Option ═══ Description The CURRENCY option is an alternative method to select a symbol other than the dollar sign ($) to be the currency symbol you use in the PICTURE clause where one may be specified when you do not want to code the CURRENCY SIGN clause in your source program. ─────┬─CURRENCY(literal)─┬──── └─NOCURRENCY────────┘ ═══ 1.158. DATA Option ═══ Description DATA controls whether dynamic storage for data areas is acquired from below the 16-megabyte line or from unrestricted storage when a program is compiled with the RENT option and is run under XA. ─────DATA(┬─24─┬)────────────── └─31─┘ ═══ 1.159. DBCS Option ═══ Description DBCS causes the compiler to recognize X'0E' and X'0F' as shift codes for the double byte portion of a nonnumeric literal. DBCS is ignored if either CMPR2 or FLAGSTD is in effect. ─────┬─DBCS───┬──────────────── └─NODBCS─┘ ═══ 1.160. DECK Option ═══ Description DECK produces object code in the form of 80-column card images. ─────┬─DECK───┬──────────────── └─NODECK─┘ ═══ 1.161. DISK Option ═══ Description Use DISK to specify that a program listing is to be produced containing page headings, message identification numbers, message texts, severity levels, and line numbers of the statements in error, as well as any other output requested by OFFSET, MAP, LIST, XREF, SOURCE, or VBREF. This listing will be written to the appropriate read/write disk with a filetype of LISTING. Note: If you have issued a FILEDEF for SYSPRINT to redirect the listing file produced by the compiler, the DISK, PRINT, and NOPRINT options are ignored. ───────┬──DISK────┬─────── ├──PRINT───┤ └──NOPRINT─┘ ═══ 1.162. DUMP Option ═══ Description DUMP produces a system dump at compile time. This option is not intended for general use; it should only be used at the request of an IBM representative. The dump consists of a listing of the compiler's registers and a storage dump, and is intended primarily for diagnostic personnel when a bug is discovered in the compiler itself. ─────┬─DUMP───┬──────────────── └─NODUMP─┘ ═══ 1.163. DYNAM Option ═══ Description Use DYNAM to cause separately compiled programs invoked through the CALL literal statement to be loaded dynamically at run time. Default is NODYNAM. Note: Do not use DYNAM with CICS. ─────┬─DYNAM───┬─────────────── └─NODYNAM─┘ ═══ 1.164. FASTSRT Option ═══ Description Use the FASTSRT Option to improve the performance of most SORT operations. With FASTSRT the IBM DFSORT performs the I/O on input and/or output files named in either or both of the following statements:  SORT...USING  SORT...GIVING If you specify FASTSRT, you may not use the DFSORT options of SORTIN and SORTOUT. ─────┬─FASTSRT───┬───────────── └─NOFASTSRT─┘ ═══ 1.165. FLAG Option ═══ Description FLAG produces diagnostic messages for errors of the specified severity level or above at the end of the source listing. ─────┬─FLAG(x┬────┬)┬────────── │ └─,y─┘ │ └─NOFLAG───────┘ ═══ 1.166. FLAGMIG Option ═══ Description FLAGMIG aids in the migration of VS COBOL II programs to COBOL/370. Use FLAGMIG to identify language elements that may be implemented differently in VS COBOL II Version 1 Release 2 than they are in COBOL/370. To use FLAGMIG, you must also specify the CMPR2 compiler option. ─────┬─FLAGMIG───┬───────────── └─NOFLAGMIG─┘ ═══ 1.167. FLAGSAA Option ═══ Description FLAGSAA identifies elements that may restrict program portability across IBM systems; elements are flagged with warning (W) level messages at compile time. ─────┬─FLAGSAA───┬──────────────────────────── └─NOFLAGSAA─┘ ═══ 1.168. FLAGSTD Option ═══ Description FLAGSTD enables you to get informational messages about the Standard COBOL elements included in your program. ─────┬─FLAGSTD(x┬────┬┬────┬┬)─ │ └─yy─┘└─,O─┘│ └─NOFLAGSTD────────────┘ ═══ 1.169. LANGUAGE Option ═══ Description LANGUAGE enables you to select the language in which compiler output will be printed. The information that will be printed in the selected language includes:  Diagnostic messages  Source listing page and scale headers  FIPS message headers  Message summary headers  Compilation summary  Headers and notations that result from the selection of certain compiler options (MAP, XREF, VBREF,and FLAGSTD). ─────LANGUAGE(XXxxxxxx)──── ═══ 1.170. LIB Option ═══ Description Use LIB if your program has COPY, BASIS, or REPLACE statements. ─────┬─LIB───┬───────────────── └─NOLIB─┘ ═══ 1.171. LINECOUNT Option ═══ Description  LINECOUNT (nnn) specifies the number of lines to be printed on each page of the compilation listing.  LINECOUNT (0) suppresses pagination. ─────LINECOUNT(nnn)───────────── ═══ 1.172. LIST Option ═══ Description LIST produces a listing of the assembler-language expansion of your source code. ─────┬─LIST───┬──────────────── └─NOLIST─┘ ═══ 1.173. MAP Option ═══ Description MAP produces a listing of the items defined in the Data Division. ─────┬─MAP───┬───────────────── └─NOMAP─┘ MAP output includes:  Data Division map  Global tables  Literal pools  Nested program structure map, and program attributes  Size of the program's Working-Storage, and location in the object code if compiled with the NORENT option. ═══ 1.174. NAME Option ═══ Description NAME appends a link-edit NAME card to each object module that you create. ─────┬─NAME─┬─────────────┬─┬── │ └(┬─ALIAS───┬)┘ │ │ └─NOALIAS─┘ │ └─NONAME───────────────┘ ═══ 1.175. NUMBER Option ═══ Description NUMBER allows you to use the line numbers in your source code in error messages, MAP, LIST, and XREF listings. ─────┬─NUMBER───┬────────────── └─NONUMBER─┘ ═══ 1.176. NUMPROC Option ═══ Description  NUMPROC(PFD) is a performance option you may use to bypass invalid sign processing.  NUMPROC(NOPFD) is an option you may use if you want the compiler to perform invalid sign processing.  NUMPROC(MIG) is an option you may use to aid in migrating OS/VS COBOL programs to COBOL/370. ─────NUMPROC(┬─PFD───┬)──────── ├─NOPFD─┤ └─MIG───┘ ═══ 1.177. OBJECT Option ═══ Description OBJECT places the generated object code on disk or tape to be used later as input for the linkage editor. OBJECT output goes to the data set associated with SYSLIN ddname. ─────┬─OBJECT───┬────────────── └─NOOBJECT─┘ ═══ 1.178. OFFSET Option ═══ Description OFFSET produces a condensed Procedure Division listing. ─────┬─OFFSET───┬────────────── └─NOOFFSET─┘ ═══ 1.179. OPTIMIZE Option ═══ Description OPTIMIZE reduces the run time of your object program. ─────┬─OPTIMIZE───┬──────────── └─NOOPTIMIZE─┘ ═══ 1.180. OUTDD Option ═══ Description OUTDD provides run-time DISPLAY output on a data-set other than SYSOUT. ─────OUTDD(ddname)───────────── ═══ 1.181. QUOTE Option ═══ Description QUOTE specifies a quotation mark (") as the delimiter character for literals. APOST specifies an apostrophe (') as the delimiter for literals. ─────┬─QUOTE─┬───────────────── └─APOST─┘ ═══ 1.182. RENT Option ═══ Description  RENT generates a compiled program as a reentrant object module that can be invoked as a main program or subprogram.  NORENT generates a compiled program as a nonreentrant object module that can be invoked as a main program or subprogram. Note: Do not use NORENT with CICS. ─────┬─RENT───┬──────────────── └─NORENT─┘ ═══ 1.183. SEQUENCE Option ═══ Description SEQUENCE directs the compiler to examine columns 1 through 6 of your source statements to check that the statements are arranged in ascending order according to their EBCDIC collating sequence. ─────┬─SEQUENCE───┬──────────── └─NOSEQUENCE─┘ ═══ 1.184. SIZE Option ═══ Description SIZE enables you to specify the amount of main storage available for compilation (where 1K=1024 bytes decimal). The minimum compiler storage value for the SIZE option is 778,240 bytes, or 760K bytes. ─────SIZE(┬─nnnnn─┬)─────────── ├─nnnK──┤ └─MAX───┘ ═══ 1.185. SOURCE Option ═══ Description SOURCE supplies a listing of your source program, including statements embedded by PROCESS or COPY statements. ─────┬─SOURCE───┬────────────── └─NOSOURCE─┘ ═══ 1.186. SPACE Option ═══ Description SPACE selects single, double, or triple spacing in your source code listing. ─────SPACE(┬─1─┬)────────────── ├─2─┤ └─3─┘ ═══ 1.187. SSRANGE Option ═══ Description  SSRANGE generates code that checks if subscripts or indexes attempt to reference an area outside the region of the table. It does not individually check each subscript or index; rather, it checks the effective address to ensure that this address does not cause a reference outside the table's region.  SSRANGE checks variable-length items to ensure that their current length is within their maximum defined length.  SSRANGE checks the validity of reference modification expressions. ─────┬─SSRANGE───┬──────── └─NOSSRANGE─┘ ═══ 1.188. TERMINAL Option ═══ Description TERMINAL sends progress and diagnostic messages to the SYSTERM data set. ─────┬─TERMINAL───┬──────────── └─NOTERMINAL─┘ ═══ 1.189. TEST Option ═══ Description TEST produces object code that can be executed with Debug Tool, the debugging component of AD/Cycle CODE/370. For further information, please see the COBOL/370 Programming Guide. TEST has two suboptions; you can specify both, just one of the suboptions, or neither of the suboptions. When you specify both of the suboptions, they may appear in any order. The default values when TEST is specified without one or both suboptions are ALL and SYM. Thus, TEST without any suboptions is equivalent to TEST(ALL, SYM). ─┬─TEST─┬──────────────────┬─┬─ │ └(─hook-,-symbol─)─┘ │ │ │ └─NOTEST────────────────────┘ ═══ 1.190. TRUNC Option ═══ Description The TRUNC option controls the way BINARY arithmetic fields are truncated during MOVE and arithmetic operations. Binary fields are defined via the USAGE clause by specifying BINARY, COMP, or COMP-4. ─────TRUNC(┬─STD─┬)──────────── ├─OPT─┤ └─BIN─┘ ═══ 1.191. VBREF Option ═══ Description Use VBREF to get a cross-referenced list of all verbs used in the source program, the line numbers of the lines in which they were used, and a count of the number of times each verb was used. Use NOVBREF for more efficient compilation. ─────┬─VBREF───┬─────────────── └─NOVBREF─┘ ═══ 1.192. WORD Option ═══ Description WORD(xxxx) specifies that an alternate reserved word table is to be used during compilation. ─────┬─WORD(xxxx)─┬──────────── └─NOWORD─────┘ ═══ 1.193. XREF Option ═══ Description XREF provides a sorted cross-reference listing of data-names and procedure-names including a section listing all the program names that are referenced within your program, and the line number where they are defined. EBCDIC data-names and procedure-names will be listed in alphanumeric order. ─┬─XREF─┬───────────────┬─┬── │ └─(─┬─SHORT─┬─)─┘ │ │ └─FULL──┘ │ │ │ └─NOXREF─────────────────┘ ═══ 1.194. ZWB Option ═══ Description ZWB directs the compiler to remove the sign from a signed external decimal (DISPLAY) field when comparing this field to an alphanumeric elementary field during run time. ZWB affects program execution logic; that is, the same COBOL source program can give different results, depending on the option setting. ─────┬─ZWB───┬───────────────── └─NOZWB─┘ ═══ alphabet-name-1 ═══ You must specify alphabet-name-1 in the ALPHABET clause of the SPECIAL-NAMES paragraph. You may specify any one of the alphabet-name clause phrases with the following results: STANDARD-1 The ASCII collating sequence is used for all nonnumeric comparisons. STANDARD-2 The International Reference Version of the ISO 7-bit code defined in International Standard 646, 7-bit Coded Character Set for Information Processing Interchange is used for all nonnumeric comparisons NATIVE The EBCDIC collating sequence is used for all nonnumeric comparisons. EBCDIC The EBCDIC collating sequence is used for all nonnumeric comparisons. literal The collating sequence established by the specification of literals in the alphabet-name clause is used for all non-numeric comparisons. ═══ 1.195. Arithmetic Expressions ═══ Arithmetic expressions are used as operands of certain conditional and arithmetic statements. An arithmetic expression may consist of any of the following: 1. An identifier described as a numeric elementary item (including numeric functions) 2. A numeric literal 3. The figurative constant ZERO 4. Identifiers and literals, as defined in items 1, 2, and 3, separated by arithmetic operators 5. Two arithmetic expressions, as defined in items 1, 2, 3, and/or 4, separated by an arithmetic operator 6. An arithmetic expression, as defined in items 1, 2, 3, 4, and/or 5, enclosed in parentheses. Any arithmetic expression may be preceded by a unary operator. Identifiers and literals appearing in arithmetic expressions must represent either numeric elementary items or numeric literals on which arithmetic may be performed. If an exponential expression is evaluated as both a positive and a negative number, the result will always be the positive number. The square root of 4, for example (4 ** 0.5) is evaluated as +2 and -2. COBOL/370 always returns +2. Arithmetic Operators Five binary arithmetic operators and two unary arithmetic operators may be used in arithmetic expressions. They must be preceded and followed by a space, and they are interpreted as follows: Binary Operator Operation Performed + Addition - Subtraction * Multiplication / Division ** Exponentiation Unary Operator Operation Performed + Multiplication by +1 - Multiplication by -1 You can use parentheses in arithmetic expressions to specify the order in which elements are to be evaluated. Expressions within parentheses are evaluated first. When expressions are contained within a nest of parentheses, evaluation proceeds from the least inclusive to the most inclusive set. When parentheses are not used, or when parenthesized expressions are at the same level of inclusiveness, the following hierarchical order is implied: 1. Unary operator 2. Exponentiation 3. Multiplication and division 4. Addition and subtraction An arithmetic expression may begin only with a left parenthesis, a unary operator, or an operand (that is, an identifier or a literal). It may end only with a right parenthesis or an operand. An arithmetic expression must contain at least one reference to an identifier or a literal. If the first operator in an arithmetic expression is a unary operator, it must be immediately preceded by a left parenthesis if that arithmetic expression immediately follows an identifier or another arithmetic expression. ═══ 1.196. INVALID KEY Condition ═══ The invalid key condition can occur during execution of a DELETE, READ, REWRITE, START, or WRITE statement. When an invalid key condition occurs, the input-output statement that caused the condition is unsuccessful. When the invalid key condition is recognized, actions are taken in the following order: 1. If the FILE STATUS clause is specified in the FILE-CONTROL entry, a value is placed into the status key to indicate an INVALID KEY condition. 2. If the INVALID KEY phrase is specified in the statement causing the condition, control is transferred to the INVALID KEY imperative-statement. Any EXCEPTION/ERROR declarative procedure specified for this file is not executed. Execution then continues according to the rules for each statement specified in the imperative-statement. 3. If the INVALID KEY phrase is not specified in the input-output statement for a file and an EXCEPTION/ERROR procedure is specified, the EXCEPTION/ERROR procedure is executed. The NOT INVALID KEY phrase, if specified, is ignored. Both the INVALID KEY phrase and the EXCEPTION/ERROR procedure may be omitted. If the invalid key condition does not exist after execution of the input-output operation, the INVALID KEY phrase, if specified, is ignored, and the following actions are taken: 1. If an exception condition which is not an invalid key condition exists, control is transferred according to the rules of the USE statement following the execution of any USE AFTER EXCEPTION procedure. 2. If no exception condition exists, control is transferred to the end of the input-output statement or the imperative statement specified in the NOT INVALID KEY phrase, if specified. ═══ 1.197. program-name ═══  The program-name is a user-defined word that identifies your program. The system uses the first 8 characters of the program-name of the outermost program as the identifying name of the program.  The first 8 characters of the program-name of the outermost program should be unique within the system. The first character must be alphabetic. If the first character is not alphabetic, it is converted as follows: - 1 through 9 are changed to A through I. - Anything else is changed to J.  If you use a hyphen in characters 2 through 8 of the program-name of the outermost program, the hyphen is changed to zero (0).  For programs that are contained within another program, program-name can be any valid user-defined COBOL word, up to 30 characters long. The first 8 characters need not be unique, and they will not be converted as described above. Lowercase letters are valid, but they will be folded to uppercase.  Program-name may be a nonnumeric literal, other than a figurative constant. The content of the literal must follow the rules for formation of program names. Any lowercase characters in this literal will be folded to uppercase. In the outermost program, the literal can contain the extension characters $, #, and @. ═══ 1.198. ROUNDED Phrase ═══ The ROUNDED phrase prevents truncation when the size of the fractional result of an arithmetic operation exceeds the number of places provided for its storage. The ROUNDED phrase causes the least significant digit of the resultant identifier to be increased by 1 whenever the most significant digit of the excess is greater than or equal to 5. When the resultant identifier is described by a PICTURE clause containing rightmost P's, and when the number of places in the calculated result exceeds the number of integer positions specified, rounding or truncation occurs, relative to the rightmost integer position for which storage is allocated. In a floating-point arithmetic operation, the ROUNDED phrase has no effect; the result of a floating-point operation is always rounded. For more information on floating-point arithmetic expressions, see the COBOL/370 Programming Guide. ═══ 1.199. SIZE ERROR/NOT SIZE ERROR ═══ A SIZE ERROR condition can occur in three different ways: 1. When the absolute value of the result of an arithmetic evaluation, after decimal point alignment, exceeds the largest value that can be contained in the result field 2. When division by zero occurs 3. In an exponential expression, when:  Zero is raised to zero power. (If a SIZE ERROR clause is present, the SIZE ERROR imperative statement is executed. If a SIZE ERROR clause is not present, the value returned is 1 and a message is issued.)  Zero is raised to a negative number. (If a SIZE ERROR clause is present, the SIZE ERROR imperative statement is executed. If a SIZE ERROR clause is not present, the program is terminated abnormally.)  A negative number is raised to a fractional power. (If a SIZE ERROR clause is present, the SIZE ERROR imperative statement is executed. If a SIZE ERROR clause is not present, the absolute value of the base is used, and a message is issued.) The size error condition applies only to final results, not to intermediate results. If the resultant identifier is defined with USAGE IS BINARY, COMPUTATIONAL, or COMPUTATIONAL-4, the largest value that can be contained in it is the maximum value implied by its associated decimal PICTURE character-string. When a size error occurs, the subsequent action of the program depends on whether or not the ON SIZE ERROR phrase is specified. If you do specify the ON SIZE ERROR phrase and a size error condition occurs, the value of the resultant identifier affected by the size error is not altered---that is, the error results are not placed in the receiving identifier. After completion of the execution of the arithmetic operation, the imperative statement in the ON SIZE ERROR phrase is executed, control is transferred to the end of the arithmetic statement, and the NOT ON SIZE ERROR phrase, if specified, is ignored. If you do not specify the ON SIZE ERROR phrase and a size error condition occurs, truncation rules apply, and the value of the affected resultant identifier is computed. If you specify the NOT ON SIZE ERROR phrase and, after execution of an arithmetic operation, a size error condition does not exist, the NOT ON SIZE ERROR phrase is executed. When you specify both the ON SIZE ERROR and NOT ON SIZE ERROR phrases, and the statement in the phrase that is executed does not contain any explicit transfer of control, then, if necessary, an implicit transfer of control is made after execution of the phrase to the end of the arithmetic statement. For ADD CORRESPONDING and SUBTRACT CORRESPONDING statements, if an individual arithmetic operation causes a size error condition, the ON SIZE ERROR imperative statement is not executed until all the individual additions or subtractions have been completed. ═══ 1.200. ADVANCING Menu ═══ Select which occurrence of ADVANCING you want to display:  DISPLAY Statement  Write Statement Format 1 (QSAM Sequential Files) ═══ 1.201. AFTER Menu ═══ Select which occurrence of AFTER you want to display:  USE AFTER EXCEPTION/ERROR PROCEDURE (USE Compiler-Directing Statement)  USE AFTER LABEL PROCEDURE (USE Compiler-Directing Statement)  INSPECT Statement  PERFORM Statement Format 3 (PERFORM with UNTIL)  PERFORM Statement Format 4 (PERFORM with VARYING) ═══ 1.202. ASCENDING/DESCENDING Menu ═══ Select which occurrence of ASCENDING/DESCENDING you want to display:  ASCENDING/DESCENDING KEY Phrase (OCCURS Clause)  ASCENDING/DESCENDING KEY Phrase (MERGE Statement)  ASCENDING/DESCENDING KEY Phrase (SORT Statement) ═══ 1.203. BEFORE Menu ═══ Select which occurrence of BEFORE you want to display:  INSPECT Statement  PERFORM Statement Format 3 (PERFORM with UNTIL)  PERFORM Statement Format 4 (PERFORM with VARYING) ═══ 1.204. CHARACTERS Menu ═══ Select which occurrence of CHARACTERS you want to display:  BLOCK CONTAINS Clause (Sequential Files)  BLOCK CONTAINS Clause (Relative/Indexed Files)  INSPECT Statement (with TALLYING Phrase)  INSPECT Statement (with REPLACING Phrase)  INSPECT Statement (with TALLYING and REPLACING Phrases)  RECORD Clause  SYMBOLIC CHARACTERS Clause (SPECIAL-NAMES Paragraph) ═══ 1.205. COLLATING Menu ═══ Select which occurrence of COLLATING you want to display:  PROGRAM COLLATING SEQUENCE Clause (OBJECT-COMPUTER Paragraph)  COLLATING SEQUENCE Phrase (MERGE Statement)  COLLATING SEQUENCE Phrase (SORT Statement) ═══ 1.206. DATA Menu ═══ Select which occurrence of DATA you want to display:  DATA Compiler Option  Data Division  DATA RECORDS Clause (Sequential Files)  DATA RECORDS Clause (Relative/Indexed Files)  DATA RECORDS Clause (Sort/Merge Files) ═══ 1.207. DEBUGGING Menu ═══ Select which occurrence of DEBUGGING you want to display:  DEBUGGING Declarative  DEBUGGING MODE Clause (SOURCE-COMPUTER Paragraph) ═══ 1.208. DELETE Menu ═══ Select which occurrence of DELETE you want to display:  DELETE Compiler-Directing Statement  DELETE Statement ═══ 1.209. DEPENDING Menu ═══ Select which occurrence of DEPENDING you want to display:  Conditional GO TO Statement  OCCURS DEPENDING ON Clause (Variable-Length Tables)  RECORD Clause Format 3 ═══ 1.210. DISPLAY Menu ═══ Select which occurrence of DISPLAY you want to view:  USAGE IS DISPLAY (USAGE Clause)  DISPLAY Statement ═══ 1.211. DIVISION Menu ═══ Select which occurrence of DIVISION you want to display:  Data Division  Environment Division  Identification Division  Procedure Division ═══ 1.212. ENTRY Menu ═══ Select which occurrence of ENTRY you want to display:  ENTRY Statement  SET Statement Format 6 (SET for USAGE IS PROCEDURE-POINTER data items) ═══ 1.213. EXCEPTION Menu ═══ Select which occurrence of EXCEPTION you want to display:  CALL Statement Format 2 (CALL ON EXCEPTION)  USE AFTER EXCEPTION/ERROR PROCEDURE (USE Compiler-Directing Statement) ═══ 1.214. EXIT Menu ═══ Select which occurrence of EXIT you want to display:  EXIT Statement  EXIT PROGRAM Statement ═══ 1.215. EXTERNAL Menu ═══ Select which occurrence of EXTERNAL you want to display:  EXTERNAL Clause (Data Description Entry)  EXTERNAL Clause (File Description Entry, Sequential Files)  EXTERNAL Clause (File Description Entry, Relative/Indexed Files) ═══ 1.216. FILE Menu ═══ Select which occurrence of FILE you want to display:  FILE SECTION  FILE-CONTROL Paragraph  MULTIPLE FILE TAPE Clause (I-O-CONTROL Paragraph, QSAM Files)  USE AFTER BEGINNING/ENDING FILE LABEL PROCEDURE (USE Compiler-Directing Statement) ═══ 1.217. GLOBAL Menu ═══ Select which occurrence of GLOBAL you want to display:  GLOBAL Clause (Data Description Entry)  GLOBAL Clause (File Description Entry, Sequential Files)  GLOBAL Clause (File Description Entry, Relative/Indexed Files)  EXCEPTION/ERROR Declarative ═══ 1.218. INDEXED Menu ═══ Select which occurrence of INDEXED you want to display:  INDEXED BY Phrase (OCCURS Clause)  ORGANIZATION IS INDEXED Clause (VSAM Indexed File Entries) ═══ 1.219. INVALID Menu ═══ Select which occurrence of INVALID you want to display:  INVALID KEY Phrase (DELETE Statement)  INVALID KEY Phrase (READ Statement, Random Access Mode)  INVALID KEY Phrase (REWRITE Statement)  INVALID KEY Phrase (START Statement)  INVALID KEY Phrase (WRITE Statement, QSAM Sequential Files)  INVALID KEY Phrase (WRITE Statement, VSAM Indexed Files)  INVALID KEY Phrase (WRITE Statement, VSAM Relative Files) ═══ 1.220. KEY Menu ═══ Select which occurrence of KEY you want to display:  ALTERNATE RECORD KEY Clause (VSAM Indexed File Entry)  ASCENDING/DESCENDING KEY Phrase (OCCURS Clause)  ASCENDING/DESCENDING KEY Phrase (MERGE Statement)  ASCENDING/DESCENDING KEY Phrase (SORT Statement)  INVALID KEY Phrase (DELETE Statement)  INVALID KEY Phrase (READ Statement, Random Access Mode)  INVALID KEY Phrase (REWRITE Statement)  INVALID KEY Phrase (START Statement)  INVALID KEY Phrase (WRITE Statement, QSAM Sequential Files)  INVALID KEY Phrase (WRITE Statement, VSAM Indexed Files)  INVALID KEY Phrase (WRITE Statement, VSAM Relative Files)  RECORD KEY Clause (VSAM Indexed File Entry)  RELATIVE KEY Clause (VSAM Relative File Entry) ═══ 1.221. LABEL Menu ═══ Select which occurrence of LABEL you want to display:  LABEL Declarative  LABEL RECORDS Clause (Sequential Files)  LABEL RECORDS Clause (Relative/Indexed Files)  SERVICE LABEL Compiler-Directing Statement ═══ 1.222. ORGANIZATION Menu ═══ Select which occurrence of ORGANIZATION you want to display:  ORGANIZATION IS INDEXED (VSAM Indexed File Entries)  ORGANIZATION IS RELATIVE (VSAM Relative File Entries)  ORGANIZATION IS SEQUENTIAL (QSAM and VSAM Sequential File Entries) ═══ 1.223. PROCEDURE Menu ═══ Select which occurrence of PROCEDURE you want to display:  Procedure Division  USE Compiler-Directing Statement  MERGE Statement  SORT Statement ═══ 1.224. PROGRAM Menu ═══ Select which occurrence of PROGRAM you want to display:  EXIT PROGRAM Statement  PROGRAM COLLATING SEQUENCE Clause (OBJECT-COMPUTER Paragraph) ═══ 1.225. RANDOM Menu ═══ Select which occurrence of RANDOM you want to display:  ACCESS IS RANDOM (VSAM Indexed File Entries)  ACCESS IS RANDOM (VSAM Relative File Entries)  RANDOM Function ═══ 1.226. RECORD Menu ═══ Select which occurrence of RECORD you want to display:  ALTERNATE RECORD KEY Clause (VSAM Indexed File Entries)  RECORD Clause  RECORD DELIMITER Clause (QSAM and VSAM Sequential Files)  RECORD KEY Clause (VSAM Indexed File Entries)  SAME RECORD AREA Clause (QSAM Files)  SAME RECORD AREA Clause (VSAM Files)  SAME RECORD AREA Clause (Sort/Merge Files)  DELETE Statement  READ Statement  RETURN Statement ═══ 1.227. RECORDS Menu ═══ Select which occurrence of RECORDS you want to display:  BLOCK CONTAINS Clause (Sequential Files)  BLOCK CONTAINS Clause (Relative/Indexed Files)  DATA RECORDS Clause (Sequential Files)  DATA RECORDS Clause (Relative/Indexed Files)  DATA RECORDS Clause (Sort/Merge Files)  LABEL RECORDS Clause (Sequential Files)  LABEL RECORDS Clause (Relative/Indexed Files) ═══ 1.228. REPLACING Menu ═══ Select which occurrence of REPLACING you want to display:  COPY Compiler-Directing Statement  INITIALIZE Statement  INSPECT Statement ═══ 1.229. SAME Menu ═══ Select which occurrence of SAME you want to display:  SAME AREA Clause (QSAM Files)  SAME AREA Clause (VSAM Files)  SAME AREA Clause (Sort/Merge Files)  SAME RECORD AREA Clause (QSAM Files)  SAME RECORD AREA Clause (VSAM Files)  SAME RECORD AREA Clause (Sort/Merge Files)  SAME SORT AREA Clause  SAME SORT-MERGE AREA Clause ═══ 1.230. SECTION Menu ═══ Select which occurrence of SECTION you want to display:  Configuration Section  File Section  Input-Output Section  Linkage Section  Working-Storage Section  Procedure Division Format 1 ═══ 1.231. SEQUENTIAL Menu ═══ Select which occurrence of SEQUENTIAL you want to display:  ACCESS IS SEQUENTIAL (QSAM and VSAM Sequential File Entries)  ACCESS IS SEQUENTIAL (VSAM Indexed File Entries)  ACCESS IS SEQUENTIAL (VSAM Relative File Entries)  ORGANIZATION IS SEQUENTIAL (QSAM and VSAM Sequential File Entries) ═══ 1.232. SERVICE Menu ═══ Select which occurrence of SERVICE you want to display:  SERVICE LABEL Compiler-Directing Statement  SERVICE RELOAD Compiler-Directing Statement ═══ 1.233. SORT Menu ═══ Select which occurrence of SORT you want to display:  SAME SORT AREA Clause (I-O-CONTROL Paragraph, Format 3)  SORT Statement ═══ 1.234. THROUGH/THRU Menu ═══ Select which occurrence of THROUGH or THRU you want to display:  ALPHABET Clause (SPECIAL-NAMES Paragraph)  RENAMES Clause  Condition-Name VALUE Clause  EVALUATE Statement  MERGE Statement  PERFORM Statement  SORT Statement ═══ 1.235. USING Menu ═══ Select which occurrence of USING you want to display:  USING Phrase (Procedure Division Header)  CALL Statement  ENTRY Statement  MERGE Statement  SORT Statement ═══ 1.236. VALUE Menu ═══ Select which occurrence of VALUE you want to display:  VALUE Clause  VALUE OF Clause (Sequential Files)  VALUE OF Clause (Relative/Indexed Files) ═══ 1.237. No Help Available ═══ Help is not directly available from this language element. You can either:  Press Alt+F4 to return to your edit session, and select a related major keyword, such as a statement keyword or clause keyword, or  Select "Help" from the action bar and then select "Help index" to get a list of COBOL topics. ═══ ═══ An end program header separates each program in the sequence of programs. Program-name-1 must conform to the rules for forming a user-defined word. It must be identical to a program-name declared in a preceding PROGRAM-ID paragraph. Program-name-1 may be a nonnumeric literal but may not be a figurative constant. The content of the literal must follow the rules for formation of a program name. Any lowercase characters in this literal will be folded to uppercase. An end program header is optional for the last program in the sequence only if that program does not contain any nested source programs. ═══ ═══ The PROGRAM-ID paragraph specifies the name by which the program is known and assigns selected program attributes to that program. It is required and must be the first paragraph in the Identification Division. ═══ ═══ COMMON specifies that the program-name is contained within another program, and it can be called from siblings of the common program and programs contained within them. The COMMON clause may be used only if program-name is contained within another program. ═══ ═══ INITIAL specifies that when program-name is called, program-name and any programs contained within it are placed in their initial state. ═══ ═══ Use AUTHOR to specify the name of the author of the program. ═══ ═══ Use INSTALLATION to specify the name of the company or location. ═══ ═══ Use DATE-WRITTEN to specify the date that the program was written. ═══ ═══  Use DATE-COMPILED to specify the date that the program was compiled.  The paragraph name DATE-COMPILED and any comment-entry associated with it appear in the output program listing with the current date inserted: DATE-COMPILED. 06/21/92. ═══ ═══ Use SECURITY to specify the level of confidentiality of the program. ═══ ═══  The comment-entry in any of the optional paragraphs may be any combination of characters from the character set of the computer. The comment-entry should be written in Area B on one or more lines.  Comment-entries serve only as documentation; they do not affect the meaning of the program. A hyphen in the indicator area (column 7) is not permitted in comment-entries.  Comment-entries in the Identification Division may have DBCS strings. A DBCS string must be preceded by a shift-out control character and followed by a shift-in control character.  Multiple lines are allowed in a comment-entry containing DBCS strings; however, shift-out and shift-in characters must be paired on a line. ═══ ═══ Computer-name represents a system-name. For example: IBM-370. ═══ ═══ Computer-name represents a system-name. For example: IBM-370. ═══ ═══ MEMORY SIZE is the amount of storage needed to execute the object program. The MEMORY SIZE clause is syntax-checked, but has no effect on the execution of the program. ═══ ═══ You can express integer in words, characters, or modules. ═══ ═══ Alphabet-name represents the collating sequence. ═══ ═══ The priority-number is an integer ranging from 1 through 49. ═══ ═══ Environment-name-2 is a 1-byte User Programmable Status Indicator (UPSI) switch. Valid specifications for environment-name-2 are UPSI-O through UPSI-7. Mnemonic-names and environment-names do not need to be unique. If you choose a mnemonic-name that is also an environment-name, its definition as a mnemonic-name will take precedence over its definition as an environment-name. ═══ ═══ Mnemonic-name-1 and mnemonic-name-2 follow the rules of formation for user-defined names. You can use mnemonic-name-1 in ACCEPT, DISPLAY, and WRITE statements. You can use mnemonic-name-2 only in the SET statement. Mnemonic-name-2 can be used to qualify cond-1 or cond-2 names. Mnemonic-names and environment-names do not need to be unique. If you choose a mnemonic-name that is also an environment-name, its definition as a mnemonic-name will take precedence over its definition as an environment-name. ═══ ═══ When you specify ON STATUS IS or OFF STATUS IS, UPSI switches process special conditions within a program, such as year-beginning or year-ending processing. For example, at the beginning of the Procedure Division, an UPSI switch can be tested; if it is ON, the special branch is taken. ═══ ═══ You can specify assignment-name-1 as a user-defined word or a nonnumeric literal. Any assignment-name after the first is syntax-checked, but has no effect on the execution of the program. ═══ ═══ STANDARD-1 specifies the ASCII character set. ═══ ═══ STANDARD-2 specifies the International Reference Version of the ISO 7-bit code defined in the International Standard 646, 7-bit Coded Character Set for Information Processing Interchange. ═══ ═══ NATIVE specifies the native character code set. If you omit the alphabet-name clause, EBCDIC is assumed. ═══ ═══ EBCDIC specifies the EBCDIC character set. ═══ ═══  When you specify the ALSO phrase and alphabet-name-1 is referenced in a SYMBOLIC CHARACTERS clause, only literal-1 is used to represent the character in the EBCDIC set.  When you specify the ALSO phrase, EBCDIC characters specified as literal-1, literal-3, etc., are assigned to the same position in this collating sequence.  Each nonnumeric literal associated with a THROUGH or ALSO phrase must be 1 character in length. ═══ ═══ CLASS class-name-1 IS provides a means for relating a name to the specified set of characters listed in that clause. Class-name can be referenced only in a class condition. The characters specified by the values of the literals in this clause define the exclusive set of characters of which this class-name consists. ═══ ═══ When you specify the THROUGH phrase, the contiguous characters in the native character set beginning with the character specified by literal-1 and ending with the character specified by literal-2 are assigned successively ascending positions in this collating sequence. This sequence may be either ascending or descending within the original native character set. ═══ ═══ The CURRENCY SIGN IS clause specifies the currency symbol to be used in the PICTURE clause. This clause overrides the currency option. When you omit the CURRENCY SIGN clause and the NOCURRENCY option is in effect, you can use only the dollar sign ($) as the PICTURE symbol for the currency sign. ═══ ═══ DECIMAL-POINT IS COMMA exchanges the functions of the period and the comma in PICTURE character strings and in numeric literals. ═══ ═══ The SELECT clause chooses a file in the COBOL program to be associated with an external data set. When file-name-1 specifies a sort or a merge file, only the ASSIGN clause may follow the SELECT clause. ═══ ═══ You may specify SELECT OPTIONAL only for files opened in the input, I-O, or extend mode. You must specify SELECT OPTIONAL for those input files that are not necessarily present each time the object program is executed. For more information, see the COBOL/370 Programming Guide. If the file connector referenced by file-name-1 is an external file connector, all file control entries in the run unit that references this file connector must have the same specification for the OPTIONAL phrase. ═══ ═══ File-name-1 must be an FD or SD entry in the Data Division. File-name-1 must conform to the rules for a COBOL user-defined name, must contain at least one alphabetic character, and must be unique within this program. When file-name-1 specifies a sort or a merge file, only the ASSIGN clause may follow the SELECT clause. ═══ ═══ Label- documents the device and device class to which a file is assigned. If you specify label-, it must end with a hyphen. ═══ ═══ For QSAM files, you can omit the S- (organization) field. ═══ ═══ For VSAM sequential files, you must specify the AS- (organization) field. For VSAM indexed and relative files, you must omit the organization field. ═══ ═══  The RESERVE clause allows you to specify the number of input/output buffers to be allocated at run-time for your files.  If you are running your COBOL program under MVS and you omit the RESERVE clause, the number of buffers at run time is taken from the DD statement. If you do not specify a DD statement, the system default is taken.  If the file connector referenced by file-name-1 in the SELECT clause is an external file connector, all file control entries in the run unit that references this file connector must have the same value for the integer specified in the RESERVE clause. ═══ ═══ The ORGANIZATION clause identifies the logical structure of the file. The logical structure is established at the time the file is created and cannot subsequently be changed. If you omit the ORGANIZATION clause, the compiler assumes ORGANIZATION IS SEQUENTIAL. If the file connector referenced by file-name-1 in the SELECT clause is an external file connector, all file control entries in the run unit that references this file connector must have the same organization. ═══ ═══ The ORGANIZATION IS SEQUENTIAL clause establishes a predecessor-successor relationship among the records in the file. It does this by the order in which records are placed in the file when the file is created or extended. If the file connector referenced by file-name-1 in the SELECT clause is an external file connector, all file control entries in the run unit that references this file connector must have the same organization. ═══ ═══ When you specify the ORGANIZATION IS INDEXED clause, the position of each logical record in the file is determined by indexes created with the file and maintained by the system. The indexes are based on embedded keys within the file's records. ═══ ═══ When you specify the ORGANIZATION IS RELATIVE clause, the position of each logical record in the file is determined by its relative record number. ═══ ═══ The PADDING CHARACTER clause specifies the character to be used for block padding on sequential files. The PADDING CHARACTER clause is syntax-checked, but no compile-time or run-time verification is done, and the clause has no effect on the execution of the program. ═══ ═══ You must define data-name-5 in the Data Division as an alphanumeric one-character data item. Do not define data-name-5 in the File Section. Data-name-5 can be qualified. If you specify data-name-5 for EXTERNAL files, it must reference an external data item. ═══ ═══ Literal-1 must be a 1-character nonnumeric literal. ═══ ═══ Assignment-name-2 may be any COBOL word. ═══ ═══ The RECORD DELIMITER clause indicates the method of determining the length of a variable-length record on an external medium. Specify RECORD DELIMITER only for variable-length records. The RECORD DELIMITER clause is syntax-checked, but no compile-time or run-time verification is done, and the clause has no effect on the execution of the program. ═══ ═══ If you specify STANDARD-1, the external medium must be a magnetic tape file. ═══ ═══ The ACCESS MODE clause defines the manner in which the records of the file are made available for processing. If you do not specify the ACCESS MODE clause, sequential access is assumed. ═══ ═══  You can specify ACCESS MODE IS SEQUENTIAL in all three formats.  For sequentially accessed VSAM relative files, the ACCESS MODE clause does not have to precede the RELATIVE KEY clause.  Sequential-Access Mode allows the reading and writing of records in a serial manner; the order of reference is determined implicitly by the position of a record in the file. In Format 3 (VSAM Relative File Entries), file records are accessed in the ascending sequence of relative record numbers of existing file records. ═══ ═══  You can specify ACCESS MODE IS SEQUENTIAL in all three formats.  Sequential-Access Mode allows the reading and writing of records in a serial manner; the order of reference is determined implicitly by the position of a record in the file.  In Format 1 (QSAM and VSAM Sequential File Entries), records in the file are accessed in the sequence established when the file is created or extended. Format 1 supports only sequential access. ═══ ═══  You can specify ACCESS MODE IS SEQUENTIAL in all three formats.  Sequential-Access Mode allows the reading and writing of records in a serial manner; the order of reference is determined implicitly by the position of a record in the file.  In Format 2 (VSAM File Indexed Entries), records in the files are accessed in the ascending record key values according to the collating sequence of the file. ═══ ═══  You can specify ACCESS MODE IS RANDOM in Formats 2 and 3 only.  In Format 2 (VSAM File Indexed Entries), the value placed in a record key data item specifies the record to be accessed.  Random-Access Mode allows the reading and writing of records in a programmer-specified manner; the control of successive references to the file is expressed by specifically defined, user-supplied keys. ═══ ═══  You can specify ACCESS MODE IS RANDOM in Formats 2 and 3 only.  Random-Access Mode allows the reading and writing of records in a programmer-specified manner; the control of successive references to the file is expressed by specifically defined, user-supplied keys.  In Format 3 (VSAM Relative File Entries), the value placed in a relative key data item specifies the record to be accessed. ═══ ═══  You can specify the ACCESS MODE IS DYNAMIC clause in Formats 2 and 3 only.  Dynamic-Access Mode allows a specific input-output to determine the access mode. Therefore, records may be processed sequentially and/or randomly.  In Format 2 (VSAM Indexed File Entries), records in the file may be accessed sequentially or randomly, depending on the form of the specific input-output request. ═══ ═══  You can specify the ACCESS MODE IS DYNAMIC clause in Formats 2 and 3 only.  Dynamic-Access Mode allows a specific input-output to determine the access mode. Therefore, records may be processed sequentially and/or randomly.  In Format 3 (VSAM Relative File Entries), records in the file may be accessed sequentially or randomly, depending on the form of the specific input-output request. ═══ ═══ When you specify the RELATIVE clause, records in the file are accessed in the ascending sequence of relative record numbers of existing records in the file. ═══ ═══ The RECORD KEY clause specifies the data item within the record that is the prime RECORD KEY for an indexed file. The values contained in the prime RECORD KEY data item must be unique among records in the file. ═══ ═══ The ALTERNATE RECORD KEY clause specifies a data item within the record that provides an alternative path to the data in an indexed file. Note: If you specify the PASSWORD clause for indexed files, it must immediately follow the RECORD KEY or ALTERNATE RECORD KEY data-name with which it is associated. ═══ ═══ Data-name-3 represents an ALTERNATE RECORD KEY data item. It must be described as an alphanumeric item within a record description entry associated with the file. It must not reference a group item that contains a variable occurrence data item. Data-name-3 may be qualified. Data-name-3 may be a numeric, numeric-edited, alphanumeric-edited, alphabetic, internal or external floating-point, or DBCS data item. The key is treated as an alphanumeric item for the input and output statements for the file named in the SELECT clause. ═══ ═══ The format 3 RELATIVE KEY clause identifies a data-name that specifies the relative record number for a specific logical record within a relative file. ═══ ═══ Define data-name-4 as an unsigned integer data item whose description does not contain the PICTURE symbol P. Do not define data-name-4 in a record description entry associated with this relative file. That is, the RELATIVE KEY is not a part of the record. Data-name-4 may be qualified. ═══ ═══ The PASSWORD clause controls access to files. It is not valid for QSAM sequential files. ═══ ═══ Data-name-6 and data-name-7 are password data items. Define each in the Working-Storage Section of the Data Division as an alphanumeric item. The first 8 characters are used as the password; a shorter field is padded with blanks to 8 characters. Each password data item must be equivalent to one that is externally defined. For EXTERNAL files, data-name-6 and data-name-7 must reference external data items. The PASSWORD clauses in each associated file control entry must reference the same external data items. ═══ ═══ Data-name-6 is a password data item. Define it in the Working-Storage Section of the Data Division as an alphanumeric item. The first 8 characters are used as the password; a shorter field is padded with blanks to 8 characters. Each password data item must be equivalent to one that is externally defined. ═══ ═══ The PASSWORD clause controls access to files. Note: For indexed files, if you specify the PASSWORD clause, it must immediately follow the RECORD KEY or ALTERNATE RECORD KEY data-name with which it is associated. In the ALTERNATE RECORD KEY clause, the key word RECORD is optional. ═══ ═══ The FILE STATUS clause monitors the execution of each input-output operation on the file. When you specify the FILE STATUS clause, the system moves a value into the status key data item after each input-output request that explicitly or implicitly refers to this file. The value indicates the status of execution of the statement. ═══ ═══  You can define the status key data item in the Data Division as either of the following: - A 2-character alphanumeric item. - A 2-character numeric data item, with explicit or implicit USAGE IS DISPLAY. It is treated as an alphanumeric item.  You cannot define data-name-1 in the File Section, but data-name-1 may be qualified.  The status key data item must not be variably located; that is, the data item cannot follow a data item containing an OCCURS DEPENDING ON clause. Note: Data-name-1 must not contain the picture symbol 'P'. ═══ ═══  The RERUN clause specifies that checkpoint records are to be taken. Subject to the restrictions given with each phrase, you can specify more than one RERUN clause.  Do not use the RERUN clause with files that have been defined with the EXTERNAL attribute.  The file named in the RERUN clause must be a file defined in the same program as I-O-CONTROL paragraph, even if the file is defined as GLOBAL. ═══ ═══ The MULTIPLE FILE TAPE clause specifies that two or more files share the same physical reel of tape. This clause is syntax-checked, but has no effect on the execution of the program. The function is performed by the system through the LABEL parameter of the DD statement. ═══ ═══ File-name-1 must be a sequentially organized file. ═══ ═══ Assignment-name-1 represents the external data set for the checkpoint file. It must not be the same assignment-name as that specified in any ASSIGN clause throughout the entire program, including contained and containing programs. ═══ ═══  A checkpoint record is to be written for every integer-1 record in file-name-1 that is processed.  When you specify multiple integer-1 RECORDS phrases, no two of them may specify the same file-name-1.  When you specify the integer-1 RECORDS, you must give assignment-name-1 in the RERUN clause. ═══ ═══  EVERY END OF REEL/UNIT is a checkpoint record to be written whenever end-of volume for file-name-1 occurs. The terms REEL and UNIT are interchangeable.  When you specify multiple END OF REEL/UNIT phrases, no two of them may specify the same file-name-1.  Use the END OF REEL/UNIT phrase only if file-name-1 is a sequentially organized file. ═══ ═══ The SAME AREA clause specifies that two or more files, that do not represent sort or merge files, are to use the same main storage area during processing. The files named in a SAME AREA clause need not have the same organization or access. ═══ ═══ You must specify file-name-3 and file-name-4 in the FILE-CONTROL paragraph of the same program. File-name-3 and file-name-4 must not reference an external file connector. ═══ ═══ You must specify file-name-3 and file-name-4 in the FILE-CONTROL paragraph of the same program. File-name-3 and file-name-4 may not reference an external file connector. ═══ ═══ The SAME SORT AREA clause is syntax-checked, but has no effect on the execution of the program. When you specify the SAME SORT AREA clause, at least one file-name specified must name a sort file. You can also specify files that are not sort files. ═══ ═══ The SAME SORT-MERGE AREA clause is equivalent to the SAME SORT AREA clause. The SAME SORT-MERGE AREA clause is syntax-checked, but has no effect on the execution of the program. When you specify the SAME SORT-MERGE AREA, at least one file-name specified must name a sort file. ═══ ═══ Format 1 MULTIPLE TAPE clause specifies that two or more files share the same physical reel of tape. This clause is syntax-checked, but has no effect on the execution of the program. The function is performed by the system through the LABEL parameter of the DD statement. ═══ ═══ The APPLY WRITE-ONLY is effective only for QSAM files. It optimizes buffer and device space allocation for files that have standard sequential organization, have variable length records, and are blocked. If you specify this phrase, the buffer is truncated only when the space available on the buffer is smaller that the size of the next record. Otherwise, the buffer is truncated when the space remaining in the buffer is smaller than the maximum record size for the file. ═══ ═══ When you specify file-name-2, each file must have standard sequential organization and must be opened for output. ═══ ═══ File-name-1 must be a sequentially organized file. ═══ ═══ A file description entry represents the highest level of organization in the File Section. It provides information about the physical structure and identification of a file, and gives the record names associated with that file. ═══ ═══  A record description entry is a data description entry (here used to refer to both data and record description entries) that specifies the characteristics of a data item.  In the File Section, a record description entry is a set of data description entries that describe the particular records contained within a file.  You can specify more than one record description entry; each is an alternative description of the same record storage area.  Data areas described in the File Section are not available for processing unless the file containing the data area is open. ═══ ═══  A record description entry is a data description entry (here used to refer to both data and record description entries) that specifies the characteristics of a data item.  Data entries in the Working-Storage Section that bear a definite hierarchic relationship to one another must be grouped into records structured by level number. ═══ ═══  A data item description entry is a data description entry (here used to refer to both data and record description entries) that specifies the characteristics of a data item.  Data item description entries are independent items in the Working-Storage Section that bear no hierarchic relationship to one another and need not be grouped into records, provided that they do not need to be further subdivided. Instead, they are classified and defined as independent elementary items. Each is defined in a separate data item description entry that begins with either the level number 77 or 01. ═══ ═══  A record description entry is a data description entry (here used to refer to both data and record description entries) that specifies the characteristics of a data item.  Record description entries and data item description entries in the Linkage Section provide names and descriptions, but storage within the program is not reserved because the data area exists elsewhere. You can use any data description clause to describe items in the Linkage Section with the following exceptions: - The VALUE clause may not be specified for items other than level-88 items. - The EXTERNAL clause may not be specified. - The GLOBAL clause may be specified as an IBM extension. ═══ ═══  A data-item-description entry is a data description entry (here used to refer to both data and record description entries) that specifies the characteristics of a data item.  Record description entries and data item description entries in the Linkage Section provide names and descriptions, but storage within the program is not reserved because the data area exists elsewhere. You can use any data description clause to describe items in the Linkage Section with the following exceptions: - The VALUE clause may not be specified for items other than level-88 items. - The EXTERNAL clause may not be specified. - The GLOBAL clause may be specified as an IBM extension. ═══ ═══ Data-name-1 identifies an alternative grouping of data items. You cannot use data-name-1 as a qualifier; it can be qualified only by the names of level indicator entries or level-01 entries. Data-name-1 may specify a DBCS item if data-name-2 specifies a DBCS item and the THROUGH phrase is not specified. ═══ ═══ Data-name explicitly identifies the data being described. If you specify a data-name, it identifies a data item used in the program. The data-name must be the first word following the level-number. ═══ ═══ FILLER is a data item that is not explicitly referred to in a program. If you specify FILLER (an optional key word), it must be the first word following the level-number. If you omit the data-name or the key word FILLER, the data item being described is treated as though FILLER had been specified. ═══ ═══ Integer-2 represents the exact number of occurrences. Integer-2 must be greater than zero. ═══ ═══ Data-name-2 must be the name of the subject entry, or the name of an entry subordinate to the subject entry. It may be qualified. If data-name-2 names the subject entry, that entire entry becomes ASCENDING/DESCENDING KEY, and is the only key that may be specified for this table element. If data-name-2 does not name the subject entry, then data-name-2:  Must be subordinate to the subject of the table entry itself  Must not be subordinate to, or follow, any other entry that contains an OCCURS clause  Must not contain an OCCURS clause. ═══ ═══ The INDEXED BY phrase specifies the indexes that can be used with this table. The INDEXED BY phrase is required if you use indexing to refer to this table element. ═══ ═══ Integer-1 represents the minimum number of occurrences. Integer-1 must be greater than or equal to zero and less than integer-2. ═══ ═══ Integer-2 represents the maximum number of occurrences. Integer-2 must be greater than integer-1. ═══ ═══ The OCCURS DEPENDING ON clause specifies variable-length tables. The object of the OCCURS DEPENDING ON clause must not occupy any storage position within the range of the table. The object cannot be variably located, nor can it follow an item that contains an OCCURS DEPENDING ON clause. ═══ ═══ Data-name-1 specifies the object of the OCCURS DEPENDING ON clause, that is, the data item whose current value represents the current number of occurrences of the subject item. Data-name-1 must describe an integer item. ═══ ═══ Data-name-1, FILLER identifies an alternate description for the same area and is the redefining item or the REDEFINES subject. ═══ ═══ Data-name-2 is the redefined item or the REDEFINES object. ═══ ═══ FILLER identifies an alternate description for the same area and is the redefining item or the REDEFINES subject. Specifying FILLER does not affect the execution of the program; the program executes as though nothing were specified. When you specify the REDEFINES clause, it must immediately follow data-name or FILLER, if either is specified. If you do not specify data-name or FILLER, the REDEFINES clause must immediately follow the level-number. ═══ ═══ Data-name-1 identifies an alternative grouping of data items. A level-66 entry cannot rename a level-01, level-77, level-88, or another level-66 entry. ═══ ═══ Data-name-2 and data-name-3 identify the original grouping of elementary data items; that is, they must name elementary or group items within the associated level-01 entry and must not be the same data-name. Both data-names may be qualified. The OCCURS clause must not be specified in the data entries for data-name-2 and data-name-3, or for any group entry to which they are subordinate. ═══ ═══ The LEFT phrase specifies that the elementary item is to be positioned so that it will begin at the left character position of the natural boundary in which the elementary item is placed. When specified, the LEFT phrase is syntax checked, but has no effect on the execution of the program. ═══ ═══ The RIGHT phrase specifies that the elementary item is to be positioned so that it will terminate at the right character position of the natural boundary in which it has been placed. When specified, the RIGHT phrase is syntax-checked, but has no effect on the execution of the program. ═══ ═══ Specify BINARY for binary data items. Such items have a decimal equivalent consisting of the decimal digits 0 through 9, plus a sign. Negative numbers are represented as the two's complement of the positive number with the same absolute value. ═══ ═══ Specify the PACKED-DECIMAL clause for internal decimal items. Such items appear in storage in packed decimal format. There are 2 digits for each character position, except for the trailing character position, which is occupied by the low-order digit and the sign. Such an item may contain any of the digits 0 through 9, plus a sign, representing a value not exceeding 18 decimal digits. ═══ ═══ Representation of the COMPUTATIONAL phrase is system-dependent and is normally assigned to representations that yield the greatest efficiency when arithmetic operations are performed on that system. For the COBOL/370 compiler, the COMPUTATIONAL phrase is synonymous to BINARY. ═══ ═══ Specify COMPUTATIONAL-1 or COMP-1 for internal floating-point items (single precision). COMP-1 items are 4 bytes long. The sign is contained in the first bit of the leftmost byte the exponent is contained in the remaining 7 bits. The last 3 bytes contain the mantissa. ═══ ═══ Specify COMPUTATIONAL-2 or COMP-2 for internal floating-point items (double precision). COMP-2 items are 8 bytes long. The sign is contained in the first bit of the leftmost byte and the remaining 7 bits contain the exponent. The remaining 7 bytes contain the mantissa. ═══ ═══ COMPUTATIONAL-3 or COMP-3 (internal decimal) is the equivalent of PACKED-DECIMAL. ═══ ═══ COMPUTATIONAL-4 or COMP-4 (binary) is the equivalent of BINARY. ═══ ═══ DISPLAY specifies that the data item is stored in character form, 1 character for each 8-bit byte. ═══ ═══ A data item defined with the INDEX phrase is an index data item. ═══ ═══ DISPLAY-1 defines an item as DBCS. ═══ ═══ A data item defined with the POINTER phrase is a pointer data item. A pointer data item is a 4-byte elementary item that may be used to accomplish limited base addressing. Pointer data items may be compared for equality or moved to other pointer data items. You may only use a pointer data item:  In the Procedure Division header  In the USING phrase of a CALL statement  In an ENTRY statement  In Format 5 of a SET statement  In a relation condition. The POINTER phrase may be specified for data items with any level number except level 88. ═══ ═══ A procedure-pointer is a pointer to an entry point. A data item defined with the USAGE IS PROCEDURE-POINTER clause contains the address of a procedure entry point and is a 4-byte elementary item. ═══ ═══ A condition-name is a user-specified name that associates a single value, multiple values, and/or range(s) of values with a conditional variable. A conditional variable is a data item that can assume one or more values that can in turn be associated with a condition-name. ═══ ═══ When you specify literal-1 alone, the condition-name is associated with a single value. ═══ ═══ When you specify THROUGH literal-2, the condition-name is associated with at least one range of values, and literal-1 must be less than literal-2. ═══ ═══ You can use the STANDARD clause for both mass storage devices and tape devices. For a STANDARD file, labels conforming to system specifications exist. ═══ ═══ You can use the OMITTED clause for tape devices. For an OMITTED file, no labels exist. ═══ ═══  The CODE-SET clause specifies the character code used to represent data on a magnetic tape file. When you specify the CODE-SET clause, an alphabet-name identifies the character code convention used to represent data on the input-output device.  When you specify the CODE-SET clause for a file, all data in this file must have USAGE DISPLAY, and, if signed numeric data is present, it must be described with the SIGN IS SEPARATE clause.  The CODE-SET clause is valid only for magnetic tape files. ═══ ═══ The EXTERNAL clause specifies that a file connector is external. The EXTERNAL clause also permits communication between two programs by sharing files. A file connector is external if the storage associated with that file is associated with the run unit rather than with any particular program within the run unit. Any program in the run unit that describes the file may reference an external file. References to an external file from different programs using separate descriptions of the file are always to the same file. In a run unit, there is only one representative external file. ═══ ═══ The GLOBAL clause specifies that the file connector named by a file-name is a global name. A global file-name is available to the program that declares it and to every program that is contained directly or indirectly in that program. ═══ ═══ The BLOCK CONTAINS clause specifies the size of the physical records. For EXTERNAL files, the value of all BLOCK CONTAINS clauses of corresponding EXTERNAL files must match within the run unit. This conformance is in terms of character positions and does not depend upon whether the value was specified as CHARACTERS or as RECORDS. ═══ ═══ Integer-1, integer-2 must be nonzero unsigned integers. They specify the number CHARACTERS or RECORDS. (CHARACTERS specifies the number of character positions required to store the physical record, no matter what USAGE the characters have within the data record.) If you specify integer-2 only, integer-2 specifies the exact character size of the physical record. When you specify both integer-1 and integer-2, they represent, respectively, the minimum and maximum character sizes of the physical record. ═══ ═══ The RECORDS clause specifies the number of logical records contained in each physical record. ═══ ═══ Format 1 of the RECORD CONTAINS clause specifies the number of character positions for fixed-length records. Integer-3 must be an unsigned integer that specifies the number of character positions contained in each record in the file. ═══ ═══ Format 2 of the RECORD CONTAINS clause specifies the number of character positions for either fixed- or variable-length records. Integer-4, integer-5 must be unsigned integers. Integer-4 specifies the size of the smallest data record, and integer-5 specifies the size of the largest data record. ═══ ═══ Format 3 of the RECORD CONTAINS clause specifies variable-length records. Integer-6 specifies the minimum number of character positions to be contained in any record of the file. If you do not specify integer-6, the minimum number of character positions to be contained in any record of the file is equal to the least number of character positions described for a record in that file. ═══ ═══ Format 3 of the RECORD CONTAINS clause specifies variable-length records. Integer-7 specifies the maximum number of character positions to be contained in any record of the file. If you do not specify integer-7, the maximum number of character positions to be contained in any record of the file is equal to the greatest number of character positions described for a record in that file. ═══ ═══ If you specify data-name-1, it must be an elementary unsigned integer. ═══ ═══ The LABEL RECORDS clause indicates the presence or absence of labels. ═══ ═══ Data-name-2 specifies the name of a user label record, which is present in addition to standard labels. Data-name-2 must appear as the subject of a record description entry associated with the file, and it must not appear as an operand of the DATA RECORDS clause for the file. ═══ ═══ The VALUE OF clause describes an item in the label records associated with this file. ═══ ═══ Data-name-3 should be qualified when necessary but cannot be subscripted. You must describe it in the Working-Storage Section but not with the USAGE IS INDEX clause. ═══ ═══ Literal-1 may be numeric or nonnumeric, or a figurative constant of category numeric or nonnumeric. ═══ ═══ The DATA RECORDS clause is syntax-checked, but it is only documentation for the names of data records associated with this file. ═══ ═══ Data-name-4 represents the names of record description entries associated with this file. ═══ ═══ All integers must be unsigned, and all data-names must be described as unsigned integer data items. Data-name-5, integer-8 represent the number of lines that can be written and/or spaced on this logical page. The area of the page that these lines represent is called the page body. The value must be greater than zero. ═══ ═══ Integer-9 or the value of the data item in data-name-6 specifies the first line number of the footing area within the page body. The footing line number must be greater than zero, but not greater than the last line of the page body. The footing area extends between those two lines. All integers must be unsigned integer data items. ═══ ═══ Integer-10 or the value of the data item in data-name-7 specifies the number of lines in the top margin of the logical page. The value can be zero. All integers must be unsigned integer data items. ═══ ═══ Integer-11 or the value of the data item in data-name-8 specifies the number of lines in the bottom margin of the logical page. The value can be zero. All integers must be unsigned integer data items. ═══ ═══ The LINAGE clause specifies the depth of a logical page in terms of number of lines. It also may specify both the line number at which the footing area begins and the top and bottom margins of the logical page. (The logical page and the physical page may not be the same size). ═══ ═══ Integer-3 must be an unsigned integer that specifies the number of character positions contained in each record in the file. ═══ ═══ Integer-4, integer-5 must be unsigned integers. Integer-4 specifies the size of the smallest data record, and integer-5 specifies the size of the largest data record. ═══ ═══ Integer-6 specifies the minimum number of character positions to be contained in any record of the file. If you do not specify integer-6, the minimum number of character positions to be contained in any record of the file is equal to the least number of character positions in any record of the file. ═══ ═══ Integer-7 specifies the maximum number of character positions to be contained in any record of the file. If you do not specify integer-7, the maximum number of character positions to be contained in any record of the file is equal to the greatest number of character positions described for a record in that file. ═══ ═══ You cannot use data-name-1 as a qualifier. ═══ ═══ The CODE-SET clause specifies the character code used to represent data on a magnetic tape file. When you specify CODE-SET, an alphabet-name identifies the character code convention used to represent data on the input-output device. The CODE-SET clause is valid only for magnetic tape files. ═══ ═══ File-name-1 must follow the level indicator (FD or SD), and must be the same as that specified in the associated SELECT clause. File-name-1 must adhere to the rules of formation for a user-defined word; at least one character must be alphabetic. File-name-1 must be unique within this program. One or more record description entries must follow file-name-1. When you specify more than one record description entry, each entry implies a redefinition of the same storage area. The clauses that follow file-name-1 are optional; they may appear in any order. ═══ ═══  End each Declarative Section with another section-name followed by a USE sentence, or with the key words END DECLARATIVES.  END DECLARATIVES must be followed by a separator period. ═══ ═══  Data-name-1 is a user-defined word that names a data item described in a data description entry. When you use it in the general formats, data-name-1 represents a word that must not be reference-modified, subscripted, or qualified unless specifically permitted by the rules for the format.  Data items defined in the Linkage Section of the called program may be referenced within the Procedure Division of that program if, and only if, they satisfy any of the following conditions: - They are operands of the USING phrase of the Procedure Division header or the ENTRY statement. - They are operands of ADDRESS OF or CALL ... BY REFERENCE ADDRESS OF. - They are defined with a REDEFINES or RENAMES clause, the object of which satisfies the above conditions. - They are items subordinate to any item that satisfies the condition in the rules above. - They are condition-names or index-names associated with data items that satisfies the above conditions. ═══ ═══ A user-defined word that identifies a section. A referenced section-name, because it cannot be qualified, must be unique within the program in which it is defined. ═══ ═══  A section-header optionally followed by one or more paragraphs.  Section-header: A section-name followed by the key word SECTION, optionally followed by a priority-number, followed by a separator period. If there are no declaratives, a section-header is not required in the Procedure Division. ═══ ═══  Priority-number is an integer or a positive signed numeric literal ranging in value from 0 through 99.  Sections in the declaratives portions must contain priority numbers in the range of 0 through 50. ═══ ═══  A user-defined word that identifies a paragraph. A paragraph-name, because it can be qualified, need not be unique.  If there are no declaratives, a paragraph-name is not required in the Procedure Division. ═══ ═══ Data-name is a user-defined word that names a data item described in a data description entry. When you use it in the general formats, data-name represents a word that must not be reference-modified, subscripted or qualified unless specifically permitted by the rules for the format. ═══ ═══  Para-name is a user-defined word that identifies a paragraph. A paragraph-name, because it can be qualified, need not be unique.  If there are no declaratives (Format 2), a paragraph-name is not required in the Procedure Division. ═══ ═══ Identifier-1 may be any group item, or elementary alphabetic, alphanumeric, alphanumeric-edited, numeric-edited or external decimal item. It may also be a USAGE-DISPLAY(DBCS) item or an external floating-point item. ═══ ═══ Mnemonic-name must be associated in the SPECIAL-NAMES paragraph with an input/output device: either a system input device or a console typewriter. ═══ ═══ A valid environment-name may be specified. ═══ ═══ Identifier may be a group item, or an elementary alphanumeric, alphanumeric-edited, numeric-edited, external decimal, internal decimal, binary, internal floating-point or external floating-point item. ═══ ═══ DATE has the implicit PICTURE 9(6). The sequence of data elements (from left to right) is: 2 digits for year of century 2 digits for month of year 2 digits for day of month Thus 25 December 1991 is expressed as: 911225 The conceptual data items DATE, DAY, DAY-OF-WEEK and TIME implicitly have USAGE DISPLAY. Since they are conceptual items, they cannot be described in the COBOL program. ═══ ═══ DAY has the implicit PICTURE 9(5). The sequence of data elements (from left to right) is: 2 digits for year of century 3 digits for day of year Thus 25 December 1991 is expressed as: 91359 The conceptual data items DATE, DAY, DAY-OF-WEEK and TIME implicitly have USAGE DISPLAY. Since they are conceptual items, they cannot be described in the COBOL program. ═══ ═══ DAY-OF-WEEK has the implicit PICTURE 9(1). The single data element represents the day of the week according to the following values: 1 represents Monday 2 represents Tuesday 3 represents Wednesday 4 represents Thursday 5 represents Friday 6 represents Saturday 7 represents Sunday Thus Wednesday is expressed as: 3 The conceptual data items DATE, DAY, DAY-OF-WEEK and TIME implicitly have USAGE DISPLAY. Since they are conceptual items, they cannot be described in the COBOL program. ═══ ═══ TIME has the implicit PICTURE 9(8). The sequence of data elements (from left to right) is: 2 digits for hour of day 2 digits for minute of hour 2 digits for second of minute 2 digits for hundredths of second Thus 2:41 P.M. is expressed as: 14410000 The conceptual data items DATE, DAY, DAY-OF-WEEK and TIME implicitly have USAGE DISPLAY. Since they are conceptual items, they cannot be described in the COBOL program. ═══ ═══ In Format 1, identifiers must name elementary numeric items. ═══ ═══ Literal-1 must be a numeric literal. However, you can use floating-point data-items and literals anywhere a numeric data item or literal can be specified. ═══ ═══ Literal must be numeric. However, floating-point literals may be used anywhere a numeric data item or literal can be specified. ═══ ═══ If you specify the GIVING phrase, all subsequent identifiers must name an elementary numeric or numeric-edited item. Any data items following the word GIVING are not included in the composite of operands. ═══ ═══ The CORRESPONDING phrase (CORR) allows ADD, SUBTRACT, and MOVE operations to be performed on elementary data items of the same name if the group items to which they belong are specified. Both identifiers following the key word CORRESPONDING must name group items. ═══ ═══ In Format 2, identifiers must name an elementary numeric item, except when following the word GIVING. Each identifier following the word GIVING must name an elementary numeric or numeric-edited item. ═══ ═══ In Format 3, identifiers must name a group item. ═══ ═══ Procedure-name-1 must name a Procedure Division paragraph that contains only one sentence: a GO TO statement without the DEPENDING ON phrase. The ALTER statement modifies the GO TO statement in the paragraph named by procedure-name-1. Subsequent executions of the modified GO TO statements transfer control to procedure-name-2. ═══ ═══ Procedure-name-2 must name a Procedure Division section or paragraph. The ALTER statement modifies the GO TO statement in the paragraph named by procedure-name-1. Subsequent executions of the modified GO TO statements transfer control to procedure-name-2. ═══ ═══ Identifier-1 and literal-1 must be nonnumeric. The value of identifier-1 must follow the rules for the literal form of a program-name in the outermost program. As an IBM extension, identifier-1 may be an alphabetic or zoned decimal data item. Literal-1 must also follow the rules for the formation of a program-name in the outermost program. ═══ ═══ The values of the parameters referenced in the USING phrase of the CALL statement are made available to the called subprogram at the time the CALL statement is executed. Each USING identifier in a calling program may be a data item of any level in the Data Division and may appear more than once in a CALL statement. Include the USING phrase in the CALL statement only if there is a USING phrase in the Procedure Division header or the ENTRY statement through which the called program is invoked. The number of operands in the USING phrases need not be identical. ═══ ═══ You must define identifier-2 as a level-01, level-77, or elementary data item in the File Section, Working-Storage Section or Linkage Section. ═══ ═══ If the BY REFERENCE phrase is either specified or implied for a parameter, the corresponding data item in the calling program occupies the same storage area as the data item in the called program. The description of the data item in the called program must contain the same number of character positions as the description of the corresponding data item in the calling program. ═══ ═══ If the BY CONTENT phrase is specified or implied for a parameter, the called program cannot change the value of this parameter as referenced in the CALL statement's USING phrase. The called program may change the value of the data item referenced by the corresponding data-name in the Procedure Division header. ═══ ═══ ADDRESS OF is the special register. It is implicitly defined as USAGE IS POINTER. ═══ ═══ In the Procedure Division, you can use the LENGTH OF special register anywhere a numeric data item having the same definition as the implied definition of the LENGTH OF special register is used. It is implicitly defined USAGE IS BINARY, PICTURE 9(9). If you use LENGTH OF as a parameter in the CALL statement, the parameter must be a BY CONTENT parameter. ═══ ═══ Specify literal-2 as any of the following:  A nonnumeric literal  A figurative constant  A DBCS literal. ═══ ═══ If you specify the ON OVERFLOW phrase in the CALL statement, control is transferred to imperative-statement-1 when the called program cannot be made available. ═══ ═══ You must define identifier-2 as a level-01, level-77, or elementary data item in the File Section, Working-Storage Section or Linkage Section. Identifier-2 must not be a function-identifier. It may be:  A data item of any level in the Data Division  A pointer data item (an item defined implicitly or explicitly as USAGE IS POINTER or USAGE IS PROCEDURE-POINTER)  A floating-point data item  A DBCS data item  A file-name for a QSAM file under MVS. ═══ ═══ If you specify the ON EXCEPTION phrase in the CALL statement and the called program cannot be made available, control is transferred to imperative-statement-1. ═══ ═══ If you specify the NOT ON EXCEPTION phrase in the CALL statement and the called program can be made available (that is, no exception condition exists), control is transferred to the called program. After control returns from the called program, it is transferred to imperative-statement-2. ═══ ═══ Identifier-1 or literal-1 specify the name of the COBOL/370 subprogram to be canceled, which must be nonnumeric. The value of identifier-1 must conform to the rules for the literal form program-name in the outermost program. Literal-1 must conform to the rules for the formation of a program-name in the outermost program. As an IBM extension, identifier-1 can be an alphabetic or zoned decimal data item. Each literal or contents of the identifier specified in the CANCEL statement must be the same as the literal or contents of the identifier specified in an associated CALL statement. ═══ ═══ File-name-1 designates the file upon which the CLOSE statement is to operate. If you specify more than one file-name, the files need not have the same organization or access. File-name-1 must not be a sort or merge file. ═══ ═══ Specify the REEL/UNIT phrases only for QSAM multivolume or single volume files. REEL and UNIT are interchangeable. ═══ ═══ The FOR REMOVAL phrase is applicable only to tape files. If you specify it for storage devices to which it does not apply, it is ignored. ═══ ═══ The WITH NO REWIND phrase is applicable only to tape files. If you specify it for storage devices to which it does not apply, it is ignored. ═══ ═══ File-name-1 designates the file upon which the CLOSE statement is to operate. If you specify more than one file-name, the files need not have the same organization or access. File-name-1 must not be a sort or merge file. ═══ ═══ Identifier-1 must name elementary numeric or elementary numeric-edited item(s). ═══ ═══ You must define file-name in an FD entry in the Data Division. It must be the name of an indexed or relative file. ═══ ═══ Literal-1 may be any figurative constant. When you specify a figurative constant, only a single occurrence of that figurative constant is displayed. You can use any kind of literal. ═══ ═══ The UPON phrase specifies the output device to be used for the DISPLAY statement. Mnemonic-name or environment-name must be associated in the SPECIAL-NAMES paragraph with an output device. A maximum logical record size is assumed for each device, as follows:  The system logical output device = 120 characters  The system punch device = 72 characters  The console typewriter = 100 characters When you omit the UPON phrase, the system's logical output device is assumed. Note: On the system punch device, characters 73 through 80 are used for PROGRAM-ID name. ═══ ═══ Identifier-1 and identifier-2 must name an elementary numeric item. You cannot use floating-point data items. ═══ ═══ Identifier-1 and identifier-2 must name an elementary numeric item. ═══ ═══ Identifier-3 must name an elementary numeric or numeric-edited item. It may be floating-point. ═══ ═══ Identifier-3 and identifier-4 must name an elementary numeric or numeric-edited item. You cannot use floating-point data items. ═══ ═══ In Formats 1 and 2, you can specify floating-point literals anywhere that a numeric data item or literal can be specified. Literal must be a numeric literal. ═══ ═══ In Format 3, you cannot use floating-point literals. Literal must be a numeric literal. ═══ ═══ Language-name has no defined meaning. It must be either a correctly formed user-defined word or the word "COBOL". At least one character must be alphabetic. ═══ ═══ Routine-name must follow the rules for formation of a user-defined word and at least one character must be alphabetic. ═══ ═══ The USING phrase makes data items defined in a calling program available to a called subprogram. The USING option is valid in the ENTRY statement if, and only if this subprogram is invoked by a CALL statement that itself contains a USING phrase. Each USING identifier must be defined as a level-01 or level-77 item in the Linkage Section of the called subprogram. ═══ ═══ Two operands connected by a THROUGH phrase must be of the same class. The two operands thus connected constitute a single selection object, and the number of selection objects within each set of selection objects must be equal to the number of selection subjects. ═══ ═══ Each selection object within a set of selection objects must correspond to the selection subject having the same ordinal position within the set of selection subjects, according to the following rule: Condition-1, condition-2, or the word TRUE or FALSE appearing as a selection object must correspond to a conditional expression or the word TRUE or FALSE in the set of selection subjects. ═══ ═══ Each selection object within a set of selection objects must correspond to the selection subject having the same ordinal position within the set of selection subjects, according to the following rule: The word ANY may correspond to a selection subject of any type. ═══ ═══ Operands in the WHEN phrase are interpreted one of two ways, depending on how you specify them:  Individually, they are called selection subjects.  Collectively they are called a set of selection objects. Each selection object within a set of selection objects must correspond to the selection subject having the same ordinal position within the set of selection subjects, according to the following rule: Identifiers, literals, or arithmetic expressions appearing within a selection object must be valid operands for comparison to the corresponding operand in the set of selection subjects. ═══ ═══ The ALSO phrase separates selection subjects within a set of selection subjects and separates selection objects within a set of selection objects. ═══ ═══ Procedure-name must name a procedure or a section in the same Procedure Division as the GO TO statement. ═══ ═══ Procedure-name-1 must be a procedure or a section in the same Procedure Division as GO TO. The number of procedure-names must not exceed 255. ═══ ═══ Condition may be any simple or complex condition. There are five simple conditions, which have a truth value of either true or false:  Class condition  Condition-name condition  Relation condition  Sign condition  Switch-status condition A complex condition is formed by combining simple conditions, combined conditions, and/or complex conditions with logical operators, or negating these conditions with logical negation. ═══ ═══ Statement-1 and statement-2 can be an imperative statement, a conditional statement, or an imperative statement followed by a conditional statement. ═══ ═══ You can specify the NEXT SENTENCE phrase with END-IF. However, if the NEXT SENTENCE phrase is executed, control will not pass to the next statement following END-IF; instead, control will pass to the statement after the closest following period. ═══ ═══ You can omit the ELSE NEXT SENTENCE phrase if it immediately precedes a separator period that ends the IF statement. ═══ ═══ Literal-1 is the sending area. You can use a DBCS data item or literal anywhere an identifier or literal is specified. DBCS items refer to double byte character data. ═══ ═══ Identifier-2 is the sending area. You can use a DBCS data item or literal anywhere an identifier or literal is specified. DBCS items refer to double byte character data. You can specify special registers for identifier-2 only if they are valid sending fields for the implied MOVE statements. ═══ ═══ DBCS and EGCS refer to the characters allowed for DBCS literals. ═══ ═══ Identifier-1 is the inspected item and must be an alphanumeric or numeric data item with USAGE DISPLAY. All identifiers, except identifier-2 (the count field), may be external floating-point items, which are treated as if redefined as alphanumeric with the INSPECT statement referring to the alphanumeric item. If any identifiers or literals in the INSPECT statement are DBCS items, then all of them must be DBCS items, except for the count field (identifier-2), which cannot be a DBCS item. If the identifiers and literals other than identifier-2 are DBCS items, then DBCS characters, not bytes of data, are tallied in identifier-2. ═══ ═══ Identifier-2 must be an elementary numeric data item, but cannot be a DBCS item; DBCS characters, not bytes of data, are tallied in identifier-2. ═══ ═══ Literal-1 ... literal-5 must be nonnumeric and may be any figurative constant that does not begin with the word ALL. If literal-2, 3, or 4 is a figurative constant, it refers to an implicit 1 character data item. When you specify the REPLACING phrase, identifier-3 or literal-1 is in the subject field. ═══ ═══ Identifier-4 or literal-2 is the delimiter. It is not counted or replaced. Instead, it serves as the boundary for the counting and/or replacing of the inspected item. If identifier-4 or literal-2 is a figurative constant, it is considered to be 1 character in length. ═══ ═══ Identifier-3 is the subject field. Identifier-3 must be an elementary data item with USAGE DISPLAY. All identifiers, except identifier-2, may be floating-point items, which are treated as if redefined as alphanumeric with INSPECT referring to the alphanumeric item. Identifier-3 must be a DBCS item if any of the identifiers or literals is a DBCS item. The subject field and the substitution field must be the same length. ═══ ═══ With the REPLACING phrase, the subject field and the substitution field must be the same length. ═══ ═══ If you specify CHARACTERS, the substitution must be 1 character in length. Each character in the inspected field is replaced by the substitution field, beginning at the leftmost character and continuing to the rightmost. ═══ ═══ If you specify LEADING, each contiguous nonoverlapping occurrence of the subject field in the inspected item is replaced by the substitution field, provided that the leftmost such occurrence is at the point where comparison began in the first comparison cycle for which this substitution field is eligible to participate. ═══ ═══ When you specify REPLACING, identifier-3 or literal-1 is the subject field. ═══ ═══ If you specify FIRST, the leftmost occurrence of the subject field in the inspected item is replaced by the substitution field. ═══ ═══ Literal-1 is the tallying field. Literal-1 must be nonnumeric and may be any figurative constant that does not begin with the word ALL. If literal-1 is a figurative constant, it refers to an implicit 1 character data item. When the tallying field is a figurative constant, it is considered to be a 1-character nonnumeric literal. ═══ ═══ If you specify ALL, the count field is increased by 1 for each nonoverlapping occurrence in the inspected item, of this tallying operand, beginning at the leftmost character position and continuing to the rightmost. ═══ ═══ If you specify LEADING, the count field is increased by 1 for each contiguous nonoverlapping occurrence in the inspected item of this tallying operand, beginning at the leftmost character position and continuing to the rightmost. ═══ ═══ If you specify CHARACTERS, the count field is increased by 1 for each character (including the space character) in the inspected item. Thus, execution of the INSPECT TALLYING statement increases the value in the count field by the number of characters in the inspected item. ═══ ═══ Literal-1 is the subject field. Literal-1 must be nonnumeric and may be any figurative constant that does not refer to the word ALL. If literal-1 is a figurative constant, it refers to an implicit 1 character data item. The subject field and the substitution field must be the same length. ═══ ═══ Identifier-5 is the substitution field. The subject field and the substitution field must be the same length. Identifier-5 must be an elementary data item with USAGE DISPLAY. All identifiers except identifier-2 (the count field) may be external floating-point items, which are treated as if redefined as alphanumeric with INSPECT referring to the alphanumeric item. ═══ ═══ Literal-3 is the substitution field. The subject field and the substitution field must be the same length. Literal-3 must be nonnumeric and may be any figurative constant that does not begin with the word ALL. If literal-3 is a figurative constant, it refers to an implicit 1 character data item. ═══ ═══ Identifier-3 is the tallying field. Identifier-3 must be an elementary data item with USAGE DISPLAY. All identifiers except identifier-2 may be floating-point items, which are treated as if redefined as alphanumeric with INSPECT referring to the alphanumeric item. When the tallying field is a figurative constant, it is considered to be a 1-character nonnumeric literal. ═══ ═══ If you specify ALL, each nonoverlapping occurrence of the subject field in the inspected item is replaced by the substitution field, beginning at the leftmost character and continuing to the rightmost. ═══ ═══ Identifier-2, the count field, must be an elementary integer item defined without the symbol P in its PICTURE character-string. You must initialize identifier-2 before the INSPECT statement is performed. If any identifiers or literals in the INSPECT statement are DBCS items, then all of them must be DBCS items, except for identifier-2, which cannot be a DBCS item. If the identifiers and literals other than identifier-2 are DBCS items, then DBCS characters, not bytes of data, are tallied in identifier-2. ═══ ═══ File-name-1 is the name given in the SD entry that describes the records to be merged. You can specify any file-names in MERGE in the same SAME RECORD AREA clause. ═══ ═══ The ASCENDING/DESCENDING phrase specifies that records are to be processed in an ascending or descending sequence (depending on the phrase specified), based on the identified merge keys. ═══ ═══ The ASCENDING/DESCENDING phrase specifies that records are to be processed in an ascending or descending sequence (depending on the phrase specified), based on the identified merge keys. ═══ ═══ The COLLATING SEQUENCE phrase specifies the collating sequence to be used in nonnumeric comparisons for the KEY data items in this merge operation. If you omit COLLATING SEQUENCE, the PROGRAM COLLATING SEQUENCE clause (if specified) in the OBJECT-COMPUTER paragraph specifies the collating sequence to be used. When you omit both the COLLATING SEQUENCE phrase and the COLLATING SEQUENCE clause, the EBCDIC collating sequence is used. ═══ ═══ During the MERGE operation, all the records in file-name-2 and file-name-3 (the input files) are transferred to file-name-1. When the MERGE statement is executed, these files must not be open; the compiler generates code that opens, reads, and closes the input files automatically. All input files must specify sequential or dynamic access mode and be described in FD entries in the Data Division. ═══ ═══ Proc-name-1 specifies the first (or only) section or paragraph in the OUTPUT PROCEDURE. ═══ ═══ Proc-name-2 identifies the last section or paragraph of the OUTPUT PROCEDURE. ═══ ═══ When you specify the GIVING phrase, all the merged records in file-name-1 are automatically transferred to the output files (file-name-4). ═══ ═══ The OUTPUT PROCEDURE phrase specifies the name of a procedure that is to select or modify output records from the merge operation. ═══ ═══ File-name-4 represents the output files. When you specify the GIVING phrase, all the merged records in file-name-1 are automatically transferred to the output files (file-name-4). All output files must specify sequential or dynamic access mode and be described in FD entries in the Data Division. ═══ ═══ Identifier-1 is the sending area. When you specify Format 1, all identifiers may be either group or elementary items. If identifier-1 is reference modified, subscripted, or is a function-identifier, the reference modifier, subscript, or function is evaluated only once, immediately before data is moved into that receiving field. If either the sending or receiving item is a DBCS data item, then both must be DBCS items. The figurative constant SPACE can be the DBCS sending item. ═══ ═══ Literal-1 is the sending area. If either the sending or receiving item is a DBCS item, then both must be DBCS items. The figurative constant SPACE can be the DBCS sending item. ═══ ═══ Identifier-2 represents the receiving area. When you specify Format 1, all identifiers may be either group or elementary items. If either the sending or receiving item is a DBCS item, then both must be DBCS items. ═══ ═══ When you specify CORRESPONDING, selected items in identifier-1 are moved to identifier-2. The results of moving items in identifier-1 to identifier-2 are the same as if a separate MOVE statement referenced each pair of corresponding identifiers. A pointer data item can be part of a group that is referenced in a MOVE CORRESPONDING statement. However, the pointer data item will not move. ═══ ═══ CORR is an abbreviation for, and equivalent to, CORRESPONDING. ═══ ═══ In Format 2, identifier-1 and identifier-2 must be group items. ═══ ═══ Identifier-1 and identifier-2 must name an elementary numeric item. ═══ ═══ Literal-1 must be numeric. ═══ ═══ Literal-2 must be numeric. ═══ ═══ Identifier-3 must name an elementary numeric or numeric-edited item. ═══ ═══ I-O permits opening of the file for both input and output operations. You may specify I-O only for files to direct access devices. ═══ ═══ You can use the EXTEND phrase for files where you have specified the LINAGE phrase. Do not specify the EXTEND phrase for a multiple file reel. The EXTEND phrase permits the file to be open for output operations under MVS or CMS and is allowed for files for which LINAGE has been specified. ═══ ═══ REVERSED is not valid for sequential single reel files. ═══ ═══ NO REWIND is only valid for sequential single reel files. ═══ ═══ The INPUT phrase permits opening the file for input operations. ═══ ═══ The OUTPUT phrase permits opening the file for output operations. Note: You can specify this phrase when creating the file, but do not specify OUTPUT for a file that contains records; the file will be replaced by new data. And do not specify this phrase for a file that is defined with a DD dummy JCL card when running under MVS; unpredictable results may occur. ═══ ═══ The INPUT phrase permits opening the file for input operations. ═══ ═══ The OUTPUT phrase permits opening the file for output operations. You can specify this phrase when creating the file. If you specify the OUTPUT phrase for a file that contains records, the file (which must be defined as reusable) will be replaced by the new data. ═══ ═══ The I-O phrase permits opening the file for both input and output operations. You can specify I-O only for files assigned to direct access devices. ═══ ═══ The EXTEND phrase , which is allowed only for sequential access files, permits opening the file for both input and output operations. ═══ ═══ File-name-1 designates a file upon which OPEN is to operate. If you specify more than one file, the files do not need to have the same organization or access. Each file-name must be defined in an FD entry in the Data Division, and must not name a sort or merge file. The FD entry must be equivalent to the information supplied when the file was defined. ═══ ═══ File-name-2 designates a file upon which OPEN is to operate. If you specify more than one file, the files do not need to have the same organization or access. Each file-name must be defined in an FD entry in the Data Division, and must not name a sort or merge file. The FD entry must be equivalent to the information supplied when the file was defined. ═══ ═══ File-name-3 designates a file upon which OPEN is to operate. If you specify more than one file, the files do not need to have the same organization or access. Each file-name must be defined in an FD entry in the Data Division, and must not name a sort or merge file. The FD entry must be equivalent to the information supplied when the file was defined. ═══ ═══ File-name-4 designates a file upon which OPEN is to operate. If you specify more than one file, the files do not need to have the same organization or access. Each file-name must be defined in an FD entry in the Data Division, and must not name a sort or merge file. The FD entry must be equivalent to the information supplied when the file was defined. ═══ ═══ Identifier-1 must name an integer item. If it is zero or negative when the PERFORM statement is initiated, control passes to the statement following the PERFORM statement. After the PERFORM statement has been initiated, any change to identifier-1 has no effect in varying the number of times the procedures are initiated. ═══ ═══ Integer-1 may be a positive signed integer. ═══ ═══ The imperative-statement represents the statements to be executed for an in-line PERFORM statement. Imperative-statement is optional. ═══ ═══ Condition-1 may be any type of condition (simple, complex, class...). If the condition is true when the PERFORM statement is initiated, the specified procedures are not executed. Any subscripting associated with the operands specified in condition-1 is evaluated each time the condition is tested. ═══ ═══ Condition-1 and condition-2 may be any conditional expression. If the condition is true at the time the PERFORM statement is initiated, the specified procedures are not executed. After the conditions specified in the UNTIL phrase are satisfied, control is passed to the next executable statement following the PERFORM statement. If any of the operands specified in condition-1 or condition-2 is subscripted, reference modified,or is a function identifier, the subscript, reference-modifier, or function is evaluated each time the condition is tested. ═══ ═══ Procedure-name-1, procedure-name-2 must name a section or paragraph in the Procedure Division. When you specify both procedure-name-1 and procedure-name-2, if either is a procedure-name in a declarative procedure, both must be procedure-names in the same declarative procedure. If you specify procedure-name-1, you must not specify imperative-statement and the END-PERFORM phrase. If you omit procedure-name-1, you must specify imperative-statement and the END-PERFORM phrase. ═══ ═══ Procedure-name-1, procedure-name-2 must name a section or paragraph in the Procedure Division. When you specify both procedure-name-1 and procedure-name-2, if either is a procedure-name in a declarative procedure, both must be procedure-names in the same declarative procedure. If you specify procedure-name-1, you must not specify imperative-statement and the END-PERFORM phrase. If you omit procedure-name-1, you must specify imperative-statement and the END-PERFORM phrase, and you must not specify the AFTER phrase. ═══ ═══ If the TEST BEFORE phrase is specified or assumed, the condition is tested before any statements are executed (corresponds to DO WHILE). If the condition is true, control is transferred to the next executable statement following the end of the PERFORM statement. If you do not specify the TEST BEFORE or the TEST AFTER phrase, the TEST BEFORE phrase is assumed. ═══ ═══ If the TEST AFTER phrase is specified, the statements to be performed are executed at least once before the condition is tested (corresponds to DO UNTIL). If the condition is true, control is transferred to the next executable statement following the end of the PERFORM statement. If you do not specify the TEST BEFORE or the TEST AFTER phrase, the TEST BEFORE phrase is assumed. ═══ ═══ When you specify TEST BEFORE, all specified conditions are tested before the first execution, and the statements to be performed are executed only when all specified tests fail. If you do not specify the TEST BEFORE or the TEST AFTER phrase, the TEST BEFORE phrase is assumed. ═══ ═══ When you specify TEST AFTER, the statements to be performed are executed at least once, before any condition is tested. If you do not specify the TEST BEFORE or the TEST AFTER phrase, the TEST BEFORE phrase is assumed. ═══ ═══ Identifier-2 thru 7 must name a numeric elementary item. ═══ ═══ Literal-1 thru 4 must represent a numeric literal. You can use floating-point data items and literals anywhere a numeric data item or literal can be specified. ═══ ═══ File-name-1 must be defined in a Data Division FD entry. ═══ ═══ Identifier-1 is the receiving field. Identifier-1 may be a DBCS item or a floating-point data item. Identifier-1 does not need to describe a group item or an elementary alphanumeric item. ═══ ═══ You may specify KEY IS only for indexed files. It must not be specified for sequential or relative files. Data-name-1 must identify a record key associated with file-name-1. Data-name-1 may be qualified, and it may defined as a DBCS item. However, it may not be subscripted. When RECORD KEY specifies a DBCS data item, a KEY specified on the READ statement must be a DBCS data item. ═══ ═══ Record-name-1 must specify the name of a logical record in a sort-merge file description entry (SD). Record-name-1 may be qualified. Record-name-1 may define a floating point or DBCS data item. If record-name-1 is a DBCS data item, then identifier-1 must be a DBCS data item. Record-name-1 and identifier-1 must not refer to the same storage area. If the RELEASE statement is executed without a specified SD entry for file-name-1 in a SAME RECORD AREA clause, the information in record-name-1 is no longer available. ═══ ═══ FROM identifier-1 makes the RELEASE statement equivalent to the execution of the following two statements: MOVE identifier-1 TO record-name-1 RELEASE record-name-1 The MOVE is performed according to the rules for the MOVE statement without the CORRESPONDING phrase. Identifier-1 must be the name of a Working-Storage Section or Linkage Section entry, a record description for another previously opened file, or an alphanumeric function identifier. Identifier-1 may be a DBCS or floating-point data item. Identifier-1 and record-name-1 must not refer to the same storage area. After the RELEASE statement has successfully executed, the logical record is still available in identifier-1. ═══ ═══ File-name-1 must be described in a Data Division SD entry. If it has more than one record description, these records automatically share the same storage; the area is implicitly redefined. After execution of the RETURN statement, only the contents of the current record are available; if any data items lie beyond the length of the current record, their contents are undefined. ═══ ═══ The imperative-statement specified in the AT END phrase executes after all records have been returned from file-name-1. No more RETURN statements may be executed as part of the current output procedure. ═══ ═══ If an at end condition does not occur during the execution of the RETURN statement, then after the record is made available, and after executing any implicit move resulting from the presence of an INTO phrase, control is transferred to the imperative statement associated with the NOT AT END phrase, if specified. If the NOT AT END phrase is omitted, control passes to the end of the RETURN statement. ═══ ═══ Record-name-1 must be the name of a logical record in a Data Division FD entry. Record-name-1 may be qualified and may define a floating-point or DBCS item. ═══ ═══ FROM identifier-1 makes the REWRITE statement equivalent to the execution of the following two statements: MOVE identifier-1 TO record-name-1 REWRITE record-name-1 The MOVE is performed according to the rules for the MOVE statement without the CORRESPONDING phrase. Identifier-1 must be the name of a Working-Storage Section or Linkage Section entry, a record description for another previously opened file, or an alphanumeric function identifier. Identifier-1 may be a DBCS or floating-point data item. Identifier-1 and record-name-1 must not refer to the same storage area. After the REWRITE statement has successfully executed, the logical record is still available in identifier-1. ═══ ═══ The at end condition exists when the search operation terminates without satisfying the condition specified in any of the associated WHEN phrases. If the at end condition exists and the AT END phrase is specified, imperative-statement-1 is executed, and control passes to the end of the SEARCH statement, unless imperative-statement-1 ends with a GO TO statement. If the at end condition exists and the AT END phrase is omitted, control passes to the next statement after the SEARCH statement. ═══ ═══ After imperative-statement-2 is executed, control passes to the end of the SEARCH statement, unless imperative-statement-2 ends with a GO TO statement. ═══ ═══ If the WHEN phrase cannot be satisfied for any setting of the index within this range, the search is unsuccessful, and the at end condition exists. Control passes to imperative-statement-1 of the AT END phrase, if specified, or to the next statement after the SEARCH statement. In either case, the final setting of the index is not predictable. If the WHEN phrase can be satisfied, the search is terminated immediately, and control passes to imperative-statement-2, if specified, or to the next executable sentence if the NEXT SENTENCE phrase is specified. The index contains the value indicating the occurrence that allowed the WHEN condition(s) to be satisfied. After imperative-statement-2 is executed, control passes to the end of the SEARCH statement, unless imperative-statement-2 ends with a GO TO statement. ═══ ═══ Identifier-2 must be either an index data item or an elementary integer item. Identifier-2 may not be subscripted by the first (or only) index-name for identifier-1. ═══ ═══ Identifier-1 can be a data item subordinate to a data item that contains an OCCURS clause; that is, it can be a part of a multi-dimensional table. In this case, the data description entry must specify an INDEXED BY phrase for each dimension of the table. Identifier-1 can be an index data item, a DBCS data item, or a floating-point data item. Identifier-1 must refer to all occurrences within the table element; that is, it must not be subscripted or reference modified. The Data Division description of identifier-1 must contain an OCCURS clause with the INDEXED BY phrase. ═══ ═══ Each condition-name specified must have only a single value, and each must be associated with an ASCENDING/DESCENDING KEY identifier for this table element. ═══ ═══ Data-name-1 and data-name-2 must specify ASCENDING/DESCENDING KEY data items in the identifier-1 table element and must be subscripted by the first identifier-1 index-name, along with other subscripts or literals, as required. Data-name-1 and data-name-2 may be qualified. They cannot be floating-point data items. ═══ ═══ Identifier-3 and identifier-4 can be floating-point data items, but must not be POINTER data items. They must not be ASCENDING/DESCENDING KEY data items for identifier-1 or an item that is subscripted by the first index-name for identifier-1. ═══ ═══ The explicit scope terminator serves to delimit the scope of a statement. It permits the conditional form of the statement to be nested within another conditional statement. The explicit scope terminator may also be used with the imperative form of the statement. The scope of a SEARCH statement may be terminated by any of the following:  An END-SEARCH phrase at the same level of nesting  A separator period  An ELSE or END-IF phrase associated with a previous IF statement. ═══ ═══ Condition-1 may be any conditional expression. ═══ ═══ You can specify NEXT SENTENCE with END-SEARCH. Note, however, that if the NEXT SENTENCE phrase is executed, control will not pass to the next statement following the END-SEARCH, but instead will pass to the statement following the next closest period. ═══ ═══ NULL/NULLS is the sending field. It sets the receiving field to contain the value of an invalid address. ═══ ═══ Identifier-1 and index-name-1 are the receiving fields and must name either index data items or elementary numeric integer items. ═══ ═══ Index-name-2 is the sending field. The value before the SET statement is executed must correspond to the occurrence number of its associated table. ═══ ═══ Identifier-2 is the sending field and must name either an index data item or an elementary numeric integer item. ═══ ═══ Integer-1 is the sending field. It must be a positive integer. ═══ ═══ You can specify the sending field as identifier-3, which must be an elementary integer data item. ═══ ═══ You can specify the sending field as integer-2, which must be an integer. ═══ ═══ You can specify the receiving field with index-name-3. The index-name value, both before and after the SET statement has been executed, must correspond to the occurrence numbers in an associated table. ═══ ═══ You must associate mnemonic-name with an external switch, the status of which can be altered. ═══ ═══ You must associate condition-name-1 with a conditional variable. If more than one literal is specified in the VALUE clause of condition-name-1, it is associated condition variable is set equal to the first literal. ═══ ═══ You must describe identifier-4, the receiving fields, as USAGE IS POINTER. ═══ ═══ Identifier-6, the sending field, may not contain an address within the program's own Working Storage or File Section. It must be described as USAGE IS POINTER. ═══ ═══ ADDRESS OF identifier-7, the sending field, contains the address of the identifier, not the content of the identifier. Identifier-7 must name an item in the Linkage Section of any level except 66 or 88. ═══ ═══ You must describe procedure-pointer-data-item-1 and procedure-pointer-data-item-2 as USAGE IS PROCEDURE-POINTER. Procedure-pointer-data-item-1 is the receiving field. ═══ ═══ You must define identifier-8 as an alphanumeric item such that the value can be a program name. For entry points in non-COBOL programs, identifier-8 can contain the characters @, #, and $. Identifier-8 must refer to one of the following types of entry points:  The primary entry point of a COBOL program as defined by the PROGRAM-ID statement. The PROGRAM-ID must reference the outermost program of a compilation unit; it must not reference a nested program.  An alternate entry point of a COBOL program as defined by a COBOL ENTRY statement.  An entry point in a non-COBOL program. ═══ ═══ Literal-1 must be non-numeric and must conform to the rules for formation of a program-name. For entry points in non-COBOL programs, literal-1 can contain the characters @, #, and $. Literal-1 must refer to one of the following types of entry points:  The primary entry point of a COBOL program as defined by the PROGRAM-ID statement. The PROGRAM-ID must reference the outermost program of a compilation unit; it must not reference a nested program.  An alternate entry point of a COBOL program as defined by a COBOL ENTRY statement.  An entry point in a non-COBOL program. ═══ ═══ NULL/NULLS sets the receiving field to contain the value of an invalid address. ═══ ═══ ADDRESS OF identifier-5, the receiving field, must be level-01 or level-77 items defined in the Linkage Section. The addresses of these items are set to the value of the operand specified in the TO phrase. Identifier-5 must not be reference modified. ═══ ═══ File-name-1 is the name given in the SD entry that describes the records to be sorted. ═══ ═══ The COLLATING SEQUENCE phrase specifies the collating sequence to be used in nonnumeric comparisons for the KEY data items in this sorting operation. If you omit the COLLATING SEQUENCE phrase, the PROGRAM COLLATING SEQUENCE clause (if specified) in the OBJECT-COMPUTER paragraph specifies the collating sequence to be used. When you omit both the COLLATING SEQUENCE phrase and the COLLATING SEQUENCE clause, the EBCDIC collating sequence is used. ═══ ═══ When you specify the USING phrase, all the records in file-name-2 (the input files) are transferred automatically to file-name-1. All input files must be described in FD entries in the Data Division. At the time the SORT statement is executed, these files must not be open. ═══ ═══ Procedure-name-1 specifies the first (or only) section or paragraph in the INPUT PROCEDURE. ═══ ═══ Procedure-name-2 identifies the last section or paragraph of the INPUT PROCEDURE. ═══ ═══ The OUTPUT PROCEDURE phrase specifies the name of a procedure to select or modify output records from the sorting operation. ═══ ═══ If you specify the DUPLICATES phrase, and the contents of all the key elements associated with one record are equal to the corresponding key elements in one or more other records, the order of these records is as follows:  The order of the associated input files as specified in SORT. Within a given file the order is that in which the records are accessed from that file,  The order in which an input procedure releases these records, when an input procedure is specified. If you do not specify the DUPLICATES phrase, the order of these records is undefined. ═══ ═══ The ASCENDING/DESCENDING KEY phrase specifies that records are to be processed in ascending or descending sequence (depending on the phrase specified), based on the specified sort keys. ═══ ═══ When the GIVING phrase is specified, all the sorted records in file-name-1 are automatically transferred to the output files (file-name-3,...). File-name-3 represents the output files. All output files must be described in FD entries in the Data Division. ═══ ═══ Procedure-name-3 specifies the first (or only) section or paragraph in the OUTPUT PROCEDURE phrase. ═══ ═══ Procedure-name-4 identifies the last section or paragraph of the OUTPUT PROCEDURE. ═══ ═══ The INPUT PROCEDURE phrase specifies the name of a procedure to select or modify input records before the sorting operation begins. ═══ ═══ When you specify the KEY phrase, the file position indicator is positioned at the logical record in the file whose key field satisfies the comparison. When you do not specify the KEY phrase, KEY IS EQUAL (to the prime record key) is implied, and the file position indicator is positioned at the logical record in the file. ═══ ═══ Data-name-1 can be any of the following:  The prime RECORD KEY  Any ALTERNATE RECORD KEY  An alphanumeric data item within a record description for a file whose leftmost character position corresponds to the leftmost character position of that record key; it may be qualified. The data item must be less than or equal to the length of the record key of the file. Data-name-1 need not be an alphanumeric item. However, for purposes of the I/O operation, it will be treated as an alphanumeric item. Data-name-1 may be qualified; it may not be subscripted. ═══ ═══ File-name must name a file with sequential or dynamic access (not a sort file) and be defined in an FD entry in the Data Division. ═══ ═══ Literal may be numeric or non-numeric. It may be any figurative constant, except ALL literal. Literal may be a signed numeric integer or non-integer literal, but may not be a floating point literal. ═══ ═══ Identifier-1 represents the sending field or fields. Identifier-1 must have, explicitly or implicitly, USAGE DISPLAY. When the sending field or any of the delimiters is an elementary numeric item, it must be described as an integer, and its PICTURE character-string must not contain the symbol P. If identifier-1, identifier-2, identifier-3, literal-1, or literal-2 is a DBCS item, then all of them must be DBCS items. In that case, identifier-4 (the pointer field) indicates the relative DBCS character position, not the relative byte position, in the receiving field. ═══ ═══ Identifier-4 represents the pointer field, which points to a character position in the receiving field. If identifier-1, identifier-2, identifier-3, literal-1, or literal-2 is a DBCS item, then all of them must be DBCS items. In that case, identifier-4 (the pointer field) indicates the relative DBCS character position, not the relative byte position, in the receiving field. ═══ ═══ Identifier-3 represents the receiving field. It must not represent an edited data item, and must not be described with the JUSTIFIED clause or be reference modified. Identifier-3 must have, explicitly or implicitly, USAGE DISPLAY. If identifier-1, identifier-2, identifier-3, literal-1, or literal-2 is a DBCS item, then all of them must be DBCS items. In that case, identifier-4 (the pointer field) indicates the relative DBCS character position, not the relative byte position, in the receiving field. ═══ ═══ Literal-1 represents the sending fields. Literal-1 must be a nonnumeric literal; it may be any figurative constant except the ALL literal. When you specify a figurative constant, it is considered a 1-character nonnumeric literal. If identifier-1, identifier-2, identifier-3, literal-1, or literal-2 is a DBCS item, then all of them must be DBCS items. In that case, identifier-4 (the pointer field) indicates the relative DBCS character position, not the relative byte position, in the receiving field. SPACE is the only figurative constant allowed for DBCS items. ═══ ═══ Literal-2 is a delimiter; that is, a character that delimits the data to be transferred. Literal-2 must be a nonnumeric literal; it may be any figurative constant except the ALL literal. When you specify a figurative constant, it is considered a 1-character nonnumeric literal. If identifier-1, identifier-2, identifier-3, literal-1, or literal-2 is a DBCS item, then all of them must be DBCS items. In that case, identifier-4 (the pointer field) indicates the relative DBCS character position, not the relative byte position, in the receiving field. SPACE is the only figurative constant allowed for DBCS items. ═══ ═══ DELIMITED BY sets the limits of the string. ═══ ═══ Identifier-2 delimits the data to be transferred. Identifier-2 must have, explicitly or implicitly, USAGE DISPLAY. If identifier-1, identifier-2, identifier-3, literal-1, or literal-2 is a DBCS item, then all of them must be DBCS items. In that case, identifier-4 (the pointer field) indicates the relative DBCS character position, not the relative byte position, in the receiving field. ═══ ═══ SIZE transfers the complete sending area. ═══ ═══ Imperative-statement-1 is executed when the pointer value, explicit or implicit, is less than 1 or exceeds a value equal to the length of the receiving field. No more data is transferred when the condition is met. ═══ ═══ In Format 1, identifier must name an elementary numeric item. You can use floating-point data items and literals anywhere numeric data items and literals can be specified. ═══ ═══ In all formats, literal must be numeric. You can use floating-point data items and literals anywhere numeric data items and literals can be specified. ═══ ═══ In Format 2, identifier must name an elementary numeric item, unless the identifier follows the word GIVING, in which case it must name an elementary numeric or numeric-edited item. You can use floating-point data items and literals anywhere numeric data items and literals can be specified. ═══ ═══ In Format 3, identifier must name a group item. You can use floating-point data items and literals anywhere numeric data items and literals can be specified. ═══ ═══ Identifier-1 represents the sending field. Data is transferred from this field to the receiving fields. Identifier-1 may be an alphanumeric-edited or an alphabetic data item. It may also be a DBCS data item. ═══ ═══ Identifier-2 and identifier-3 each represent one delimiter and must be an alphanumeric or a DBCS data item. If either are DBCS items, both must be. ═══ ═══ Identifier-4 represents the data receiving fields. Each field must have USAGE DISPLAY. You can define these fields as alphabetic, alphanumeric, or numeric. Numeric items cannot have the symbol P in their picture string. Do not define this field as alphanumeric-edited or numeric-edited. Data is transferred to this field from the sending field. Identifier-4 can be a DBCS item, but it cannot be a floating point item. ═══ ═══ The DELIMITED BY phrase specifies delimiters within the data that controls the data transfer. If you do not specify the DELIMITED BY phrase, do not specify either the DELIMITER IN or the COUNT IN phrase. ═══ ═══ Literal-1 and literal-2 must be either nonnumeric literals or DBCS literals. If either are DBCS literals, both must be. Each may be any figurative constant except the ALL literal. When you specify a figurative constant, it is considered to be a 1-character nonnumeric literal. Only the figurative constant SPACE is allowed for DBCS literals. ═══ ═══ Unless you specify DELIMITED BY, you must not specify DELIMITER IN or COUNT. DELIMITER IN represents the delimiter-receiving fields. Identifier-5 must be alphanumeric. It can be a DBCS item. ═══ ═══ In the POINTER phrase, identifier-7 must be an integer data item defined without the symbol P in the PICTURE clause. It contains a value that indicates a relative position in the sending field. When you specify the POINTER phrase, you must initialize this field before beginning to execute the UNSTRING statement. When identifier-1 (the sending field) is a DBCS item, identifier-7 indicates the relative DBCS character position, not the relative byte position, in the sending field. ═══ ═══ With the TALLYING phrase, identifier-8 represents the field-count field. Identifier-8 is increased by the number of data receiving fields acted upon when executing the UNSTRING statement. When you specify identifier-8, you must initialize this field before the UNSTRING statement is executed. ═══ ═══ The COUNT IN phrase must be an integer item. Do not specify this phrase unless you also specify the DELIMITED BY phrase. Identifier-6 is the data-count field for each data transfer. Each field holds the count of examined characters in the sending field. It is terminated by the delimiters or the end of the sending field, for the move to this receiving field. The delimiters are not included in this count. When identifier-1 (the sending field) is a DBCS item, identifier-6 indicates the number of DBCS characters, not the number of bytes, examined in the sending field. ═══ ═══ The ON OVERFLOW imperative-statement-1 phrase is executed when:  The pointer value (explicit or implicit) is less than 1.  The pointer value (explicit or implicit) exceeds a value equal to the length of the sending field.  All data receiving fields have been acted upon, and the sending field still contains unexamined characters. ═══ ═══ Record-name-1 must be defined in a Data Division FD entry. Record-name-1 may be qualified, but must not be associated with a sort or merge file. Record-name-1 may define a floating point item or a DBCS item. If record-name-1 is a DBCS item, identifier-1 must be a DBCS item. ═══ ═══ FROM identifier-1 makes the WRITE statement equivalent to the execution of the following two statements: MOVE identifier-1 TO record-name-1 WRITE record-name-1 The MOVE is performed according to the rules for the MOVE statement without the CORRESPONDING phrase. Identifier-1 must be the name of a WORKING-STORAGE SECTION or LINKAGE SECTION entry, a record description for another previously opened file, or an alphanumeric function identifier. Identifier-1 may be a DBCS or floating-point data item. Identifier-1 and record-name-1 must not refer to the same storage area. After the WRITE statement has successfully executed, the logical record is still available in identifier-1. ═══ ═══ The ADVANCING phrase controls the positioning of the output record on the page. ═══ ═══ When you specify END-OF-PAGE, and the logical end of the printed page is reached during execution of the WRITE statement, the END-OF-PAGE imperative statement is executed. When END-OF-PAGE is specified, the FD entry for this file must contain a LINAGE clause. The logical end of the printed page is specified in the associated LINAGE clause. ═══ ═══ Identifier-2 must be an integer data item. ═══ ═══ Record-name-1 must be defined in a Data Division FD entry. It may be qualified, but must not be associated with a sort or merge file. The number of character positions in the record-name may be different from the number of character positions in the record being replaced. Record-name-1 may define a floating point item or a DBCS item. If record-name-1 is a DBCS item, identifier-1 must be a DBCS item. ═══ ═══ If you specify the NOT INVALID KEY phrase and a valid key condition exists at the end of the execution of the WRITE statement, control is passed to the imperative statement associated with this phrase. Click here for further information about the invalid key condition. ═══ ═══ Argument-1 must be class numeric. The value of argument-1 must be greater than or equal to -1 and less than or equal to +1. ═══ ═══ Argument-1 must be class numeric. The value of argument-1 must be greater than or equal to zero. Argument-2 must be a positive integer. ═══ ═══ Argument-1 must be class numeric. The value of argument-1 must be greater than or equal to -1 and less than or equal to +1. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be an integer. The value of argument-1 must be greater than zero and less than or equal to the number of positions in the collating sequence. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 is a positive integer that represents the number of days since December 31, 1600, in the Gregorian calendar. The valid range is 1 to 3,067,671. ═══ ═══ Argument-1 is a positive integer that represents a number of days succeeding December 31, 1600, in the Gregorian calendar. The valid range is 1 to 3,067,671 (December 31, 9999). ═══ ═══ Argument-1 must be an integer greater than or equal to zero and less than or equal to 28. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be an integer in the form YYYYMMDD whose value is (YYYY * 10000) + (MM * 100) + DD.  YYYY represents the year in the Gregorian calendar. It must be an integer greater than 1600, but not greater than 9999.  MM represents a month and must be a positive integer less than 13.  DD represents the day of the year. It must be a positive integer less than 32, provided that it is valid for the specific month and year combination. ═══ ═══ Argument-1 must be an integer in the form YYYYDDD whose value is obtained from the calculation (YYYY * 1000) + DDD.  YYYY represents the year in the Gregorian calendar. It must be an integer greater than 1600, but not greater than 9999.  DDD represents the day of the year. It must be a positive integer less than 367, provided it is valid for the year specified. ═══ ═══  Argument-1 must be class numeric.  If the value of the argument-1 is positive, the returned value is the greatest integer less than or equal to the value of argument specified.  If the value of argument-1 is negative, the returned value is the least integer greater than or equal to the value of argument-1.  If the value of argument-1 is zero, the returned value is zero. ═══ ═══  Argument-1 may be a non-numeric literal or a data item of any class or category (except DISPLAY-1).  If argument-1, or any data item subordinate to argument-1, is described with the DEPENDING phrase of the OCCURS clause, the contents of the data-name specified in the DEPENDING phrase is used at the time the LENGTH function is evaluated. ═══ ═══ Argument-1 must be class numeric. The value of argument-1 must be greater than zero. ═══ ═══ Argument-1 must be class numeric. The value must be greater than zero. ═══ ═══ Argument-1 must be class alphabetic or alphanumeric and must be at least 1 character in length. ═══ ═══ If more than one argument is specified, all arguments must be of the same class. The mixture of alphabetic and alphanumeric arguments is allowed. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ If more than one argument is specified, all arguments must be of the same class. The mixture of alphabetic and alphanumeric arguments is allowed. ═══ ═══ Argument-1 must be an integer. Argument-2 must be an integer, but must not be zero. ═══ ═══ Space is a string of one or more spaces. ═══ ═══ Digit is a string of one or more digits. The total number of digits must not exceed 18. ═══ ═══ Space is a string of one or more spaces. ═══ ═══ cs is the string of one or more characters specified by argument-2. At most, one copy of the characters specified by cs may occur in argument. ═══ ═══ Digit is a string of one or more digits. The total number of digits must not exceed 18. ═══ ═══ If you specify argument-2, it must be a nonnumeric literal or alphanumeric data item, subject to the following rules:  argument-2 must not contain any of the digits 0 through 9, any leading or trailing spaces, or any of the special characters + - . ,  argument-2 may be of any length valid for an elementary or group data item, including zero  matching of argument-2 is case-sensitive. For example, if you specify argument-2 as 'Dm', it will not match 'DM', 'dm' or 'dM'. If argument-2 is not specified, the character used for cs is the currency symbol specified for the program. ═══ ═══ Argument-1 must be 1 character in length and must be either alphabetic or alphanumeric. ═══ ═══ If more than one argument-1 is specified, all arguments must be of the same class. A combination of alphabetic and alphanumeric arguments is allowed. ═══ ═══ If more than one argument-1 is specified, all arguments must be of the same class. A combination of alphabetic and alphanumeric arguments is allowed. ═══ ═══ Argument-1 must be class numeric and must be greater than -1. ═══ ═══ Argument-2 must be class numeric. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-2 must be class numeric and must not be zero. ═══ ═══  Argument-1 must be class alphabetic or alphanumeric, at least one character in length.  If argument-1 is a character of length n, the returned value is a character string of length n such that, for 1 <= j <= n, the character in position j of the returned value is the character from position n-j+1 of argument-1. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be class numeric. The value must be zero or positive. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ Argument-1 must be class alphabetic or alphanumeric and must be at least 1 character in length. ═══ ═══ Argument-1 must be class numeric. ═══ ═══ BASIS may appear anywhere in columns 1 through 72, followed by basis-name. There must be no other text in the statement. ═══ ═══ Sequence-number may appear optionally in columns 1 through 6, followed by a space. The content of this field is ignored. ═══ ═══ Basis-name is the name by which the library entry is known to the control program. It must follow the rules for formation of a program-name. The first 8 characters of basis-name are used as the identifying name and must be unique within this library. ═══ ═══ Literal-1 is the name by which the library entry is known to the control program. The first 8 characters of literal-1 are used as the identifying name and must be unique within this library. Literal-1 must be nonnumeric and must follow the rules for formation of a program-name in the outermost program. ═══ ═══  Place the CBL(PROCESS) statement before the Identification Division header of an outermost program.  You may also specify the statement preceded by a sequence number in columns 1 through 6. The first character of the sequence number must be numeric, and CBL or PROCESS may begin in column 8 or after. However, if a sequence number is not specified, CBL or PROCESS may begin in column 1 or after.  The statement must not exceed beyond column 72, and options cannot be continued across multiple CBL (PROCESS) statements. However, you can use more than one CBL (PROCESS) statement. If you do use multiple statements, they must follow one another with no intervening statements of any other type. ═══ ═══  The options-list is a series of one or more compiler options, each one separated by a comma or a space.  Specify these options in the PARM field of the JCL or on the PROCESS statement in your program. Or, under TSO, specify options through parameters (arguments) on the command that starts the compilation. In addition, under CMS, compiler options can be specified with the COBOL2 command. ═══ ═══ Start the characters *CONTROL or *CBL in any column beginning with column 7, followed by at least one space or comma and one or more option key words. The option key words must be separated by one or more spaces or commas. This statement must be the only statement on the line, and continuation is not possible. The statement may be terminated with a period. ═══ ═══ Specify SOURCE in order to get a listing of the input source program lines. ═══ ═══ Specify NOSOURCE in order to suppress the printing of the source listing. ═══ ═══ Specify LIST in order to get a listing of generated object code. ═══ ═══ Specify NOLIST in order to suppress the listing of generated object code. ═══ ═══ Specify MAP in order to get a listing of storage map entries. ═══ ═══ Specify NOMAP in order to suppress the listing of storage map entries. ═══ ═══ Each COPY statement must be preceded by a space and ended with a separator period. A COPY statement may appear in the source program anywhere a character string or a separator may appear. However, a COPY statement must not be specified within a COPY statement. As an IBM extension, COPY statements can be nested. However, nested COPY statements cannot contain the REPLACING phrase, and a COPY statement with the REPLACING phrase cannot contain nested COPY statements. Also, a COPY statement may not cause recursion. That is, a COPY member may be named only once in a set of nested COPY statements until the end-of-file for that COPY member is reached. ═══ ═══ Text-name must follow the rules for formation of a program-name. The first 8 characters of text-name are used as the identifying name and must be unique within one COBOL library. ═══ ═══ Literal-1 must be nonnumeric and must follow the rules for the formation of a program-name in the outermost program. The first 8 characters of literal-1 are used as the identifying name and must be unique within one COBOL library. ═══ ═══ Library-name must follow the rules for formation of a program-name. The first 8 characters of library-name are used as the identifying name and must be unique within the system. ═══ ═══ Literal-2 must be nonnumeric and must follow the rules for the formation of a program-name in the outermost program. The first 8 characters of literal-2 are used as the identifying name and must be unique within the system. ═══ ═══ The SUPPRESS phrase specifies that the library text is not to be printed on the source program listing. ═══ ═══ Operand-1, operand-2 may be either pseudo-text, an identifier, a function-identifier, a literal, or a COBOL word other than COPY. ═══ ═══  Specify anywhere in columns 1 through 72. It must be followed by a space and the sequence-number-field. There must be no other text in the statement.  Source program statements may follow a DELETE statement.  New source program statements following the DELETE statement may include USAGE DISPLAY-1(DBCS) items. Note: If you use INSERT or DELETE statements to modify the COBOL source program provided by BASIS statement, the sequence field of the COBOL source program must contain numeric sequence-numbers in ascending order. Any INSERT or DELETE statements referring to these sequence-numbers must occur in ascending order. ═══ ═══  Each number must be equal to a sequence-number in the BASIS source program. This sequence number is the 6-digit number the programmer assigns in columns 1 through 6 of the COBOL coding form. The numbers referenced in the sequence-number-fields of any INSERT or DELETE statements must always be specified in ascending numeric order.  The sequence-number-field must be one of the following: - A single number - A series of single numbers - A range of numbers (indicated by separating the two bounding numbers of the range by a hyphen) - A series of ranges of numbers - Any combination of one or more single numbers and one or more ranges of numbers.  Each entry in the sequence-number-field must be separated from the preceding entry by a comma followed by a space. For example: 000250 DELETE 000010-0000050, 000400, 000450 ═══ ═══ You may optionally specify sequence-number in columns 1 through 6, followed by a space. The content of this field is ignored. ═══ ═══ May appear anywhere within columns 1 through 72, followed by a space and the sequence-number-field. There must be no other text in the statement. ═══ ═══  Each number must be equal to a sequence-number in the BASIS source program. This sequence-number is the 6-digit number the programmer assigns in columns 1 through 6 of the COBOL coding form.  The numbers that you reference in the sequence-number-fields of any INSERT or DELETE statements must always be specified in ascending numeric order.  The sequence-number-field must be a single number (for example, 000130). Follow the INSERT statement with at least one new source program statement for insertion after the statement number that you specify by the sequence-number-field. ═══ ═══ May optionally appear in columns 1 through 6, followed by a space. The content of this field is ignored. ═══ ═══  You may use the REPLACE statement anywhere in the source program where a character-string may occur. Precede it with a separator period, except when it is the first statement in a separately compiled program. End it with a separator period also.  If you use the word REPLACE in a comment-entry or in the place where a comment-entry may appear, it is considered part of the comment-entry.  You may use the REPLACE statement with DBCS literals and DBCS data names.  Lines containing *CONTROL(*CBL), EJECT, SKIP1/2/3, or TITLE statements may occur in source program text. Such lines are treated as comment lines during REPLACE statement processing. ═══ ═══  Pseudo-text-1 may contain one or more text words, or it may consist entirely of a separator comma or a separator semicolon. Character-strings may be continued.  Each matched occurrence of pseudo-text-1 in the source program is replaced by the corresponding pseudo-text-2.  Any individual character-string within pseudo-text may be up to 323 characters long.  The character-strings and separators comprising pseudo-text may start in either area A or area B. If, however, there is a hyphen in the indicator area of a line that follows the opening pseudo-text delimiter, area A of the line must be blank; the normal rules for continuation of lines apply to the formation of text words. Note Characters outside the standard COBOL character set should not appear in pseudo-text, other than as part of nonnumeric literals, comment lines, or comment-entries. ═══ ═══  Pseudo-text-2 may contain zero, one, or more text words. Character-strings may be continued.  Each matched occurrence of pseudo-text-1 in the source program is replaced by the corresponding pseudo-text-2.  Any individual character-string within pseudo-text may be up to 323 characters long.  The character-strings and separators comprising pseudo-text may start in either area A or area B. If, however, there is a hyphen in the indicator area of a line that follows the opening pseudo-text delimiter, area A of the line must be blank; the normal rules for continuation of lines apply to the formation of text words. NoteCharacters outside the standard COBOL character set should not appear in pseudo-text, other than as part of nonnumeric literals, comment lines, or comment-entries. ═══ ═══ The SERVICE LABEL statement may appear only in the Procedure Division; it may not appear in the Declaratives Section. At the statement that follows the SERVICE LABEL statement, all registers that may no longer be valid are reloaded. ═══ ═══ SKIP1 specifies that a single blank line is to be inserted in the source listing. You may write SKIP1 anywhere in either Area A or Area B, and you may end it with a separator period. It must be the only statement on the line. ═══ ═══ SKIP2 specifies that two blank lines are to be inserted in the source listing. You may write SKIP2 anywhere in either Area A or Area B, and you may end it with a separator period. It must be the only statement on the line. ═══ ═══ SKIP3 specifies that three blank lines are to be inserted in the source listing. You may write SKIP3 anywhere in either Area A or Area B, and you may end it with a separator period. It must be the only statement on the line. ═══ ═══  The word TITLE may begin in either Area A or Area B.  The TITLE statement may not be continued on another line.  The TITLE statement may appear anywhere in any of the divisions.  No other statement may appear on the same line as the TITLE statement. ═══ ═══  Literal must be nonnumeric and may be followed by a separator period.  Literal may be a DBCS literal.  Literal must not be a figurative constant. ═══ ═══ INPUT is valid for all files. When you specify INPUT, the procedure is executed for all files opened in INPUT mode or in the process of being opened in INPUT mode that get an error. ═══ ═══ OUTPUT is valid for all files. When you specify OUTPUT, the procedure is executed for all files opened in OUTPUT mode or in the process of being opened in OUTPUT mode that get an error. ═══ ═══ I-O is valid for all direct-access files. When you specify I-O, the procedure is executed for all files opened in I-O mode or in the process of being opened in I-O mode that get an error. ═══ ═══ EXTEND is valid for all files. When you specify EXTEND, the procedure is executed for all files opened in EXTEND mode, or in the process of being opened in EXTEND mode that get an error. ═══ ═══ File-name-1 is valid for all files. When you specify file-name-1, the procedure is executed only for the file(s) named. No file-name can refer to a sort or merge file. For any given file, only one EXCEPTION/ERROR procedure may be specified; thus, file-name specification must not cause simultaneous requests for execution of more than one EXECUTION/ERROR procedure. A USE AFTER EXCEPTION/ERROR declarative statement specifying the name of a file takes precedence over a declarative statement specifying the open mode of the file. ═══ ═══ When you specify INPUT, the user label procedures are executed only for files opened as INPUT. ═══ ═══ When you specify OUTPUT, the user label procedures are executed only for files opened as OUTPUT. ═══ ═══ When you specify I-O, the user label procedures are executed only for files opened as I-O. ═══ ═══ When you specify EXTEND, the user label procedures are executed only for files opened as EXTEND. ═══ ═══ For FILE, the designated procedures are executed at beginning-of-file (on the first volume) and/or at end-of-file (on the last volume) only. ═══ ═══ For REEL, the designated procedures are executed at beginning-of-volume (on each volume except the first) and/or at end-of-volume (on each volume except the last). REEL is not applicable to direct-access files. ═══ ═══ For UNIT, the designated procedures are executed at beginning-of-volume (on each volume except the first) and/or at end-of-volume (on each volume except the last). UNIT is not applicable to files in the random access mode because only FILE labels are processed in this mode. ═══ ═══ File-name-1 may appear in different specific arrangements of the format, but its appearance in a USE statement must not cause the simultaneous request for execution of more than one USE declarative. If used, it must not represent a sort file, and the file description entry must not specify a LABEL RECORDS ARE OMITTED clause. Within the procedures of a USE declarative in which USE specifies an option other than file-name-1, references to common label items do not need to be qualified by a file-name. A common label item is an elementary data item that appears in every label record of the program but does not appear in any data records of this program. Such items must have identical descriptions and positions within each label record. ═══ ═══  User labels follow standard file labels, and are to be processed.  The labels must be listed as data-names in the LABEL RECORDS clause in the file description entry for the file, and must be described as level-01 data items subordinate to the file entry.  If neither BEGINNING nor ENDING is specified, the designated procedures are executed for both beginning and ending reels.  If FILE, REEL, or UNIT is not included, the designated procedures are executed for both REEL or UNIT, whichever is appropriate, and for FILE labels. ═══ ═══ If neither BEGINNING nor ENDING is specified, the designated procedures are executed for both beginning and ending labels. ═══ ═══  Procedure-name-1 must not be defined in a debugging session.  Any given procedure-name may appear in only one USE FOR DEBUGGING sentence, and only once in that sentence. All procedures must appear in the outermost program. ═══ ═══ Procedure-name-1 must not be specified in any USE FOR DEBUGGING sentences. The ALL PROCEDURES phrase may be specified only once in a program. Only the procedures contained in the outermost program will trigger execution of the debugging section. ═══ ═══ ADV is meaningful only if you use WRITE...ADVANCING in your source code. ═══ ═══ Specify as a decimal number equal to, or greater than, 256. ═══ ═══ Specify as a decimal number in 1K increments. ═══ ═══  Use CMPR2 when you want the compiler to generate code compatible with code generated by VS COBOL II Release 2.  If you specify CMPR2, the following options will be ignored: - FLAGSTD - FLAGSAA - DBCS  If you specify CMPR2, the following options will be forced on: - NOFLAGSTD - NOFLAGSAA - NODBCS ═══ ═══ If you specify NOCMPR2, the FLAGMIG option is ignored, and the NOFLAGMIG option is forced on. ═══ ═══ Use the COMPILE option only if you want to force full compilation even in the presence of serious errors. ═══ ═══ Use NOCOMPILE without any subparameter to request a syntax check. ═══ ═══ Use NOCOMPILE with W, E, or S for conditional full compilation. When the compiler finds an error of the level you specify (or higher), full compilation (diagnosis and object code) will stop, and only syntax checking will continue.  The W (Warning; Return Code=4) error message indicates that although the statement in which the condition occurs is syntactically correct, it has the potential for causing an error when your program is executed.  The E (Error; Return Code=8) error message indicates that the condition is definitely an error. However, the compiler has tried to correct it for you, and it is possible that your program will execute properly.  The S (Severe; Return Code=12) error message indicates that the condition is a serious error. The compiler will not attempt to correct the error, but compilation will continue. ═══ ═══ If you specify both the CURRENCY option and the CURRENCY SIGN clause for a program, the CURRENCY SIGN clause coded in the source program takes precedence. ═══ ═══ Literal must be a one-character, nonnumeric literal (including hex literals) and must not be any of the following:  Digits zero (0) through nine (9).  Uppercase alphabetic characters A B C D P R S V X Z  Lowercase alphabetic characters a through z  The space  Special characters * + - / , . ; " ( )  A figurative constant  The non-printable characters represented by the hexadecimal values X'20' or X'21'  If the uppercase alphabetic character G (or N) is specified and the COBOL program defines a DBCS item, the G (or N) is considered a currency symbol in the PICTURE clause for the DBCS item; therefore the PICTURE clause will be invalid.  If the uppercase alphabetic character E is specified and the COBOL program defines an external floating-point item, the E is considered a currency symbol in the PICTURE clause for the external floating-point item; therefore the PICTURE clause will be invalid. Note: The CURRENCY option one-character literal may be delimited by either the quote or the apostrophe, regardless of the QUOTE/APOST compile-time setting. ═══ ═══ If you specify NOCURRENCY, or omit the CURRENCY option all together, then you can only use the dollar sign ($) as the currency symbol in the PICTURE clause. However, this does not apply if you have already established an alternate currency symbol with the CURRENCY SIGN clause in your source program or have changed the installation default value for the CURRENCY compile-time option. ═══ ═══ Use DATA(24) if your dynamic data areas are allocated from storage below 16 megabytes. Use DATA(24) for programs running under XA in 31-bit mode that are passing data parameters to programs in 24-bit mode. ═══ ═══ Use DATA(31) if your dynamic data areas are to be allocated from unrestricted storage. ═══ ═══  Specify DBCS to syntax-check the double-byte portion of the literal; the literal remains category alphanumeric.  If you specify DBCS, the FLAGMIG option is ignored, and the NOFLAGMIG option is forced on. ═══ ═══ If you specify DECK, make sure that SYSPUNCH is defined in your JCL for compilation. ═══ ═══ Use PRINT to specify that a program listing. as specified under the DISK option, is to be printed to your virtual printer. ═══ ═══ Use NOPRINT if you want no LISTING file to be produced. ═══ ═══ Use NODUMP if you want normal termination processing, including:  Diagnostic messages produced so far in compilation  A description of the error  The name of the compiler phase currently executing  The line number of the COBOL statement being processed when the error was found  The contents of the general purpose registers. ═══ ═══ DYNAM causes dynamic loads (for CALL) and deletes (for CANCEL) of separately compiled programs at object time. ═══ ═══ Use FLAG(x) to produce diagnostic messages for errors of severity level x or above at the end of the source listing. The following values are valid for x:  I (Informational; Return Code=0). The message is informational only.  W (Warning; Return Code=4). Although the statement in which the condition occurs is syntactically correct, it has the potential for causing an error when your program is executed.  E (Error; Return Code=8). The condition is definitely an error. However, the compiler has tried to correct it for you, and it is possible that your program will execute properly.  S (Severe; Return Code=12). The condition is a serious error. The compiler will not attempt to correct the error, but compilation will continue. ═══ ═══ Use FLAG (x,y) to produce diagnostic messages for errors of severity level x or above at the end of the source listing, with error messages of severity y and above to be embedded directly in the source listing. The severity coded for x must be lower than or equal to the severity coded for y. To use FLAG (x,y), also specify the SOURCE compiler option. The following values are valid for x and y:  I (Informational; Return Code=0). The message is informational only.  W (Warning; Return Code=4). Although the statement in which the condition occurs is syntactically correct, it has the potential for causing an error when your program is executed.  E (Error; Return Code=8). The condition is definitely an error. However, the compiler has tried to correct it for you, and it is possible that your program will execute properly.  S (Severe; Return Code=12). The condition is a serious error. The compiler will not attempt to correct the error, but compilation will continue. ═══ ═══ Specify FLAGSAA to indicate language elements that are not defined as part of the COBOL interface for IBM's Systems Application Architecture* (SAA*). To use FLAGSAA, the NOCMPR2 compiler option must be in effect, and FLAGSTD can not be specified. In addition, if you specify FLAGSAA, the FLAGMIG option is ignored and the NOFLAGMIG option is forced on. * Trademark of the IBM Corporation in the United States and/or other countries. ═══ ═══  Specify FLAGSTD to get informational messages about the Standard COBOL elements included in your program.  The NOCMPR2 compiler option must be in effect to use FLAGSTD.  If you specify FLAGSTD, the following options will be ignored: - FLAGSAA - FLAGMIG - DBCS  If you specify FLAGSTD, the following options will be forced on: - NOFLAGSAA - NOFLAGMIG - NODBCS ═══ ═══ x M, I, or H Specifies the level or subset of Standard COBOL to be regarded as conforming. M Specifies that the language elements that are not from the minimum subset are to be flagged as "nonconforming standard." I Specifies that language elements that are not from the minimum or the intermediate subset are to be flagged as "nonconforming standard." H Specifies that the high subset is being used and elements will not be flagged by subset, and that elements in the IBM extension category will be flagged as "non-conforming Standard IBM extension." ═══ ═══ yy D, N, or S Specifies, by a single character or combination of any two, the optional modules to be included in the subset. D Specifies that the elements from Debug module level 1 are not flagged as "nonconforming standard." N Specifies that elements from Segmentation module level 1 are not flagged as "nonconforming standard." S Specifies that elements from Segmentation module level 2 are not flagged as "nonconforming standard." N is a subset of S. ═══ ═══ O Specifies that obsolete language elements are flagged as "obsolete." ═══ ═══ XXxxxxxx specifies the language for compiler output messages. The following entries may be used for XXxxxxxx:  ENGLISH: The output will be printed in mixed case English. This is the default selection.  JAPANESE: The output will be printed in the Japanese language using the Japanese character set.  UENGLISH: The output will be printed in upper-case English. Note: To specify the Japanese language option, the Japanese Language Feature must be installed. ═══ ═══ For COPY and BASIS statements, include in your JCL DD statements for the library or libraries where the compiler can take the copied code, and also allocate and free SYSUT5. ═══ ═══ If you specify LINECOUNT (nnn), nnn must be an integer between 10 and 255, or 0. If you specify LINECOUNT (0), no page ejects are generated within the compilation listing. ═══ ═══ If you use LIST, you will get the following in your output listing:  Global tables  Literal pools  Information about Working-Storage  Size of the program's Working-Storage, and its location in the object code if the program is compiled with the NORENT option. LIST and OFFSET are mutually exclusive. If you use both, LIST is ignored. If you want to limit the assembler listing output, use *CONTROL LIST or NOLIST statements in your Procedure Division. ═══ ═══ Use MAP to produce a listing of items you defined in the Data Division. If you want to limit the MAP output, use *CONTROL MAP or NOMAP statements in your DATA Division. ═══ ═══ Use NAME to generate a link-edit NAME card for each object module; it may also be used to generate names for each load module when doing batch compilations. ═══ ═══ Use NAME (ALIAS) if your program contains ENTRY statements and you want to generate a link-edit ALIAS card for each statement. ═══ ═══ Use NUMBER to verify that columns 1 through 6 contain only numbers, and that the sequence follows the numeric collating sequence. Use NUMBER in conjunction with COPY statements only if your source program line numbers and the COPY member line numbers are coordinated. ═══ ═══ Use NONUMBER if you do not have line numbers in your source code, or if you want the compiler to ignore the line numbers contained in your source code. ═══ ═══ Use NUMPROC(PFD) only if your program adheres exactly to the following IBM system standards:  External decimal, unsigned--High-order 4 bits of the sign byte contain X'F'.  External decimal, signed overpunch--High-order 4 bits of the sign byte contain X'C' if the number is positive or 0, X'D' if it is not.  External decimal, separate sign--Separate sign contains the character '+' if the number is positive or 0, '-' if it is not.  Internal decimal, unsigned--Low-order 4 bits of the low-order byte contain X'F'.  Internal decimal, signed--Low-order 4 bits of the low-order byte contain X'C' if the number is positive or 0, X'D' if it is not. ═══ ═══ Use NUMPROC(NOPFD) or NUMPROC(MIG) if your COBOL program calls programs written in PL/I or FORTRAN. When NUMPROC(MIG) is in effect, the following processing occurs:  Preferred signs are created only on the output of MOVE statements and arithmetic operators.  No explicit sign repair is done on input.  Some implicit sign repair may occur during conversion.  Numeric comparisons are performed by a decimal compare, not a logical compare. ═══ ═══ If you specify OBJECT, include a SYSLIN DD statement in your JCL for compilation. NOOBJECT and TEST are mutually exclusive. If you use both, NOOBJECT is ignored. ═══ ═══ Use OFFSET to produce line numbers, statement references, and the location of the first instruction generated for each statement in the procedure portion of the listing. OFFSET and LIST are mutually exclusive. If you use both, LIST is ignored, and NOLIST is forced on. ═══ ═══ Because OPTIMIZE increases compile time, do not use this option when debugging. If you specify OPTIMIZE and TEST at the same time, the OPTIMIZE compiler option is ignored and NOOPTIMIZE is forced on, unless you specify TEST with a hook-location value of NONE. ═══ ═══ If you use COPY statements and SEQUENCE is in effect, be sure that your source program sequence fields and the COPY member sequence fields are coordinated. If you use NUMBER and SEQUENCE, the sequence is checked according to numeric, rather than EBCDIC collating sequence. ═══ ═══ Use NOSEQUENCE to suppress this checking and the diagnostic messages. ═══ ═══ nnnnn: A decimal number that must be at least 778240. ═══ ═══ nnnk: A decimal number in 1K increments. The minimum acceptable value is 760k. ═══ ═══ MAX: Requests the largest available block of storage in the user region for use during compilation. ═══ ═══ You must specify SOURCE if you want embedded messages in the source listing. ═══ ═══ Specify NOSOURCE to suppress the source code from the compiler output listing. ═══ ═══ Use SPACE only when SOURCE is in effect. ═══ ═══  When you specify TEST with or without any of the suboptions, the OBJECT compile-time option goes into effect.  When you specify TEST with a hook-location suboption other than NONE, the OPTIMIZE compiler option is ignored and the NOOPTIMIZE option is forced on.  The TEST option will be deactivated if you use both the WITH DEBUGGING MODE clause and the USE FOR DEBUGGING statement, unless you specify the hook-location suboption NONE. The TEST option will appear in the list of options, but a diagnostic will be issued to advise you that because of the conflict, TEST will not be in effect. ═══ ═══  When you specify TEST with a hook-location suboption other than NONE, the OPTIMIZE compiler option is ignored and the NOOPTIMIZE option is forced on.  The hook-location suboption controls where compiled-in hooks will be generated to provide information to Debug Tool.  Use TEST with any hook-location suboption except NONE to produce object code that can take full advantage of Debug Tool.  The hook-location suboptions are the following: ALL Specifies that hooks will be generated at all statements, all path points, and all program entry and exit points (both outermost and contained programs). NONE Specifies that no hooks will be generated. STMT Specifies that hooks will be generated at every statement and label, as well as at all program entry and exit points. PATH Specifies that hooks will be generated at all path points, including program entry and exit points. BLOCK Specifies that hooks will be generated at all entry and exit points. ═══ ═══  The symbol-table suboption controls whether symbol tables will be generated.  The symbol-table suboptions are the following: SYM Activates inclusion of symbolic dictionary information in your object program. NOSYM Deactivates inclusion of symbolic dictionary information in your object program.  Use TEST(,SYM) to have a symbolic dump of the variables included in the formatted dump produced by Language Environment/370. ═══ ═══ Programs compiled with TEST(NONE) or NOTEST will execute with Debug Tool. ═══ ═══ TRUNC(STD) causes the final result of an arithmetic expression, or the sending field in the MOVE statement to be truncated to the number of digits in the PICTURE clause of the BINARY receiving field. ═══ ═══ TRUNC(OPT) causes the compiler to assume that the data conforms to the number of digits in the PICTURE clause of the BINARY receiving field in MOVE statements and arithmetic expressions. Results are either truncated to the number of digits in the PICTURE clause or to the size of the BINARY field in storage (halfword, fullword, or doubleword). ═══ ═══ TRUNC(BIN) causes the full binary content of the BINARY field to be treated as significant. BINARY receiving fields are truncated only at halfword, fullword, or doubleword boundaries. BINARY sending fields are treated as halfwords, fullwords, or doublewords. ═══ ═══  If you specify WORD, the FLAGSTD option is ignored, and the NOFLAGSTD option is forced on.  See your systems programmer for the names of alternate reserved word tables.  Do not use intrinsic function-names as aliases for reserved words. ═══ ═══ The ending characters (xxxx) of the name of the reserved word table may be 1 to 4 characters in length. ═══ ═══ Use both XREF and XREF (FULL) to get a sorted cross-reference listing. If you use XREF and SOURCE, cross-reference information will also be printed on the same line as the original source in the listing. If you use XREF and NOSOURCE however, you will get only the sorted cross-reference listing. ═══ ═══ Use XREF (SHORT) to print only the explicitly referenced variables in the cross-reference listing; it applies to DBCS data names and procedure-names as well as EBCDIC names. ═══ ═══ Use NOXREF to suppress this listing. ═══ ═══ Use ZWB to direct the compiler to remove the sign from a signed external decimal (DISPLAY) field when comparing this field to an alphanumeric elementary field during run time. If the external decimal item is a scaled item (contains the symbol 'P' in its PICTURE character-string), its use in comparisons will not be affected by ZWB. ═══ ═══ Use NOZWB if you want to test input numeric fields for SPACES. ═══ ═══ This explicit scope terminator serves to delimit the scope of a statement. It permits the conditional form of the statement to be nested within another conditional statement. You can also use the explicit scope terminator with the imperative form of the statement.