═══ 1. COBOL/400 Language Help ═══ COBOL/400 Language Help includes the following topics. To view the help, select an entry in this list.  COBOL Source Program (Overall Format)  Identification Division  Environment Division  Data Division  Procedure Division  Procedure Division Statements  Compiler-Directing Statements ═══ 1.1. COBOL Source Program ═══ Description A COBOL source program is a syntactically correct set of COBOL statements. With the exception of the COPY statement, 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 the absence of additional source program lines. Here is the format for a separately compiled COBOL source program: ──┬──IDENTIFICATION DIVISION. ──┬────────────────────────── └──ID DIVISION. ──────────────┘ ──PROGRAM-ID. program-name.───────────────────────────────── ──┬───────────────────────────────────┬───────────────────── └──identification-division-content──┘ ──┬──────────────────────────────────────────────────────┬── └──ENVIRONMENT DIVISION. environment-division-content──┘ ──┬────────────────────────────────────────┬──────────────── └──DATA DIVISION. data-division-content──┘ ──┬──────────────────────────────────────────────────┬────── └──PROCEDURE DIVISION. procedure-division-content──┘ ═══ 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 first paragraph of the Identification Division must be the PROGRAM-ID paragraph. The other paragraphs are optional, but when written, must appear in the order shown in the format. ──┬──IDENTIFICATION DIVISION. ──┬─────────────────── └──ID DIVISION. ──────────────┘ ─PROGRAM-ID. program-name.─────────────────────────── ────┬─────────────────────────────────┬────────────── └──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 Here is the Environment Division format : ─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 Paragraph  OBJECT-COMPUTER Paragraph  SPECIAL-NAMES Paragraph 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  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. 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 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 system 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┬──┬─segment-number─────┘ └IS┘ ═══ PROGRAM COLLATING SEQUENCE IS ═══  The PROGRAM COLLATING SEQUENCE clause determines the collating sequence to be used in a COBOL program. The alphabet-name specifies the collating sequence.  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).  If you omit the PROGRAM COLLATING SEQUENCE clause, the EBCDIC collating sequence is used. ═══ SEGMENT-LIMIT IS ═══  Determines which segments will be considered permanent segments of the object program.  When you specify SEGMENT-LIMIT: - Permanent segments are those with segment-numbers less than the segment-number designated as the segment-limit. - Overlayable fixed segments have segment-numbers from the segment-limit through 49.  For example, if you specify SEGMENT-LIMIT IS 25: - Sections with segment-numbers 0 through 24 are permanent segments. - Sections with segment-numbers 25 through 49 are overlayable fixed segments.  If you omit the SEGMENT-LIMIT clause, all segments with segment-numbers 0 through 49 are permanent segments of the object program. ═══ 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.  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.  Specifies that ACCEPT or DISPLAY statements are treated as extended ACCEPT or DISPLAY statements.  Specifies additional functions associated with ACCEPT statements. ┌───────────────────────────────────────────────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────┤ │ ├NLSSORT───┘ │ │┌─────────────────────────────┐│ │ ││ └─literal-1┬──────────────────┬┴┘ ├┬THROUGH┬literal-2┤ │└THRU───┘ │ │ ┌──────────────┐ │ │  │ │ └──ALSO literal-3┴─┘ ┌─────────────────────────────────────────────────────────────┐  │ ──┬─────────────────────────────────────────────────────────────┼─── │ ┌──────────────────────────────────┐ │ │  │ │ └─CLASS class-name-1─┬──┬──literal-4┬───────────────────────┼─┘ └IS┘ └─┬─THROUGH─┬─literal-5─┘ └─THRU────┘ ──┬────────────────────────────┬──┬────────────────────────┬──────── └CURRENCY┌────┬┬──┬literal-6─┘ └─DECIMAL-POINT┬──┬COMMA─┘ └SIGN┘└IS┘ └IS┘ ──┬────────────────────┬───┬───────────────────────────┬──────────── └─CONSOLE─┬────┬─CRT─┘ └─CURSOR─┬────┬─data-name-1─┘ └─IS─┘ └─IS─┘ ──┬───────────────────────────────┬───────────────┬───┬───────────── └─CRT STATUS─┬────┬─data-name-2─┘ └─.─┘ └─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-name-1 Meaning Allowed In CSP Suppress spacing when WRITE printing a line C01 Skip to the next page. WRITE ATTRIBUTE-DATA Retrieve attribute data ACCEPT about a program device acquired by a transaction file I-O-FEEDBACK Give information about the ACCEPT last I-O operation on a file OPEN-FEEDBACK Give information about a file ACCEPT CONSOLE, Communicate with the system ACCEPT, DISPLAY SYSTEM-CONSOLE operator's message queue (QSYSOPR) LOCAL-DATA Retrieve data from, or move ACCEPT, DISPLAY data to the local data area PIP-DATA Retrieve data from the ACCEPT Program Initialization Parameters (PIP) data area for programs running as part of a prestart job REQUESTOR Communicate with the user ACCEPT, DISPLAY work station (interactive jobs) or the batch stream or job log (batch jobs) SYSIN The equivalent of REQUESTOR ACCEPT (for the ACCEPT statement only) SYSOUT The equivalent of REQUESTOR DISPLAY (for the DISPLAY statement only) ═══ Cond-1, Cond-2 ═══  Condition-names follow the rules for user-defined names. At least one 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. ═══ 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 the FD entry CODE-SET 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.  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 EBCDIC characters 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 EBCDIC sequence. - 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. - If you specify the figurative constants HIGH-VALUE and LOW-VALUE as literals in the SPECIAL-NAMES paragraph, they are associated with hex FF and hex 00 respectively. - 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. ═══ Literal-4, Literal-5 ═══  If numeric, literal-4 and literal-5 must be unsigned integers and must have a value from 1 through 256 (the maximum number of characters in the EBCDIC character set). The value of each literal corresponds to the ordinal position of each character in the EBCDIC collating series.  If nonnumeric, the literal is the actual EBCDIC character. 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-1.  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-1 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. ═══ data-name-1 ═══ Data-name-1 must be a 4- or 6-byte alphanumeric field or a 4- or 6-byte unsigned zoned integer field. If data-name-1 is 4 characters in length, interpret the first two characters as line number, and the second two as column number. If data-name-1 is 6 characters in length, interpret the first three characters as line number, and the second three as column number. The clause has no effect if data-name-1 contains an invalid position value, such as: zeros, a nonnumeric value, or a value that is beyond the range of the screen. Data-name-1 must be declared in the WORKING-STORAGE SECTION of the program. ═══ 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 medium, 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 keyword 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 five formats: - Sequential File Entries - Indexed File Entries - Relative File Entries - Sort or Merge File Entries - Transaction File Entries ═══ Sequential File Entries ═══ Description The FILE-CONTROL paragraph associates each file in the COBOL program with an external medium, and specifies file organization, access mode, and other information. Format 1 (Sequential File Entries) ───SELECT─────┬──────────┬─────────────file-name─────────── └─OPTIONAL─┘ ┌────────────────────┐  │ ──ASSIGN─┬──┬─┬──assignment-name-1─┼─────────────────────── └TO┘ └──literal-1─────────┘ ──┬──────────────────────────┬───────────────────────────── └─RESERVE integer─┬───────┬┘ ├─AREA──┤ └─AREAS─┘ ──┬────────────────────────────────┬─────────────────────── └─┬─────────────────┬─SEQUENTIAL─┘ └─ORGANIZATION┬──┬┘ └IS┘ ──────────┬────────────────────────────┬─────────────────── └─ACCESS┬────┬┬──┬SEQUENTIAL─┘ └MODE┘└IS┘ ───┬────────────────────────────────────────────┬──. ────── └┬────┬STATUS┬──┬data-name-1─┬─────────────┬─┘ └FILE┘ └IS┘ └─data-name-5─┘ ═══ Indexed File Entries ═══ Description The FILE-CONTROL paragraph associates each file in the COBOL program with an external medium, and specifies file organization, access mode, and other information. Format 2 (Indexed File Entries) ───SELECT──file-name───────────────────────────────────── ┌────────────────────┐  │ ──ASSIGN─┬──┬─┬──assignment-name-1─┼───────────────────── └TO┘ └──literal-1─────────┘ ────┬──────────────────────────┬───────────────────────── └─RESERVE integer─┬───────┬┘ ├─AREA──┤ └─AREAS─┘ ──┬─────────────────┬───INDEXED────────────────────────── └─ORGANIZATION┬──┬┘ └IS┘ ───┬────────────────────────────────┬──────────────────── └─ACCESS┬────┬┬──┬┬─SEQUENTIAL─┬─┘ └MODE┘└IS┘├─RANDOM─────┤ └─DYNAMIC────┘ ──RECORD──┬───┬──┬──┬──┬──EXTERNALLY-DESCRIBED-KEY──┬──── └KEY┘ └IS┘ └──data-name-2───────────────┘ ───┬───────────────────────┬───────────────────────────── └─┬──────┬──DUPLICATES──┘ └─WITH─┘ ──┬─────────────────────────────────────────────┬─. ───── └┬────┬STATUS┬──┬─data-name-1─┬─────────────┬─┘ └FILE┘ └IS┘ └─data-name-5─┘ ═══ Relative File Entries ═══ Description The FILE-CONTROL paragraph associates each file in the COBOL program with an external medium, and specifies file organization, access mode, and other information. Format 3 (Relative File Entries) ───SELECT───file-name─────────────────────────────────────── ┌────────────────────┐  │ ──ASSIGN─┬──┬─┬──assignment-name-1─┼──────────────────────── └TO┘ └──literal-1─────────┘ ────┬──────────────────────────┬──────────────────────────── └─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┘ ──┬────────────────────────────────────────────┬─. ───────── └┬────┬STATUS┬──┬data-name-1─┬─────────────┬─┘ └FILE┘ └IS┘ └─data-name-5─┘ ═══ Sort or Merge File Entries ═══ Description The FILE-CONTROL paragraph associates each file in the COBOL program with an external medium, and specifies file organization, access mode, and other information. Format 4 (Sort or Merge File Entries) ───SELECT───file-name──────────────────────────────────── ┌────────────────────┐  │ ──ASSIGN─┬──┬─┬──assignment-name-1─┼─. ────────────────── └TO┘ └──literal-1─────────┘ ═══ TRANSACTION File Entries ═══ Description The FILE-CONTROL paragraph associates each file in the COBOL program with an external medium, and specifies file organization, access mode, and other information. Format 5 (TRANSACTION File Entries) ───SELECT───file-name─────────────────────────────────────── ┌────────────────────┐  │ ──ASSIGN─┬──┬─┬──assignment-name-1─┼──────────────────────── └TO┘ └──literal-1─────────┘ ──┬─────────────────┬────TRANSACTION──────────────────────── └─ORGANIZATION┬──┬┘ └IS┘ ─┬─────────────────────────────────────────────────────────┬ └ACCESS┬────┬┬──┬┬SEQUENTIAL──────────────────────────────┤ └MODE┘└IS┘└DYNAMIC──RELATIVE─┬───┬┬──┬─data-name-3─┘ └KEY┘└IS┘ ──┬────────────────────────────────────────────┬──────────── └┬────┬STATUS┬──┬data-name-1─┬─────────────┬─┘ └FILE┘ └IS┘ └─data-name-5─┘ ──┬────────────────────────────────────┬─. ───────────────── └─CONTROL-AREA──┬────┬──data-name-6──┘ └─IS─┘ ═══ 1.10. ASSIGN Clause ═══ The ASSIGN clause associates a file with an external medium. For sort or merge files (associated with an SD entry), no external medium is used. The related ASSIGN clause is only validity checked and it is not used for I-O. Assignment-name-1 or literal-1 consists of three parts:  Device  File name  Attribute. The general structure is: ────device── -file-name──┬──────────────┬──── └─ -attribute──┘ ═══ ASSIGN Clause ═══ The ASSIGN clause associates the TRANSACTION file with a display file or ICF file through the use of assignment-name-1 or literal-1. Assignment-name-1 or literal-1 consists of three parts:  Device  File name  Attribute. The general structure is: ────device── -file-name──┬──────────────┬──── └─ -attribute──┘ ═══ 1.11. File-name ═══ -file-name must be an unhyphenated 1- through 10-character system name of the actual external file (physical or logical database, or device). You must create the external file before compiling the program, if the external file is used within the program by a COPY statement, DDS (data description specifications) or DD format. For database files, you cannot specify the member name in the program. If you want to specify a member other than the first member, you must use the Override with Database File (OVRDBF) CL command at execution time to specify that member name. This file name is the name of the AS/400 object that is displayed by the Display Program References (DSPPGMREF) command. Since no external medium is used for an SD file, the DSPPGMREF command does not list any files defined for an SD file. You can change the file name at execution time with the TOFILE parameter of the OVRxxxF CL command. For consistent results, ensure that the device type associated with the TOFILE parameter is the same as that specified for assignment-name-1 or literal-1. ═══ EXTERNALLY-DESCRIBED-KEY ═══  You can use the reserved word EXTERNALLY-DESCRIBED-KEY to specify that the keys for the file are those that are externally described in the data description specifications (DDS).  The keys are determined by the record formats that are copied by the COPY statement (DDS, DD, DDSR, or DDR format), under the file description (FD) for this file.  The key can start at different offsets within the buffer for each format. In this situation, you must be careful when changing from one record format to another using a random READ or START statement. You must place the key in the record format, at the correct offset in the format, that will be used in the random access of the file. Unpredictable results can occur if the key from the desired record is based on data that was part of the last record read. This is because the movement of data to the key field can involve overlapping records.  The key within a format can be made up of multiple, noncontiguous (not adjacent) fields. You should reference only those record formats copied in within the FD for the file with the FORMAT phrase. If you reference a format defined within the file, but that format has not been copied into the program, the key is built using key fields defined for the first record format copied. This can cause unpredictable results.  If a portion of the key is declared in the logical file only as an element of a concatenated item (rather than an independently-declared item), the result of the CONCAT operation must not be a variable-length item. ═══ Data-name-2 ═══  Data-name-2 represents the RECORD KEY data item. Describe it as an alphanumeric item within a record description entry associated with the file. The length of the record key is restricted; the key length, in characters, cannot exceed 120.  Data-name-2 may be a numeric item when the file is assigned to a DATABASE device type. The numeric item can have a usage of DISPLAY, COMP (COMP-3), COMP-4, PACKED-DECIMAL, or BINARY.  Data-name-2 may be qualified, but it must not be subscripted.  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 in DDS.  The record description that defines data-name-2 will always be used to access the record key field for the I-O operation. ═══ DUPLICATES Phrase ═══  The DUPLICATES phrase allows a file to have keys with the same values. You can only specify the DUPLICATES phrase for files assigned to DATABASE. If the file has multiple formats, two keys in different formats have the same values only when the key lengths and the contents of the keys are the same. For example: Format F1 with keys A, B, C Format F2 with keys A, B, D If fields C and D are the same length, have the same data type, and have the same values, the file contains two records with a duplicate key. The term duplicate key applies only to a complete record key for the format. A record key for the format consists of the key fields defined for a DDS format for records residing on the database. The term does not apply to the common key for the file (only fields A and B in the example).  You will receive a file status of 95 after a file has been successfully opened: - If you specify the DUPLICATES phrase in the COBOL program and the file was created with UNIQUE specified in the DDS. - If you do not specify the DUPLICATES phrase in the COBOL program and the file was created allowing nonunique keys. You can have unpredictable results if you process files when either of these conditions exist.  In a file that allows duplicates and is processed randomly or dynamically, the duplicate record that is updated or deleted must be the proper one. To ensure this, the last input/output statement processed prior to the REWRITE or DELETE operation must be a successfully processed READ statement without the NO LOCK phrase.  If you specify the DDS file level keyword LIFO (last-in-first-out). the duplicate records within a physical file are retrieved in a last-in-first-out order. ═══ Data-name-5 ═══ An optional status key data item may be specified for non-transaction and transaction file processing.  For non-transaction files, the data item must be a 6-byte group item. The item is treated as documentation for all non-transaction files except for those that are dynamically created.  For transaction files, the data item must be a 4-character alphanumeric item. ═══ Data-name-5 ═══ You must define data-name-5 in the Data Division as a 4-byte alphanumeric data item. You cannot define data-name-5 in the File Section. Data-name-5 identifies the extended-file-status data item, which contains major and minor return codes. The first 2 bytes of the extended-file-status data item contain the major return code, and the last 2 bytes contain the minor return code. Return codes are moved into data-name-5 after any input or output operation (except the ACCEPT or CLOSE statement) on the TRANSACTION file. In some cases, the major and minor return codes can indicate I/O errors when the file status code does not. The extended file status will have a value of zeros after you perform an I/O operation on an unopened file. ═══ Data-name-6 ═══  Data-name-6 is a CONTROL-AREA data item you must define in the LINKAGE SECTION or WORKING-STORAGE section.  Data-name-6 must be 2, 12, or 22 characters long. Based upon the length of data-name-6, the compiler assumes the availability of key feedback bytes, the program device name, and the record format.  The format for data-name-6 is : 01 data-name-6. 02 function-key PIC X(2). (Function key feedback field) 02 device-name PIC X(10). (Program device name) 02 record-format PIC X(10). (Record format)  For an ICF file, the actual name of a device may be different from the program device name. ═══ 1.12. 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 external media and the COBOL program. This paragraph is optional in a COBOL program.  The keyword 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 (Sequential Files) - Format 2 (Indexed and Relative Files) - Format 3 (Sort/Merge Files) ═══ I-O CONTROL Paragraph Format 1 (Sequential Files) ═══ Format 1 (Sequential Files) ──I-O-CONTROL───┬───────────────────────────────────────────────────── 1 └───────────────────────────────────────────────────── 2 1────────────────────────────────────────────────────────────────────── 1 ┌──────────────────────────────────────────────────────────────────── 4  2─┬──────────────────────────────────────────────────────────────────── 2 └─RERUN─┬──────────────────────────┬───────────────────────────────── 3 └─ON─┬─file-name-1───────┬─┘ └─assignment-name-1─┘ 1────────────────────────────────────────────────────────────────────── 1 4──────────────────────────────────────────────────┐ │ 2──────────────────────────────────────────────────┼─────────────────── 2 3─┬───────┬─integer-1───RECORDS─┬────┬─file-name-2─┘ └─EVERY─┘ └─OF─┘ 1────────────────────────────────────────────────────────────────────── 1 ┌────────────────────────────────────────────────────────────────┐  │ 2─┬────────────────────────────────────────────────────────────────┼─── 2 │ ┌───────────┐ │ │  │ │ └─SAME─┬────────┬──┬──────┬─┬─────┬─file-name-3───file-name-4─┴──┘ └─RECORD─┘ └─AREA─┘ └─FOR─┘ 1────────────────────────────────────────────────────────────────────── 1 ┌────────────────────────────────────────────────────────────────┐  │ 2─┬────────────────────────────────────────────────────────────────┼─┬─ 2 │ │ │ │ │ │ └─MULTIPLE FILE┬────┬─┬────────┬─file-name-5─┬───────────────────┼─┘ └TAPE┘ └CONTAINS┘ └POSITION──integer-2┘ 1───────────────────────────────────────────────────┬────────────────── 2─┬───────────────────────────────────────────┬──.──┘ │ ┌───────────┐ │ │  │ │ └─COMMITMENT CONTROL─┬─────┬─file-name-6─┴──┘ └─FOR─┘ ═══ I-O CONTROL Paragraph Format 2 (Indexed and Relative Files) ═══ Format 2 (Indexed and Relative Files) ──I-O-CONTROL───┬───────────────────────────────────────────────────── 1 └───────────────────────────────────────────────────── 2 1────────────────────────────────────────────────────────────────────── 1 ┌──────────────────────────────────────────────────────────────────── 4  2─┬──────────────────────────────────────────────────────────────────── 2 └─RERUN─┬──────────────────────────┬───────────────────────────────── 3 └─ON─┬─file-name-1───────┬─┘ └─assignment-name-1─┘ 1────────────────────────────────────────────────────────────────────── 1 4──────────────────────────────────────────────────┐ │ 2──────────────────────────────────────────────────┼─────────────────── 2 3─┬───────┬─integer-1───RECORDS─┬────┬─file-name-2─┘ └─EVERY─┘ └─OF─┘ 1────────────────────────────────────────────────────────────────────── 1 ┌────────────────────────────────────────────────────────────────┐  │ 2─┬────────────────────────────────────────────────────────────────┼─── 2 │ ┌───────────┐ │ │  │ │ └─SAME─┬────────┬──┬──────┬─┬─────┬─file-name-3───file-name-4─┴──┘ └─RECORD─┘ └─AREA─┘ └─FOR─┘ 1───────────────────────────────────────────────────┬────────────────── 2─┬───────────────────────────────────────────┬──.──┘ │ ┌───────────┐ │ │  │ │ └─COMMITMENT CONTROL─┬─────┬─file-name-6─┴──┘ └─FOR─┘ ═══ I-O CONTROL Paragraph Format 3 (Sort/Merge Files) ═══ Format 3 (Sort/Merge Files) ──I-O-CONTROL.────────────────────────────────────────────────────────── ─┬─────────────────────────────────────────────────────────────────────┬ │ ┌───────────────────────────────────────────────────────────────┐ │ │ │ ┌─────────────┐ │ │ │   │ │ │ └─SAME─┬────────────┬─┬──────┬┬─────┬─file-name-3─┬─────────────┼─┴───┘ ├─RECORD─────┤ └─AREA─┘└─FOR─┘ └─file-name-4─┘ ├─SORT───────┤ └─SORT-MERGE─┘ ═══ 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.  The SAME RECORD AREA clause allows you to transfer data from one file to another with no explicit data manipulation because the input/output record areas of the files are identical, and all are available to you. ═══ COMMITMENT CONTROL ═══  The COMMITMENT CONTROL clause specifies the files placed under commitment control when they are opened. Files under commitment control are affected by the COMMIT and ROLLBACK statements. - The COMMIT statement allows the synchronization of changes to database records while preventing other jobs from modifying those records until the COMMIT is complete. - The ROLLBACK statement provides a method of canceling changes made to database files when those changes should not be made permanent.  You can only specify files assigned to a device type of DATABASE with the COMMITMENT CONTROL clause.  Files under commitment control may have sequential, relative, or indexed organization, and may have any access mode for a particular organization.  The system locks records contained in files under commitment control when the records are accessed. Records remain locked until released by a COMMIT or ROLLBACK statement. ═══ 1.13. 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 Describes externally stored data (including sort-merge files). Working-Storage Section Describes internal data. Linkage Section Describes data made available by another program. ──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.14. Working-Storage Section ═══ Description The Working-Storage Section describes data records that are not part of external data files but are developed and processed internally. 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 maximum of 3 000 000 bytes are permitted for group items (including tables). A data description entry specifies the characteristics of a data item. A data description entry has four 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 4 (Boolean Data): Format 4 describes indicators as Boolean data items. ═══ 1.15. 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. A maximum of 3 000 000 bytes are permitted for group items (including tables). Like the Working-Storage Section, the Linkage Section has four 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 4 (Boolean Data): Format 4 describes indicators as Boolean data items. ═══ 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─┤ └─LIKE clause──────┘ ───┬────────────────────────┬─┬──────────────────┬─ └─BLANK WHEN ZERO clause─┘ └─JUSTIFIED clause─┘ ───┬───────────────┬──┬────────────────┬─────────── └─OCCURS clause─┘ └─PICTURE clause─┘ ───┬─────────────┬──┬─────────────────────┬──────── └─SIGN clause─┘ └─SYNCHRONIZED clause─┘ ───┬──────────────┬──┬──────────────┬────────────── └─USAGE clause─┘ └─VALUE clause─┘ ═══ 1.16. 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 keywords 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. ═══ 1.17. 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.18. 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. 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 items described with the USAGE IS INDEX clause or the USAGE IS POINTER clause. ───BLANK┬────┬────ZERO──────── └WHEN┘ ═══ 1.19. 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 can specify the JUSTIFIED clause for alphanumeric-edited items, but not for numeric or numeric-edited items. When you specify the JUSTIFIED clause for a receiving item, the data is aligned at the rightmost character position in the receiving item. Also:  If the sending item is larger that the receiving item, the leftmost characters are truncated.  If the sending item is smaller than the receiving item, the unused character positions at the left are filled with spaces. You cannot specify the JUSTIFIED clause:  In descriptions of items described with the USAGE IS INDEX clause or the USAGE IS POINTER clause.  For level-66 (RENAMES) and level-88 (condition-name) entries.  For variables greater than 32 767 characters. The JUSTIFIED clause does not affect initial values, as determined by the VALUE clause. ───┬──JUSTIFIED──┬─┬─────┬── └──JUST───────┘ └RIGHT┘ ═══ 1.20. 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. An item whose usage is POINTER can contain an OCCURS clause, or be subordinate to an item declared with an OCCURS clause. The OCCURS clause cannot be specified in a data description entry that has a level number of 01, 66, 77, or 88. 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 keyword 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. ═══ Format 2 (Variable-Length Tables) ═══ Description The OCCURS DEPENDING ON clause specifies variable-length tables. Format 2 (Variable-Length Tables) ──OCCURS──integer-1 TO integer-2───┬───────┬──────────── └─TIMES─┘ ──DEPENDING─┬────┬data─name─1─────────────────────────── └─ON─┘ ┌─────────────────────────────────────────────┐  │ ───┬─────────────────────────────────────────────┼─────── │ ┌───────────┐ │ │  │ │ └─┬─ASCENDING──┬─┬─────┬┬────┬─data─name─2─┴─┘ └─DESCENDING─┘ └─KEY─┘└─IS─┘ ───┬────────────────────────────────┬──────────────────── │ ┌────────────┐ │ │  │ │ └─INDEXED─┬────┬─index─name─1─┴──┘ └─BY─┘ ═══ 1.21. 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 or the subject of the RENAMES clause. 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, P, S, V, X, Z, 9, 1, 0, /, , (comma), . (period), +, -, CR, DB, *, and $. ───┬──PICTURE─┬─────┬────┬──character─string───────────── └──PIC─────┘ └─IS─┘ ═══ 1.22. 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.23. LIKE Clause ═══ Description The LIKE clause allows you to define the PICTURE, USAGE, and SIGN characteristics of a data item by copying them from a previously defined data item. It also allows you to make the length of the data item you define different from the original item. For Boolean data, you cannot change the length of the data item using this clause. You cannot use the LIKE clause to:  Change the length of an edited item  Change the length of an index  Change the number of decimal places in a data item. You can specify one or more other clauses before or after the LIKE clause:  JUSTIFIED  SYNCHRONIZED  BLANK WHEN ZERO  VALUE  OCCURS. You can specify BLANK WHEN ZERO only if it has not previously been inherited. You cannot use the LIKE clause with:  REDEFINES  SIGN  USAGE  PICTURE. ──────LIKE───data-name───┬───────────┬──────────────── └─(integer)─┘ ═══ 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 the SIGN clause only for a signed numeric data description 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. ──┬──────────────┬─┬─LEADING──┬─┬────────────────────┬─── └─SIGN──┬────┬─┘ └─TRAILING─┘ └SEPARATE─┬─────────┬─┘ └─IS─┘ └CHARACTER┘ ═══ SEPARATE CHARACTER Phrase ═══ If you specify the SEPARATE CHARACTER phrase:  The operational sign is presumed to be the LEADING or TRAILING character position, whichever you specify, of the elementary numeric data item. This character position is not a digit position.  The character S in the PICTURE character string is counted in determining the size of the data item (in terms of standard data format characters).  + is the character used for the positive operational sign.  - is the character used for the negative operational sign. If you do not specify the SEPARATE CHARACTER phrase:  The operational sign is presumed to be associated with the LEADING or TRAILING digit position, whichever you specify, of the elementary numeric data item. In this instance, specifying SIGN IS TRAILING is the equivalent of the standard action of the compiler.  The character S in the PICTURE character string is not counted in determining the size of the item (in terms of standard data format characters). ═══ 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 only at the elementary level. You cannot use it for group items. ───┬──SYNCHRONIZED──┬──┬─────────┬─────────────────────── └──SYNC──────────┘ ├──LEFT───┤ └──RIGHT──┘ The effect of the SYNCHRONIZED clause is dependent on the USAGE you specify for an item. If the USAGE is... The SYNCHRONIZED clause... DISPLAY is syntax-checked but does not affect execution PACKED-DECIMAL is syntax-checked but does not affect execution COMPUTATIONAL-3 is syntax-checked but does not affect execution BINARY: PIC S9(1) through S9(4) aligns the data item at a multiple of 2 relative to the beginning of the record PIC S9(5) through S9(18) aligns the data item at a multiple of 4 relative to the beginning of the record COMPUTATIONAL-4 functions the same as for USAGE BINARY COMPUTATIONAL is syntax-checked but does not affect execution INDEX is not permitted ═══ 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 at any level. 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─┬──┬┘ ├──COMPUTATIONAL────┤ └IS┘ ├──COMP─────────────┤ ├──COMPUTATIONAL-3──┤ ├──COMP-3───────────┤ ├──COMPUTATIONAL-4──┤ ├──COMP-4───────────┤ ├──DISPLAY──────────┤ ├──INDEX────────────┤ ├──PACKED-DECIMAL───┤ └──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 nonnumeric. If the item is Boolean, the VALUE clause must be a Boolean literal. 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 ranges of values with a condition-name. Each such condition-name requires a separate level-88 entry. 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 an address that is not valid to a pointer data item (an item defined as USAGE IS POINTER). The value of NULL is an undefined value. You can specify VALUE IS NULL only for elementary items that are described implicitly or explicitly as USAGE IS POINTER. NULL Value Clause ───VALUE┬──┬─┬──NULL───┬─── └IS┘ └──NULLS──┘ ═══ 1.28. Format 4 (Boolean Data) ═══ Description The Data Description Entry Format 4 (Boolean Data) describes the indicators you use in a COBOL program as Boolean data items. Boolean data items are items limited to a value of 1 or 0. Format 4 (Boolean Data) ───level-number──┬───────────────┬──┬──────────────────────────┬─── ├──data-name-1──┤ ├──REDEFINES──data-name-2──┤ └──FILLER───────┘ └──LIKE──data-name-3───────┘ ────┬───────────────────────────┬────────────────────────────────── └──┬──PICTURE──┬─┬────┬──1──┘ └──PIC──────┘ └─IS─┘ ────┬──────────────────────────────┬─────────────────────────────── └──┬───────────────┬──DISPLAY──┘ └──USAGE─┬────┬─┘ └─IS─┘ ──┬──────────────────────────────────────────────────────────────── 1 └─OCCURS─┬─integer-1 TO integer-2─┬───────┬────────────────────── 2 │ └─TIMES─┘ └─integer-2─┬───────┬─────────────────────────────────── 3 └─TIMES─┘ 1 ────────────────────────────────────────────────────────────────── 4 2 ───DEPENDING──┬────┬──data-name-4───┬───────────────────────────── 5 └─ON─┘ │ 3 ────────────────────────────────────┘ 4 ─────────────────────────────────────────────┬──────────────────── 5 ───┬──────────────────────────────────────┬──┘ │ ┌─────────────┐ │ │  │ │ └──INDEXED──┬────┬────index-name-1──┴──┘ └─BY─┘ ────┬───────────────────────────┬────────────────────────────────── └─┬─INDICATOR──┬──integer-3─┘ ├─INDICATORS─┤ └─INDIC──────┘ ────┬───────────────────────────────────┬────────────────────────── └──┬──SYNCHRONIZED──┬──┬─────────┬──┘ └──SYNC──────────┘ ├──LEFT───┤ └──RIGHT──┘ ────┬────────────────────────────┬───────────────────────────────── └──┬─JUSTIFIED─┬──┬───────┬──┘ └─JUST──────┘ └─RIGHT─┘ ────┬─────────────────────────────────┬──.───────────────────────── └──VALUE─┬────┬──boolean-literal──┘ └─IS─┘ ═══ 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. An item whose usage is POINTER can contain an OCCURS clause, or be subordinate to an item declared with an OCCURS clause. The OCCURS clause cannot be specified in a data description entry that has a level number of 01, 66, 77, or 88. When the OCCURS clause and the INDICATOR clause are both specified at an elementary level, a table of Boolean data items is defined with each element in the table corresponding to an external indicator. The first element in the table corresponds to the indicator number specified in the INDICATOR clause; the second element corresponds to the indicator that sequentially follows the indicator specified by the INDICATOR clause. For example, if you code: 07 SWITCHES PIC 1 OCCURS 10 TIMES INDICATOR 16. SWITCHES (1) corresponds to indicator 16, SWITCHES (2) corresponds to indicator 17, and similarly, SWITCHES (10) corresponds to indicator 25. ═══ 1.29. Data Division -- File and Sort Description Entries ═══ Description The File Section describes externally stored data. 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 six formats:  Format 1 (Formatfile, Database, Disk Files)  Format 2 (Diskette Files)  Format 3 (Tapefile Files)  Format 4 (Printer Files)  Format 5 (Sort/Merge Files)  Format 6 (Transaction Files) ═══ Format 1 (Formatfile, Database, Disk 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 (Formatfile, Database, Disk Files) ──FD file-name──────────────────────────────────────────────── ──┬────────────────────────────────────────────────────────┬─── └─BLOCK─┬────────┬┬────────────┬─integer-2─┬──────────┬──┘ └CONTAINS┘└integer-1 TO┘ ├CHARACTERS┤ └RECORDS───┘ ──┬─────────────────────────────────────────────────────────┬── └RECORD┬┬────────┬─integer-3─┬──────────┬───────────────┬─┘ │└CONTAINS┘ └CHARACTERS┘ │ └┬────────┬─integer-4 TO integer-5─┬──────────┬──┘ └CONTAINS┘ └CHARACTERS┘ ──┬────────────────────────────────────────┬─────────────────── └─LABEL─┬RECORD─┬──┬─┬──┬─STANDARD─────┬─┘ │ └IS┘ │ └─OMITTED──────┘ └RECORDS┬───┬┘ └ARE┘ ──┬──────────────────────────────────────────────┬───────────── │ ┌───────────────────────────────┐│ │  ││ └─VALUE OF────system-name-1┬──┬──┬─data-name-1┼┘ └IS┘ └─literal-1──┘ ─┬─────────────────────────────────────────┬──.──────────────── │ ┌───────────┐ │ │ v │ │ └─DATA─┬─RECORD──┬────┬──┬──data-name-2─┴─┘ │ └─IS─┘ │ └─RECORDS─┬─────┬─┘ └─ARE─┘ ═══ Format 2 (Diskette 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 (Diskette Files) ──FD file-name──────────────────────────────────────────────── ──┬────────────────────────────────────────────────────────┬─── └─BLOCK─┬────────┬┬────────────┬─integer-2─┬──────────┬──┘ └CONTAINS┘└integer-1 TO┘ ├CHARACTERS┤ └RECORDS───┘ ──┬─────────────────────────────────────────────────────────┬── └RECORD┬┬────────┬─integer-3─┬──────────┬───────────────┬─┘ │└CONTAINS┘ └CHARACTERS┘ │ └┬────────┬─integer-4 TO integer-5─┬──────────┬──┘ └CONTAINS┘ └CHARACTERS┘ ──┬────────────────────────────────────────┬─────────────────── └─LABEL─┬RECORD─┬──┬─┬──┬─STANDARD─────┬─┘ │ └IS┘ │ └─OMITTED──────┘ └RECORDS┬───┬┘ └ARE┘ ──┬──────────────────────────────────────────────┬───────────── │ ┌─────────────────────────────────┐│ │  ││ └─VALUE OF────system-name-1┬──┬──┬─data-name-1┼┘ └IS┘ └─literal-1──┘ ─┬─────────────────────────────────────────┬─────────────────── │ ┌───────────┐ │ │ v │ │ └─DATA─┬─RECORD──┬────┬──┬──data-name-2─┴─┘ │ └─IS─┘ │ └─RECORDS─┬─────┬─┘ └─ARE─┘ ─┬─────────────────────────────────┬──.──────────────────────── └─CODE-SET─┬────┬─alphabet-name-1─┘ └─IS─┘ ═══ Format 3 (Tapefile 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 3 (Tapefile Files) ──FD file-name──────────────────────────────────────────────── ──┬────────────────────────────────────────────────────────┬─── └─BLOCK─┬────────┬┬────────────┬─integer-2─┬──────────┬──┘ └CONTAINS┘└integer-1 TO┘ ├CHARACTERS┤ └RECORDS───┘ ──┬─────────────────────────────────────────────────────────┬── └RECORD┬┬────────┬─integer-3─┬──────────┬───────────────┬─┘ │└CONTAINS┘ └CHARACTERS┘ │ └┬────────┬─integer-4 TO integer-5─┬──────────┬──┘ └CONTAINS┘ └CHARACTERS┘ ──┬────────────────────────────────────────┬─────────────────── └─LABEL─┬RECORD─┬──┬─┬──┬─STANDARD─────┬─┘ │ └IS┘ │ └─OMITTED──────┘ └RECORDS┬───┬┘ └ARE┘ ──┬──────────────────────────────────────────────┬───────────── │ ┌─────────────────────────────────┐│ │  ││ └─VALUE OF────system-name-1┬──┬──┬─data-name-1┼┘ └IS┘ └─literal-1──┘ ─┬─────────────────────────────────────────┬─────────────────── │ ┌───────────┐ │ │ v │ │ └─DATA─┬─RECORD──┬────┬──┬──data-name-2─┴─┘ │ └─IS─┘ │ └─RECORDS─┬─────┬─┘ └─ARE─┘ ─┬─────────────────────────────────┬──.──────────────────────── └─CODE-SET─┬────┬─alphabet-name-1─┘ └─IS─┘ ═══ Format 4 (Printer 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 4 (Printer Files) ──FD file-name──────────────────────────────────────────────── ──┬────────────────────────────────────────────────────────┬─── └─BLOCK─┬────────┬┬────────────┬─integer-2─┬──────────┬──┘ └CONTAINS┘└integer-1 TO┘ ├CHARACTERS┤ └RECORDS───┘ ──┬─────────────────────────────────────────────────────────┬── └RECORD┬┬────────┬─integer-3─┬──────────┬───────────────┬─┘ │└CONTAINS┘ └CHARACTERS┘ │ └┬────────┬─integer-4 TO integer-5─┬──────────┬──┘ └CONTAINS┘ └CHARACTERS┘ ──┬────────────────────────────────────────┬─────────────────── └─LABEL─┬RECORD─┬──┬─┬──┬─STANDARD─────┬─┘ │ └IS┘ │ └─OMITTED──────┘ └RECORDS┬───┬┘ └ARE┘ ──┬──────────────────────────────────────────────┬───────────── │ ┌─────────────────────────────────┐│ │  ││ └─VALUE OF────system-name-1┬──┬──┬─data-name-1┼┘ └IS┘ └─literal-1──┘ ─┬─────────────────────────────────────────┬─────────────────── │ ┌───────────┐ │ │ v │ │ └─DATA─┬─RECORD──┬────┬──┬──data-name-2─┴─┘ │ └─IS─┘ │ └─RECORDS─┬─────┬─┘ └─ARE─┘ ─┬───────────────────────────────────────────────────────────── 1 └─LINAGE─┬────┬─data-name-3─┬─┬───────┬─────────────────────── 2 └─IS─┘ integer-6───┘ └─LINES─┘ 1 ─────────────────────────────────────────────────────────────── 3 2 ──┬───────────────────────────────────────┬──────────────────── 4 └┬──────┬─FOOTING─┬────┬─┬─data-name-4─┬┘ └─WITH─┘ └─AT─┘ └─integer-7───┘ 3 ──────────────────────────────────────────────────────────────┬ 4 ┬───────────────────────────┬─┬──────────────────────────────┬┘ └┬─────┬┬──┬TOP┬data-name-5┬┘ └┬─────┬┬──┬BOTTOM┬data-name-6┬┘ └LINES┘└AT┘ └integer-8──┘ └LINES┘└AT┘ └integer-9──┘ ─┬─────────────────────────────────┬──.──────────────────────── └─CODE-SET─┬────┬─alphabet-name-1─┘ └─IS─┘ ═══ Format 5 (Sort/Merge Files) ═══ Description The File Section must contain a level indicator for each input and output file. 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 5 (Sort/Merge Files) ────────SD file-name────────────────────────────────────────── ──┬─────────────────────────────────────────────────────────┬── └RECORD┬┬────────┬─integer-3─┬──────────┬───────────────┬─┘ │└CONTAINS┘ └CHARACTERS┘ │ └┬────────┬─integer-4 TO integer-5─┬──────────┬──┘ └CONTAINS┘ └CHARACTERS┘ ──┬───────────────────────────────────┬──.───────────────────── │ ┌───────────┐ │ │  │ │ └DATA─┬─RECORD─┬───┬┬─data-name-2─┴─┘ │ └IS─┘│ └─RECORDS┬───┬┘ └ARE┘ ═══ Format 6 (Transaction 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 6 (Transaction Files) ──FD file-name──────────────────────────────────────────────── ──┬─────────────────────────────────────────────────────────┬── └RECORD┬┬────────┬─integer-3─┬──────────┬───────────────┬─┘ │└CONTAINS┘ └CHARACTERS┘ │ └┬────────┬─integer-4 TO integer-5─┬──────────┬──┘ └CONTAINS┘ └CHARACTERS┘ ──┬────────────────────────────────────────┬─────────────────── └─LABEL─┬RECORD─┬──┬─┬──┬─STANDARD─────┬─┘ │ └IS┘ │ └─OMITTED──────┘ └RECORDS┬───┬┘ └ARE┘ ──┬───────────────────────────────────┬──.───────────────────── │ ┌───────────┐ │ │  │ │ └DATA─┬─RECORD─┬───┬┬─data-name-2─┴─┘ │ └IS─┘│ └─RECORDS┬───┬┘ └ARE┘ The AS/400 system only supports ASCII and ISO for tape and diskette files. Therefore, if the CODE-SET clause specifies a character code set of STANDARD-1 (ASCII), or STANDARD-2 (ISO) for a file that is not a tape or diskette file, a warning message is issued and the EBCDIC character set is used. ═══ 1.30. RECORD Clause ═══ The RECORD Clause has two 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. You must specify the record size as the number of character positions needed to store the record internally. That is, specify the number of bytes occupied internally by the characters of the record (not the number of characters used to represent the item within the record). The maximum record length for a file is 32 766. When one of the entries within a record description contains an OCCURS DEPENDING ON clause, the compiler calculates the record size as follows:  When you specify the Format 2 RECORD CONTAINS clause, the record is considered to have a variable size; varying from the size obtained for the minimum size of the variable-length item, to the value obtained for the maximum size of the variable-length item.  When you do not specify the RECORD CONTAINS clause, or if you specify the Format 1 RECORD CONTAINS clause, the compiler uses the maximum value of the variable-length item to calculate the record length. ───RECORD┬────────┬integer-4 TO integer-5─┬──────────┬ └CONTAINS┘ └CHARACTERS┘ ═══ 1.31. 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.32. 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 ─────section-name SECTION─┬─────────────────┬──.── └─segment-number──┘ where para is ┌────────────────────────────┐ │ │ ─────┬─┼────────────────────────────┼───────────── │  │ └─paragraph-name. ─┬───────────┤ │ ┌──────┐ │ │  │ │ └─sentence──┘ ═══ 1.33. Procedure Division (Format 2) ═══ Description The structure of the Procedure Division (Format 2) is as follows: ┌──────────────────────────┐  │ ─PROCEDURE DIVISION─┬──────────────────┬─. paragraph─name. ─┬─────────┼─ │ ┌──────────┐│ │┌───────┐│ │  ││ │ ││ └USING data─name─1┴┘ └sentence┴┘ ═══ 1.34. 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 names data items that are defined in any Data Division section.  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. - 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; it must not contain a REDEFINES clause.  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 maximum number of data-names that can be specified is 30. 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.35. 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 keyword DECLARATIVES. Write it on the line after the Procedure Division header. Specify the end of the group with the keywords END DECLARATIVES. The keywords 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 to 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 keywords END DECLARATIVES. ═══ 1.36. 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 INITIALIZE ACQUIRE INSPECT ADD MERGE ALTER MOVE CALL MULTIPLY CANCEL OPEN CLOSE PERFORM COMMIT READ COMPUTE RELEASE CONTINUE RETURN DELETE REWRITE DISPLAY ROLLBACK DIVIDE SEARCH DROP SET ENTER SORT EVALUATE START EXIT STOP EXIT PROGRAM STRING GOBACK SUBTRACT GO TO UNSTRING IF WRITE ═══ 1.37. 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 seven formats:  Format 1 (Data Transfer)  Format 2 (System Information Transfer)  Format 3 (Feedback)  Format 4 (Local Data Area)  Format 5 (PIP Data Area)  Format 6 (Attribute Data)  Format 7 (Workstation I/O) ═══ Format 1 (Data Transfer) ═══ Description Format 1 of the ACCEPT statement transfers data from an input/output device into the specified identifier. The incoming data is received in USAGE IS DISPLAY format. When you omit the FROM phrase, the ACCEPT statement obtains input from the job input stream for batch jobs, and from the workstation for interactive jobs. 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) ──ACCEPT identifier ──┬──────────────────────────────┬─────────────── └─FROM─┬──mnemonic─name─────┬──┘ └──environment─name──┘ ═══ Format 2 (System Information Transfer) ═══ Description Format 2 of the ACCEPT statement transfers system information contained in the specified conceptual data items DATE, DAY, or TIME into the identifier. The transfer must follow the rules for the MOVE statement without the CORRESPONDING phrase. Format 2 (System Information Transfer) ──ACCEPT identifier FROM──┬──DATE─────────┬─── ├──DAY──────────┤ └──TIME─────────┘ ═══ Format 3 (Feedback) ═══ Description Format 3 of the ACCEPT statement transfers feedback information from an active file to the identifier. Format 3 (Feedback) ──ACCEPT identifier FROM mnemonic-name─┬───────────────┬── └─FOR file-name─┘ ═══ Format 4 (Local Data Area) ═══ Description Format 4 of the ACCEPT statement transfers data to identifier-1 from the system-defined local data area created for the job. The move into identifier-1 takes place according to the rules for the MOVE statement for a group move without the CORRESPONDING phrase. There is only one local data area for each job, and all devices in a job access the same local data area. Format 4 (Local Data Area) ──ACCEPT identifier-1 FROM mnemonic-name───────────────── ───┬──────────────────────┬─────────────────────────────── └─FOR─┬─identifier-2─┬─┘ └─literal──────┘ ═══ Format 5 (PIP Data Area) ═══ Description Format 5 of the ACCEPT statement transfers data from the PIP (Program Initialization Parameters) data area into the identifier. The move into the identifier takes place according to the rules for the MOVE statement for a group move without the CORRESPONDING phrase. Format 5 (PIP Data Area) ──ACCEPT identifier FROM mnemonic-name─────────────────── ───┬───────────────────────────────────────────┬────────── └─┬────┬─EXCEPTION imperative-statement-1───┘ └─ON─┘ ───┬───────────────────────────────────────────────┬────── └─NOT─┬────┬─EXCEPTION imperative-statement-2───┘ └─ON─┘ ───┬────────────┬───────────────────────────────────────── └─END-ACCEPT─┘ ═══ Format 6 (Attribute Data) ═══ Description Format 6 of the ACCEPT statement retrieves information (attribute data) about a particular program device associated with a TRANSACTION file. You can only use this format of the ACCEPT statement for files with an organization of TRANSACTION. Program device attributes are moved into identifier-1 from the appropriate attribute data format, according to the rules for the MOVE statement for a group move without the CORRESPONDING phrase. The attribute data retrieved by the ACCEPT statement depends on whether the data and the associated fields are applicable to a workstation or to a communications device. Format 6 (Attribute Data) ──ACCEPT identifier-1 FROM mnemonic-name───────────────── ───┬─────────────────────────────────────────────┬──────── └─FOR─┬─identifier-2─┬──┬──────────────────┬──┘ └─literal-1────┘ └─FOR──file-name-1─┘ ═══ Format 7 (Workstation I/O) ═══ Description Format 7 of the ACCEPT statement (also known as the extended ACCEPT statement) provides input support for workstation I/O. An extended ACCEPT statement has one of the following:  an AT phrase  a FROM phrase with the CRT keyword  a MODE IS BLOCK phrase  a WITH phrase  an ON EXCEPTION phrase or a NOT ON EXCEPTION phrase, and PIP-DATA is not specified for mnemonic-name  no FROM phrase, but CONSOLE IS CRT is specified in the SPECIAL-NAMES paragraph. An ACCEPT statement is not an extended ACCEPT statement if it:  has a FROM phrase (except the FROM CRT phrase) and CONSOLE IS CRT is specified in the SPECIAL-NAMES paragraph, or  does not have a FROM phrase and CONSOLE IS CRT is not specified. Format 7 (Workstation I/O) ┌──────────────────────┐  │ ──ACCEPT──identifier-1──┬──────────────────────┼───────── ├─line-col-phrase──────┤ │ │ ├─FROM CRT─────────────┤ │ │ ├─MODE──┬────┬──BLOCK──┤ │ └─IS─┘ │ │ │ └─with-phrase──────────┘ ───┬───────────────────────────────────────────┬────────── └─┬────┬─EXCEPTION imperative-statement-1───┘ └─ON─┘ ───┬───────────────────────────────────────────────┬────── └─NOT─┬────┬─EXCEPTION imperative-statement-2───┘ └─ON─┘ ───┬────────────┬───────────────────────────────────────── └─END-ACCEPT─┘ where line-col-phrase is: ┌──────────────────────────────────────┐  │ ──┬──┬────┬─┬─LINE──┬────────┬──┬─identifier-2─┬───┼──┬── │ └─AT─┘ │ └─NUMBER─┘ └─integer-1────┘ │ │ │ │ │ │ │ └─┬─COLUMN─┬─┬────────┬─┬─identifier-2─┤ │ │ └─COL────┘ └─NUMBER─┘ └─integer-1────┘ │ │ │ └──AT──┬─identifier-3─┬─────────────────────────────┘ └─integer-2────┘ where with-phrase is: ┌─────────────────────────────────────────────┐  │ ──WITH──┬─┬─AUTO──────┬───────────────────────────────┼── │ └─AUTO-SKIP─┘ │ │ │ ├─┬─BELL─┬────────────────────────────────────┤ │ └─BEEP─┘ │ │ │ ├───BLINK─────────────────────────────────────┤ │ │ ├─┬─FULL─────────┬────────────────────────────┤ │ └─LENGTH-CHECK─┘ │ │ │ ├───HIGHLIGHT─────────────────────────────────┤ │ │ ├─┬─REQUIRED────┬─────────────────────────────┤ │ └─EMPTY-CHECK─┘ │ │ │ ├───REVERSE-VIDEO─────────────────────────────┤ │ │ ├─┬─SECURE──┬─────────────────────────────────┤ │ └─NO-ECHO─┘ │ │ │ ├───UNDERLINE─────────────────────────────────┤ │ │ ├───RIGHT-JUSTIFY─────────────────────────────┤ │ │ ├───SPACE-FILL────────────────────────────────┤ │ │ ├───TRAILING-SIGN─────────────────────────────┤ │ │ ├───UPDATE────────────────────────────────────┤ │ │ ├───ZERO-FILL─────────────────────────────────┤ │ │ ├───SIZE──┬────┬──┬─identifier-4─┬────────────┤ │ └─IS─┘ └─integer-3────┘ │ │ │ ├───PROMPT──┬──────────────┬─┬─identifier-5─┬─┤ │ └─CHARACTER IS─┘ └─literal──────┘ │ │ │ ├─┬─FOREGROUND-COLOR──┬─┬────┬─integer-4──────┤ │ └─FOREGROUND-COLOUR─┘ └─IS─┘ │ │ │ ├─┬─BACKGROUND-COLOR──┬─┬────┬─integer-5──────┤ │ └─BACKGROUND-COLOUR─┘ └─IS─┘ │ │ │ └───LEFT-JUSTIFY──────────────────────────────┘ ═══ 1.38. ACQUIRE Statement ═══ Description The ACQUIRE statement acquires a program device for a TRANSACTION file. Successful completion of the ACQUIRE operation makes the program device available for input and output operations. If the ACQUIRE is unsuccessful, the file status is set to 9H and any applicable USE AFTER EXCEPTION/ERROR procedure is invoked. Format-TRANSACTION ───ACQUIRE──┬─identifier─┬──FOR──file-name────────────── └─literal────┘ ═══ 1.39. 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 keyword 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. The composite of operands in an arithmetic statement can have a maximum length of 30 digits. In Format 1, the composite of operands is determined by using all of the operands in a given statement. 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. The composite of operands in an arithmetic statement can have a maximum length of 30 digits. In Format 2, the composite of operands is determined by using all of the operands in a given statement excluding the data items that follow the word GIVING. 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. The composite of operands in an arithmetic statement can have a maximum length of 30 digits. In Format 3, the composite of operands is determined separately for each pair of corresponding data items. 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.40. 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 ANSI 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.41. 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. Processing of the CALL statement passes control to the first nondeclarative instruction of the called subprogram. Control returns to the calling program at the instruction following the CALL statement. Called subprograms can contain CALL statements; however, a called subprogram must not itself execute a CALL statement that directly or indirectly calls the calling program.  Format 1 (CALL ON OVERFLOW)  Format 2 (CALL ON EXCEPTION) You can also use the CALL statement to access OS/400 graphics routines:  CALL GDDM ═══ Format 1 (CALL ON OVERFLOW) ═══ 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 ON OVERFLOW) ──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───┬─────────────────┘ └─file-name-1─┘ ──┬──────────────────────────────────────┬──────────────────────── └─┬──┬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───┬─────────────────┘ └─file-name-1─┘ ──┬───────────────────────────────────────────┬────────────────── └─┬────┬──EXCEPTION imperative-statement-1──┘ └─ON─┘ ──┬────────────────────────────────────────────────┬───────────── └──NOT─┬────┬──EXCEPTION imperative-statement-2──┘ └─ON─┘ ──┬────────────┬───────────────────────────────────────────────── └──END─CALL──┘ ═══ 1.42. CALL GDDM ═══ Description You can use the CALL statement to access the following OS/400 graphics routines:  Graphical Data Display Manager (GDDM), a set of graphics primitives for drawing pictures  Presentation Graphics Routines (PGR), a set of business charting routines. You access all these graphics routines with the same format of the CALL statement. CALL GDDM ┌─────────────┐  │ ──CALL "GDDM" USING───routine-name──┬─────────────┼───── └─data-name-1─┘ ═══ 1.43. CANCEL Statement ═══ Description The CANCEL statement ensures that the next time the referenced subprogram is called, it will be entered in its initial state. A CANCEL statement:  Closes all open files  Operates only on the program specified, and not on any program that may have been called by the canceled program. No action is taken when you use a CANCEL statement to cancel the following types of programs:  A program that has not been called in the run unit  A program that has been called and subsequently canceled. Called subprograms may contain CANCEL statements. However, recursive calls are not allowed; a called subprogram must not contain a CANCEL statement that directly or indirectly cancels the calling program itself, or any other program higher than itself in the calling hierarchy. In this case, control passes to the next statement. ┌────────────────┐ │ │  │ ────CANCEL──┬──identifier─1──┼─────────────────────────── └──literal─1─────┘ ═══ 1.44. CLOSE Statement ═══ Description The CLOSE statement terminates the processing of volumes and files, with optional rewind and/or lock or removal, where applicable.  Format 1 (Sequential Files)  Format 2 (Indexed and Relative Files)  Format 3 (Transaction Files) ═══ Format 1 (Sequential 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. After successful execution of the CLOSE statement without the REEL/UNIT phrase:  The record area associated with the file-name is no longer available. Unsuccessful execution of a CLOSE statement leaves availability of the record data undefined.  An OPEN statement for the file must be executed before any other input/output statement. Format 1 (Sequential Files Format) ┌──────────────────────────────────────────────────────┐  │ ──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─┘ ═══ Format 3 (Transaction 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 3 (Transaction Files Format) ┌─────────────────────────────────┐  │ ──CLOSE file─name─1─┬─────────────────────┼──────────────────────── └────┬──────┬───LOCK──┘ └─WITH─┘ ═══ 1.45. COMMIT Statement ═══ Description The COMMIT statement provides a way of synchronizing changes to data base records while preventing other jobs from modifying those records until the COMMIT is performed. When the COMMIT statement is executed, all changes made to files under commitment control since the previous commitment boundary are made permanent. A commitment boundary is established by the successful execution of a ROLLBACK or COMMIT statement. If no COMMIT or ROLLBACK has been issued in the current job, a commitment boundary is established by the first OPEN of any file under commitment control in the job. Changes are made to all files under commitment control in the job, not just to files under commitment control in the COBOL program that issues the COMMIT statement. When a COMMIT is executed, all record locks held by the job since the last commitment boundary for files under commitment control are released and the records become available to other jobs. The COMMIT statement only affects files under commitment control. If a COMMIT is executed and there are no files opened under commitment control, the COMMIT statement has no effect and no commitment boundary is established. The COMMIT statement does not:  Modify the I-O-FEEDBACK area for any file  Change the file position indicator for any file  Set a file status value for any file. ───COMMIT────────────────────────────────── ═══ 1.46. 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───────────────────────────── ───┬────────────────────────────────────────────┬───────── └─┬────┬──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 or literal allows you to set the value of the data items referenced by identifier-1 equal to the value of that identifier or literal. Click here for a description of arithmetic expressions. ═══ 1.47. 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.48. 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. After successful execution of a DELETE statement, the record is logically removed from the file and can no longer be accessed. Execution of the DELETE statement does not affect the contents of the record area associated with the file-name. If you specified the FILE STATUS clause in the File-Control entry, the associated status key is updated when the DELETE statement is executed. The file position indicator is not affected by the processing of the DELETE statement. ───DELETE file-name────┬────────┬──────────────────────── └─RECORD─┘ ───┬────────────────────────────────┬───────────────────── └─FORMAT─┬────┬─┬─identifier-1─┬─┘ └─IS─┘ └─literal-1────┘ ───┬─────────────────────────────────────────────────┬──── └─INVALID───┬─────┬───imperative-statement-1──────┘ └─KEY─┘ ───┬─────────────────────────────────────────────────┬──── └─NOT INVALID───┬─────┬───imperative-statement-2──┘ └─KEY─┘ ───┬────────────┬───────────────────────────────────────── └─END-DELETE─┘ ═══ INVALID KEY/NOT INVALID KEY ═══ You must specify the INVALID KEY phrase for files for which an applicable EXCEPTION/ERROR procedure is not specified. After processing of a DELETE statement for which a NOT INVALID KEY phrase has been specified, control transfers to imperative-statement-2. For files in sequential access mode, the INVALID KEY and NOT INVALID KEY phrases must not be specified; however, an EXCEPTION/ERROR procedure may be specified. For files in random or dynamic access mode, the results of DELETE statement execution depend on whether the file organization is indexed or relative:  For files with indexed organization, the system logically removes the record identified by the contents of the RECORD KEY data item. If the file does not contain such a record, an INVALID KEY condition exists.  For files with relative organization, the system logically removes the record identified by the contents of the RELATIVE KEY data item. If the file does not contain such a record, an INVALID KEY condition exists. The space is then available for a new record with the same RELATIVE KEY value. 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.49. DISPLAY Statement ═══ Description The DISPLAY statement transfers the contents of each operand to the output device or system defined local data area. The contents are displayed in the order from left to right in which the operands are listed. The DISPLAY statement has three formats:  Format 1 (Data Transfer)  Format 2 (Local Data Area)  Format 3 (Workstation I/O) ═══ Format 1 (Data Transfer) ═══ Description Format 1 of the DISPLAY statement transfers the data in the sending field to the output device. The size of the sending field is the total character count of all operands listed. If the hardware device is capable of receiving data of the same size as the data item being transferred, then the data item is transferred. If the hardware device is not capable of receiving data of the same size as the data item being transferred, then one of the following applies:  If the total character count is less than the device maximum logical record size, the remaining rightmost characters are padded with spaces.  If the total character count exceeds the maximum, as many records are written as are needed to display all operands. Any operand being printed or displayed when the end of a record is reached is continued in the next record. After the last operand has been transferred to the output device, the device is reset to the leftmost position of the next line of the device. Format 1 (Data Transfer) ┌──────────────┐  │ ──DISPLAY──┬─identifier─1─┼────────────────────────────── └─literal─1────┘ ───┬─────────────────────────────┬──────────────────────── └┬──────┬─┬─mnemonic─name────┬┘ └─UPON─┘ └─environment─name─┘ ═══ 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 to be displayed. For example, if SIGN WITH SEPARATE CHARACTER is not specified and two numeric items have the values -34 and 34, they are displayed as 3M and 34 respectively. If SIGN WITH SEPARATE CHARACTER is specified, a + or a - sign is displayed as either leading or trailing, depending on how the number was specified. Note: Group items containing packed or binary data (COMP, COMP-3, PACKED-DECIMAL, BINARY, or COMP-4) should not be displayed on a display station. Such data can contain display station control characters which can cause undesirable and unpredictable results.  No other identifiers require conversion. ═══ Format 2 (Local Data Area) ═══ Description Format 2 of the DISPLAY statement transfers data to the system-defined area created for the job. The data is written to the local data area according to the rules for the MOVE statement for a group move without the CORRESPONDING phrase, and without padding on the right with spaces. There is only one local data area for each job, and all devices in a job access the same local data area. Format 2 (Local Data Area) ┌──────────────┐  │ ──DISPLAY──┬─identifier─1─┼──UPON───mnemonic-name──────── └─literal─1────┘ ───┬────────────────────────┬───────────────────────────── └┬─────┬─┬─identifier-2─┬┘ └─FOR─┘ └─literal-2────┘ ═══ Format 3 (Workstation I/O) ═══ Description Format 3 of the DISPLAY statement (also known as the extended DISPLAY statement) provides output support for workstation I/O. An extended DISPLAY statement has one of the following:  an AT phrase  an UPON phrase with CRT or CRT-UNDER  a MODE IS BLOCK phrase  a WITH phrase  no UPON phrase, but CONSOLE IS CRT is specified in the SPECIAL-NAMES paragraph. A DISPLAY statement is not an extended DISPLAY statement if it:  has an UPON phrase (except the UPON CRT/CRT-UNDER phrase)  does not have an UPON phrase and CONSOLE IS CRT is not specified in the SPECIAL-NAMES paragraph. Format 3 (Workstation I/O) ┌──────────────────────┐  │ ──DISPLAY──┬─┬─identifier-1─┬─────┼────────────────────── │ └─literal-1────┘ │ │ │ ├─line-col-phrase──────┤ │ │ ├─UPON─┬─CRT───────┬───┤ │ └─CRT-UNDER─┘ │ │ │ ├─MODE──┬────┬──BLOCK──┤ │ └─IS─┘ │ │ │ └─with-phrase──────────┘ where line-col-phrase is: ┌──────────────────────────────────────┐  │ ──┬──┬────┬─┬─LINE──┬────────┬──┬─identifier-2─┬───┼──┬── │ └─AT─┘ │ └─NUMBER─┘ └─integer-1────┘ │ │ │ │ │ │ │ └─┬─COLUMN─┬─┬────────┬─┬─identifier-2─┤ │ │ └─COL────┘ └─NUMBER─┘ └─integer-1────┘ │ │ │ └──AT──┬─identifier-3─┬─────────────────────────────┘ └─integer-2────┘ where with-phrase is: ┌─────────────────────────────────────────────┐  │ ──WITH──┬─┬─BELL─┬────────────────────────────────────┼── │ └─BEEP─┘ │ │ │ ├───BLINK─────────────────────────────────────┤ │ │ ├───HIGHLIGHT─────────────────────────────────┤ │ │ ├───REVERSE-VIDEO─────────────────────────────┤ │ │ ├───UNDERLINE─────────────────────────────────┤ │ │ ├───BLANK──┬─SCREEN─┬─────────────────────────┤ │ └─LINE───┘ │ │ │ ├───SIZE──┬────┬──┬─identifier-4─┬────────────┤ │ └─IS─┘ └─integer-3────┘ │ │ │ ├─┬─FOREGROUND-COLOR──┬─┬────┬─integer-4──────┤ │ └─FOREGROUND-COLOUR─┘ └─IS─┘ │ │ │ └─┬─BACKGROUND-COLOR──┬─┬────┬─integer-5──────┘ └─BACKGROUND-COLOUR─┘ └─IS─┘ ═══ Identifier-1, Literal-1 ═══ Identifier-1 and literal-1 are data items whose value may be displayed. If identifier-1 is a group item and there is no MODE IS BLOCK phrase, those elementary subordinate items that have names other than FILLER are displayed. They are displayed simultaneously, and positioned on the screen in the order that their descriptions appear in the DATA DIVISION, separated by the lengths of the FILLER items in the group. For this purpose, the first position on a line is regarded as immediately following the last position on the previous line. When items are separated by FILLERs, the attribute bytes are included in the FILLER length. Thus a FILLER of one or two bytes would contain both the trailing and leading attributes of separate items. In the case of a one-byte FILLER, the trailing and leading attributes would occupy the same byte. Since data items are normally separated by one attribute byte, one-byte FILLERs are not necessary. Identifiers or literals in a DISPLAY statement follow one after another, separated by one attribute byte, unless an AT, LINE, or COLUMN phrase is specified. If no AT, LINE, or COLUMN phrase appears in the statement, the first identifier or literal begins at line 1, column 2, followed immediately by all other identifiers or literals. The phrases following the identifier or literal can be in any order. All phrases specified apply to the previous identifier or literal, if one was specified. The WITH and MODE phrases cannot be specified if an identifier or literal was not previously specified. If identifier-1 or literal-1 is not specified, neither the MODE IS BLOCK phrase nor the WITH phrase is allowed. If no identifier or literal is present, the DISPLAY operation changes the screen position without actually displaying any data. ═══ 1.50. DIVIDE Statement ═══ Description The DIVIDE statement divides one numeric data item into/by others and sets the values of data items equal to the quotient and remainder.  Format 1 (DIVIDE)  Format 2 (DIVIDE INTO, GIVING)  Format 3 (DIVIDE BY, GIVING)  Format 4 (DIVIDE INTO, GIVING, with REMAINDER)  Format 5 (DIVIDE BY, 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 of identifier-2; the quotient is then placed in identifier-2. This process is repeated for each successive occurrence. 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 INTO, GIVING) ═══ Description In Format 2, the value of identifier-1 or literal-1 is divided into 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 INTO, GIVING) ──DIVIDE──┬──identifier-1──┬─────INTO────┬─identifier-2─┬ └──literal-1─────┘ └─literal-2────┘ ┌─────────────────────────┐  │ ──GIVING identifier-3──┬───────────┼────────────────────── └──ROUNDED──┘ ────┬──────────────────────────────────────────────┬────── └──┬────┬───SIZE ERROR imperative-statement-1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬── └─NOT───┬────┬───SIZE ERROR imperative-statement-2──┘ └─ON─┘ ──┬────────────┬────────────────────────────────────────── └─END-DIVIDE─┘ ═══ Format 3 (DIVIDE BY, GIVING) ═══ Description In Format 3, the value of identifier-1 or literal-1 is divided 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 3 (DIVIDE BY, GIVING) ──DIVIDE──┬──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-DIVIDE─┘ ═══ Format 4 (DIVIDE INTO, GIVING, with REMAINDER) ═══ Description In Format 4, the value of identifier-1 or literal-1 is divided into 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 4 (DIVIDE INTO, GIVING, with REMAINDER) ──DIVIDE──┬──identifier-1──┬─────INTO────┬─identifier-2─┬ └──literal-1─────┘ └─literal-2────┘ ──GIVING identifier-3──┬───────────┬────────────────────── └──ROUNDED──┘ ──REMAINDER identifier-4────────────────────────────────── ────┬──────────────────────────────────────────────┬────── └──┬────┬───SIZE ERROR imperative-statement-1──┘ └─ON─┘ ───┬───────────────────────────────────────────────────┬── └─NOT───┬────┬───SIZE ERROR imperative-statement-2──┘ └─ON─┘ ──┬────────────┬────────────────────────────────────────── └─END-DIVIDE─┘ ═══ Format 5 (DIVIDE BY, GIVING, with REMAINDER) ═══ Description In Format 5, the value of identifier-1 or literal-1 is divided 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 5 (DIVIDE BY, GIVING, with REMAINDER) ──DIVIDE──┬──identifier-1──┬──BY──┬─identifier-2─┬─────── └──literal-1─────┘ └─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.51. DROP Statement ═══ Description The DROP statement releases a program device acquired by a TRANSACTION file. Program devices you specify in a DROP statement must have been acquired by the TRANSACTION file, either through an explicit ACQUIRE or through an implicit ACQUIRE at OPEN time. After successful execution of the DROP statement, the program device is no longer available for input or output operations through the TRANSACTION file. The device may be reacquired if necessary. The contents of the record area associated with a released program device are no longer available, even if the device is reacquired. If the DROP statement is unsuccessful, any applicable USE AFTER EXCEPTION/ERROR procedures are executed. ───DROP──┬─identifier─┬──FROM───file-name──────────────── └─literal────┘ ═══ 1.52. 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. The ENTER statement allows the use of more than one source language in the same source program. The COBOL/400 compiler allows only COBOL in the source program. ──ENTER language─name──┬────────────────┬────┬─────┬───── └──routine─name──┘ └─ . ─┘ ═══ 1.53. 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.54. 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. The EXIT statement is useful for documenting the end point in a series of paragraphs. If an EXIT paragraph is written as the last paragraph in a declarative procedure or a series of performed procedures, it identifies the point at which control will be transferred:  When control reaches such an EXIT paragraph and the associated declarative or PERFORM statement is active, control is transferred to the appropriate part of the Procedure Division.  When control reaches an EXIT paragraph that is not the end of a range of procedures governed by an active PERFORM or USE statement, control passes through the EXIT statement to the first statement of the next paragraph. Without an EXIT statement, the end of the sequence is difficult to determine, unless you know the logic of the program. ───EXIT──────────────────────────────────── ═══ 1.55. EXIT PROGRAM Statement ═══ Description The EXIT PROGRAM statement specifies the end of a called program and returns control to the calling program. If control reaches an EXIT PROGRAM statement while operating as a subprogram in a COBOL run unit, control returns to the point in the calling program immediately following the CALL statement. The program state of the calling program is identical to that which existed at the time it executed the CALL statement. The contents of data items and the contents of data files shared between the calling and called program may have been changed. The program state of the called program is not altered except that the ends of the ranges of all PERFORM statements executed by that called program are considered to have been reached. If control reaches an EXIT PROGRAM statement, and no CALL statement is active, control passes through the exit point to the next executable statement. The EXIT PROGRAM statement must appear as the only statement, or as the last statement, in a series of imperative statements in a sentence. When there is no next executable statement in a called program, an implicit EXIT PROGRAM statement is executed. ───EXIT PROGRAM──────────────────────────── ═══ 1.56. 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. If control reached a GOBACK statement in a subprogram in a COBOL run unit, control returns to the point in the calling program immediately following the CALL statement, as in the EXIT PROGRAM statement. ───GOBACK────────────────────────────────── ═══ 1.57. GO TO Statement ═══ Description The GO TO statement transfers control from one part of the Procedure Division to another. GO TO has three formats:  Format 1 (Unconditional GO TO)  Format 2 (Conditional GO TO)  Format 3 (Altered GO TO) ═══ Format 1 (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. An unconditional GO TO statement, when it appears in a sequence of imperative statements, must be the last statement in the sequence. When an ALTER statement refers to a paragraph, the paragraph must consist of a paragraph-name followed by an unconditional or altered GO TO statement. Format 1 (Unconditional GO TO) ──GO───┬────┬────procedure─name────────────────────────── └─TO─┘ ═══ Format 2 (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. The maximum number of procedure-names for a conditional GO TO statement is 255. Format 2 (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 in running the program. ═══ Format 3 (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. When an ALTER statement refers to a paragraph, the paragraph may consist only of the paragraph-name followed by an unconditional or altered GO TO statement. The altered GO TO statement is an obsolete element and is to be deleted from the next revision of the ANSI Standard. Format 3 (Altered GO TO) ──GO───┬────┬───.──────────────────────────────────────── └─TO─┘ ═══ 1.58. 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──┘ │ ┌────────────┐ │ │ │ │  │ │ │ │ └─ELSE─┬─statement-2─┴──┬────┘ │ │ └─NEXT SENTENCE──┘ │ │ │ │ ┌────────────┐ ┌────────────┐ │ │  │  │ │ └─────statement-1─┴────┬─ELSE───statement-2─┴───┬────────┬───┤ │ └─END-IF─┘ │ │ │ └─END-IF──────────────────────────────┘ ═══ 1.59. 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─────┘ ═══ identifier-1 ═══ Identifier-1 is the receiving area. You can specify a subscripted item or a reference-modified item for identifier-1. You can initialize a complete table only by specifying identifier-1 as a group that contains the complete table. (Click here for information about reference modification.) The description for the data item referenced by identifier-1 or any items subordinate to identifier-1 may not contain the DEPENDING ON phrase of the OCCURS clause. The data description entry for identifier-1 must not contain a RENAMES clause. An index data item may not be an operand of INITIALIZE. Whether identifier-1 references an elementary or group item, all operations are performed as if a series of MOVE statements had been written, each of which had an elementary item as a receiving field. All such elementary receiving fields, including all occurrences of table items within the group, are affected, with the following exceptions:  Index and pointer data items.  Elementary FILLER data items.  Items that are subordinate to identifier-1 and contain a REDEFINES clause, or any items subordinate to such an item. (However, identifier-1 may contain a REDEFINES clause or be subordinate to a redefining item.)  Boolean data items. The areas referenced by identifier-1 are initialized in the order (left to right) of the appearance of identifier-1 in the statement. Within a group receiving field, affected elementary items are initialized in the order of their definition within the group. If identifier-1 occupies the same storage area as identifier-2, the result of the execution of this statement is undefined, even if these operands are defined by the same data description entry. If identifier-1 is a group item, then all of the items within that group item are considered as being referenced in the program. ═══ 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.  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, and alphanumeric-edited items.  ZERO is the implied sending field for numeric and numeric-edited items. If you specify the REPLACING phrase:  If identifier-1 references a group item, any elementary item within the data item referenced by identifier-1 is initialized only if it belongs to the category specified in the REPLACING phrase.  If identifier-1 references an elementary item, that item is initialized only if it belongs to the category specified in the REPLACING phrase. This initialization takes place as if the data item referenced by identifier-2 or literal-1 acts as the sending operand in an implicit MOVE statement to the identified item. ═══ 1.60. INSPECT Statement ═══ Description The INSPECT statement specifies that characters in a data item are to be counted (tallied) or 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 spaces or zeros.  Translate characters from one collating sequence to another. This statement does not support reference modification. The INSPECT statement has four formats:  Format 1 (INSPECT/TALLYING)  Format 2 (INSPECT/REPLACING)  Format 3 (INSPECT/TALLYING/REPLACING)  Format 4 (INSPECT/CONVERTING) ═══ Format 1 ═══ 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 ═══ 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 ═══ 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 ═══ 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.61. 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 procedure or an output file. MERGE may appear anywhere in the Procedure Division except in a Declarative Section. It is not necessary to sequence input files prior to a merge operation. ─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─────┬────┬─procedure-name-1──────────1 │ ┌───────────┐ └─IS─┘ │  │ └─GIVING file─name─4─┴──────────────────────────────────2 1─┬───────────────────────────────┬─┬───────────────────── └─┬─THROUGH─┬─procedure─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 has more than one file description, the KEY data items need be described in only one or the record descriptions.  KEY data items must be fixed-length items.  KEY data items must not contain an OCCURS clause or be subordinate to an item that contains OCCURS.  KEY data items can be qualified or reference modified; they cannot be subscripted or indexed. (Click here for information about reference modification.)  The total length (in bytes) of the KEY data items must not exceed 256. ═══ 1.62. 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. Do not specify an index data item in a MOVE statement. 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.63. 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 or literal-1 is multiplied by the value of identifier-2; the product is then placed in 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. The composite of operands in an arithmetic statement can have a maximum of 30 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. The composite of operands in an arithmetic statement can have a maximum of 30 digits. 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.64. OPEN Statement ═══ Description The OPEN statement initiates the processing of files and checks and/or writes labels. The OPEN statement varies depending on the type of file:  Sequential  Indexed  Relative  Transaction The OPEN statement has three formats:  Format 1 (Sequential Files)  Format 2 (Indexed and Relative Files)  Format 3 (Transaction Files) ═══ Format 1 (Sequential 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 (Sequential 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 (Indexed and Relative Files) ═══ Description In Format 2 of the OPEN statement, you must specify at least one of the phrases INPUT, OUTPUT, or I-O with the OPEN keyword. The INPUT, OUTPUT, and I-O phrases may appear in any order. Format 2 (Indexed and Relative Files) ┌──────────────────────────┐ │ ┌───────────┐ │   │ │ ───OPEN──┬──INPUT───file-name-1─┴───┼──────────────────── │ ┌───────────┐ │ │  │ │ ├──OUTPUT───file-name-2─┴──┤ │ ┌───────────┐ │ │  │ │ └──I-O───file-name-3─┴─────┘ ═══ Format 3 (TRANSACTION Files) ═══ Description In Format 3 of the OPEN statement, you must specify I-O with the OPEN keyword. The Format 3 OPEN statement can cause a program device to be implicitly acquired for a TRANSACTION file. Format 3 (TRANSACTION Files) ┌─────────┐  │ ───OPEN I-O──file-name─┴────────────────────────────────── ═══ 1.65. PERFORM Statement ═══ Description The PERFORM statement explicitly transfers control to one or more procedures and, after execution of the specified procedures or imperative statements, 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 procedures referenced in the basic PERFORM statement are run once and control then passes to the next executable statement following the PERFORM 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 The procedures referred to in Format 2 (PERFORM with TIMES) are executed the number of times specified by the value in identifier-1 or integer-1. Control then passes to the next executable statement following the PERFORM 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 procedures referred to are performed until the condition that the UNTIL phrase specifies is true. Control then passes to next executable statement following PERFORM. 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 certain 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.66. READ Statement ═══ Description The READ statement makes a record available to the program. 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 five formats:  Format 1 (Sequential Retrieval using Sequential Access)  Format 2 (Sequential Retrieval using Dynamic Access)  Format 3 (Random Retrieval)  Format 4 (TRANSACTION Nonsubfile)  Format 5 (TRANSACTION Subfile) ═══ Format 1 (Sequential Retrieval using Sequential Access) ═══ Description Use Format 1 for all files in sequential access mode. Format 1 retrieves the next logical record from the file. The file organization determines the next record accessed. Format 1 (Sequential Retrieval using Sequential Access) ───READ file-name─┬────┬─┬──────┬─┬─────────────────┬──── └NEXT┘ └RECORD┘ └INTO identifier-1┘ ────┬──────────────────┬────────────────────────────────── └─┬──────┬─NO LOCK─┘ └─WITH─┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬───────────────────────────────────┬───────────────── └─┬────┬─END imperative-statement-1─┘ └─AT─┘ ────┬───────────────────────────────────────┬───────────── └─NOT─┬────┬─END imperative-statement-2─┘ └─AT─┘ ────┬──────────┬────────────────────────────────────────── └─END-READ─┘ ═══ Format 2 (Sequential Retrieval using Dynamic Access) ═══ Description Use Format 2 for indexed and relative files in dynamic access mode. In dynamic access mode, Format 2 with NEXT, FIRST, LAST, or PRIOR must be specified for sequential retrieval. Format 2 (Sequential Retrieval using Dynamic Access) ───READ file-name─┬─NEXT──┬─┬──────┬─┬─────────────────┬─ ├─FIRST─┤ └RECORD┘ └INTO identifier-1┘ ├─LAST──┤ └─PRIOR─┘ ────┬──────────────────┬────────────────────────────────── └─┬──────┬─NO LOCK─┘ └─WITH─┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬───────────────────────────────────┬───────────────── └─┬────┬─END imperative-statement-1─┘ └─AT─┘ ────┬───────────────────────────────────────┬───────────── └─NOT─┬────┬─END imperative-statement-2─┘ └─AT─┘ ────┬──────────┬────────────────────────────────────────── └─END-READ─┘ ═══ Format 3 (Random Retrieval) ═══ Description You must specify Format 3 (Random Retrieval) for indexed and relative files in random access mode. Format 3 (Random Retrieval) ───READ file-name─┬────────┬─┬───────────────────┬─────── └─RECORD─┘ └─INTO identifier-1─┘ ────┬──────────────────┬────────────────────────────────── └─┬──────┬─NO LOCK─┘ └─WITH─┘ ───┬────────────────────────┬───────────────────────────── └─KEY─┬────┬─data-name-1─┘ └─IS─┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ───┬────────────────────────────────────────────┬───────── └─INVALID───┬─────┬───imperative-statement-1─┘ └─KEY─┘ ───┬────────────────────────────────────────────────┬───── └─NOT INVALID───┬─────┬───imperative-statement-2─┘ └─KEY─┘ ───┬──────────┬─────────────────────────────────────────── └─END-READ─┘ ═══ Format 4 (TRANSACTION Nonsubfile) ═══ Description You must use the Format 4 READ statement for a subfile control record format to place those subfile records that were updated on a display into the subfile. You cannot use the Format 4 READ statement to read a subfile record. Format 4 (TRANSACTION Nonsubfile) ───READ file-name─┬────────┬─┬───────────────────┬─────── └─RECORD─┘ └─INTO identifier-1─┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬──────────────────────────────────┬────────────────── └─TERMINAL─┬────┬─┬─identifier-3─┬─┘ └─IS─┘ └─literal-2────┘ ────┬──────────────────────────────────────────┬────────── └─┬─INDICATOR──┬──┬─────┬──identifier-4────┘ ├─INDICATORS─┤ ├─IS──┤ └─INDIC──────┘ └─ARE─┘ ────┬────────────────────────────────┬──────────────────── └─NO DATA imperative-statement-1─┘ ────┬───────────────────────────────────┬───────────────── └─┬────┬─END imperative-statement-2─┘ └─AT─┘ ────┬───────────────────────────────────────┬───────────── └─NOT─┬────┬─END imperative-statement-3─┘ └─AT─┘ ───┬──────────┬─────────────────────────────────────────── └─END-READ─┘ ═══ Format 5 (TRANSACTION Subfile) ═══ Description The Format 5 READ statement is used only to read a format that is a subfile record. You cannot use Format 5 for communications devices. If the subfile format of the READ statement is used for a communication device, the READ operation fails. The AT END phrase can only be specified when the NEXT MODIFIED phrase is specified. The INVALID KEY phrase must not be used when the NEXT MODIFIED phrase is specified. Format 5 (TRANSACTION Subfile) ───READ SUBFILE file-name──────────────────────────────── ───┬───────────────────┬──┬────────┬────────────────────── └─┬──────┬─MODIFIED─┘ └─RECORD─┘ └─NEXT─┘ ───┬───────────────────┬────────────────────────────────── └─INTO identifier-1─┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬──────────────────────────────────┬────────────────── └─TERMINAL─┬────┬─┬─identifier-3─┬─┘ └─IS─┘ └─literal-2────┘ ────┬──────────────────────────────────────────┬────────── └─┬─INDICATOR──┬──┬─────┬──identifier-4────┘ ├─INDICATORS─┤ ├─IS──┤ └─INDIC──────┘ └─ARE─┘ ───┬────────────────────────────────────────────┬───────── └─INVALID───┬─────┬───imperative-statement-1─┘ └─KEY─┘ ───┬────────────────────────────────────────────────┬───── └─NOT INVALID───┬─────┬───imperative-statement-2─┘ └─KEY─┘ ────┬───────────────────────────────────┬───────────────── └─┬────┬─END imperative-statement-3─┘ └─AT─┘ ────┬───────────────────────────────────────┬───────────── └─NOT─┬────┬─END imperative-statement-4─┘ └─AT─┘ ───┬──────────┬─────────────────────────────────────────── └─END-READ─┘ ═══ NEXT MODIFIED Phrase ═══ When you specify the NEXT MODIFIED phrase, the record made available is the first record in the subfile that has been modified. The search for the next modified record begins:  At the beginning of the subfile if: - An I-O operation has been performed for the subfile control record. - The I-O operation cleared, initialized, or displayed the subfile.  For all other cases, with the record following the record that was read by a previous read operation. The value of the RELATIVE KEY data item is updated to reflect the relative record number of the record made available to the program. If you specify NEXT MODIFIED and there is no user-modified record in the subfile with a relative record number greater than the relative record number contained in the RELATIVE KEY data item, the AT END condition exists, the file status is set to 12, and the value of the RELATIVE KEY data item is set to the key of the last record in the subfile. Imperative-statement-2, or any applicable USE AFTER ERROR/EXCEPTION procedure, if any, is then executed. If you do not specify the NEXT MODIFIED phrase, the data record made available is the record in the subfile with a relative record number that corresponds to the value of the RELATIVE KEY data item; and if the RELATIVE KEY data item contains a value other than the relative record number of a record in the subfile, the INVALID KEY condition exists and the execution of the READ statement is unsuccessful. Random Access of Subfile Records: The NEXT MODIFIED phrase must not be used to randomly access records in a subfile. The INVALID KEY phrase can only be used for random access of subfile records. Sequential Access of Subfile Records: The NEXT MODIFIED phrase must be specified to access subfile records sequentially. The AT END phrase can only be specified with the NEXT MODIFIED phrase. ═══ 1.67. 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.68. RETURN Statement ═══ Description The RETURN statement transfers records from the final phase of a sort or merge 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 RETURN INTO statement is equivalent to the statements: RETURN file-name-1 MOVE record-name TO identifier-1 The moving of the current record from the record area to the area specified by identifier-1 takes place according to the rules for the MOVE statement without the CORRESPONDING phrase. Any subscripting, indexing, or reference modification associated with identifier-1 is evaluated after the record has been returned and immediately before it is moved to identifier-1. (Click here for information about reference modification.) 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 the data item referenced by identifier-1 describe a group item, a numeric-edited item, or an elementary alphanumeric item. The record areas associated with file-name-1 and identifier-1 must not be the same storage area. ═══ 1.69. 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. The REWRITE statement has two formats:  Format 1 (REWRITE)  Format 2 (TRANSACTION Subfile) ═══ Format 1 (REWRITE) ═══ Description When the Format 1 REWRITE statement is processed, the system logically replaces a record retrieved by a READ statement. The last input/output statement for this file must have been a successfully processed READ statement without the NO LOCK phrase. The operation of the REWRITE statement varies depending on the file organization and access mode:  For sequential files and sequential access mode, the record retrieved by the last successfully processed READ statement is replaced.  For indexed files and sequential access mode, the record specified by the value contained in the prime RECORD KEY is replaced. When the REWRITE statement is executed, this value must equal the value of the prime record key data item in the last record read from this file.  For indexed files and random or dynamic access mode, the record specified by the value contained in the prime RECORD KEY is replaced.  For relative files and sequential access mode, the record retrieved by the last successfully processed READ statement is replaced.  For relative files and random or dynamic access mode, the record specified by the value in the RELATIVE KEY data item is replaced. ──REWRITE record-name-1───┬───────────────────┬────────── └─FROM identifier-1─┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ───┬─────────────────────────────────────────┬──────────── └─INVALID─┬─────┬──imperative-statement-1─┘ └─KEY─┘ ───┬────────────────────────────────────────────┬───────── └─NOT INVALID─┬─────┬─imperative-statement-2─┘ └─KEY─┘ ───┬─────────────┬──────────────────────────────────────── └─END-REWRITE─┘ ═══ Format 2 (TRANSACTION Subfile) ═══ Description Use the Format 2 REWRITE statement to replace a subfile record that already exists in the subfile. A successful read operation on the record must be done prior to the rewrite operation. The record replaced in the subfile is that record accessed by the previous read operation. You cannot use Format 2 for communications devices. Format 2 (TRANSACTION Subfile) ───REWRITE SUBFILE record-name-1───────────────────────── ───┬───────────────────┬────────────────────────────────── └─FROM identifier-1─┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬──────────────────────────────────┬────────────────── └─TERMINAL─┬────┬─┬─identifier-3─┬─┘ └─IS─┘ └─literal-2────┘ ────┬──────────────────────────────────────────┬────────── └─┬─INDICATOR──┬──┬─────┬──identifier-4────┘ ├─INDICATORS─┤ ├─IS──┤ └─INDIC──────┘ └─ARE─┘ ───┬─────────────────────────────────────────┬──────────── └─INVALID─┬─────┬──imperative-statement-1─┘ └─KEY─┘ ───┬────────────────────────────────────────────┬───────── └─NOT INVALID─┬─────┬─imperative-statement-2─┘ └─KEY─┘ ───┬─────────────┬──────────────────────────────────────── └─END-REWRITE─┘ ═══ 1.70. ROLLBACK Statement ═══ Description The ROLLBACK statement provides a way to cancel one or more changes to database records when the changes should not remain permanent. ───ROLLBACK──────────────────────────────── When the ROLLBACK statement is executed, all changes made to files under commitment control since the previous commitment boundary are removed from the database. (When a file is cleared while being opened for OUTPUT, execution of a ROLLBACK statement does not restore cleared records to the file.) A commitment boundary is the previous occurrence of a ROLLBACK or COMMIT statement. If no COMMIT or ROLLBACK has been issued, the commitment boundary is the first OPEN of a file under commitment control. Removal of changes takes place for all files under commitment control in the job, and not just for files under commitment control in the COBOL program that issues the ROLLBACK. Once the ROLLBACK is successfully executed, all record locks held by the job for files under commitment control are released and the records become available to other jobs. The ROLLBACK has no effect on files not under commitment control. If a ROLLBACK is executed and there are no files opened under commitment control, the ROLLBACK is ignored. A file under commitment control can be opened or closed without affecting the status of changes made since the last commitment boundary. A COMMIT must still be issued to make changes permanent. A ROLLBACK, when executed, leaves files in the same open or closed state as before execution. The ROLLBACK statement does not:  Modify the I-O-FEEDBACK area for any file  Set a file status value for any file. For the ROLLBACK statement, the following considerations apply:  The ROLLBACK statement sets the file position indicator to the pointer's position at the previous commitment boundary. This is important if you are doing for sequential processing.  If no COMMIT statement has been issued since the file was opened, the ROLLBACK statement sets the file position indicator to the pointer's position at the OPEN.  The file position indicator is undefined after a ROLLBACK if the file is closed with uncommited changes. At the end of every job, an implicit ROLLBACK of uncommitted records is automatically done for all files under commitment control. Any uncommitted changes to the database are cancelled. ═══ 1.71. SEARCH Statement ═══ Description The SEARCH statement searches a table for 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 The Format 1 (Serial Search) statement runs 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──────────┘ │ │ │ │ ┌─────────────────────────────────────────┐ │ │  │ │ └─WHEN condition-1───imperative-statement-2─┴┬────────────┬┘ └─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 value of the first table element, nor ever greater than the 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────────────────────────────┘ ═══ 1.72. SET Statement ═══ Description The SET statement establishes reference points for table handling operations by doing one of the following: 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 addresses of pointer data items. 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 a SET statement is undefined. The SET statement has five Formats:  Format 1 (TO Phrase)  Format 2 (UP BY/DOWN BY Phrase)  Format 3 (ON/OFF Phrase)  Format 4 (TO TRUE Phrase)  Format 5 (Pointer Data Item Phrase) ═══ Format 1 (TO Phrase) ═══ 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 (TO Phrase) ┌──────────────┐  │ ───SET─┬─index-name-1─┼─TO ───┬─index-name-2─┬──────── └─identifier-1─┘ ├─identifier-2─┤ └─integer-1────┘ ═══ Format 2 (UP BY/DOWN BY Phrase) ═══ 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 (UP BY/DOWN BY Phrase) ┌────────────┐  │ ───SET index-name-3─┴┬─UP BY───┬──┬─identifier-3─┬──── └─DOWN BY─┘ └─integer-2────┘ ═══ Format 3 (ON/OFF Phrase) ═══ 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 (ON/OFF Phrase) ┌──────────────────────────────┐ ├───────────────┐ │  │ │ ───SET─────mnemonic-name-1─┴─TO───┬─ON──┬─┴─────────── └─OFF─┘ ═══ Format 4 (TO TRUE Phrase) ═══ 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 (TO TRUE Phrase) ┌────────────────┐  │ ───SET condition-name-1─┴─TO TRUE───────────────────── ═══ Format 5 (Pointer Data Item Phrase) ═══ 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 (Pointer Data Item Phrase) ┌───────────────────────────┐ │ │  │ ───SET──┬──identifier-4─────────────┼───────────────── └──ADDRESS OF identifier-5──┘ ───TO──┬──identifier-6─────────────┬─────────────────── ├──ADDRESS OF identifier-7──┤ ├──NULL─────────────────────┤ └──NULLS────────────────────┘ ═══ 1.73. 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 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. KEY data items must be fixed-length items. 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 can be qualified or reference modified; they cannot be subscripted or indexed. (Click here for information about reference modification.) 6. The total length of the KEY data item must not exceed 256 bytes. ═══ 1.74. 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 ─────────────────────────────────────────────────────── 3 2 ────┬─EQUAL─┬────┬─────────────────────┬─────────────── 4 │ └─TO─┘ │ ├─ = ──────────────────────────────┤ ├─GREATER─┬──────┬─────────────────┤ │ └─THAN─┘ │ ├─ > ──────────────────────────────┤ ├─NOT LESS─┬──────┬────────────────┤ │ └─THAN─┘ │ ├─NOT < ───────────────────────────┤ ├─GREATER─┬──────┬─OR EQUAL─┬────┬─┤ │ └─THAN─┘ └─TO─┘ │ └─ >= ─────────────────────────────┘ 3 ──────────────────────────────────┬──────────────────── 4 ────┬─EXTERNALLY-DESCRIBED-KEY──┬─┘ │ │ │ ┌───────────┐ │ │  │ │ └─data-name-1─┴─────────────┘ ────┬───────┬──NO LOCK───────────────────────────────── └─WITH──┘ ────┬──────────────────────────────────┬─────────────── └─FORMAT─┬─────┬──┬─identifier-1─┬─┘ └─IS──┘ └─literal-1────┘ ─┬──────────────────────────────────────────┬────────── └─INVALID─┬─────┬──imperative-statement-1──┘ └─KEY─┘ ─┬──────────────────────────────────────┬─┬─────────┬── └NOT INVALID┬───┬imperative-statement-2┘ └END-START┘ └KEY┘ ═══ 1.75. STOP Statement ═══ Description The STOP statement halts the running of the object program either permanently or temporarily. ───STOP─┬──RUN──────┬─────────────────────── └──literal──┘ ═══ 1.76. 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. Any subscripting and reference modification is performed only once, at the beginning of the execution of the STRING statement. (Click here for information about reference modification.) After the STRING statement has completed, only that part of the receiving field into which data was transferred is changed. 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.77. 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 composite of all operands can have a maximum length of 30 digits. 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 keyword FROM are added together. This sum is then subtracted from and stored immediately in identifier-2. This initial sum is also subtracted from 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 keyword 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.78. 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. All subscripting and reference modification is performed only once, at the beginning of the execution of the UNSTRING statement. (Click here for information about reference modification.) ──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.79. 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 sequential file must be open in OUTPUT or EXTEND mode; the associated indexed or relative file must be open in OUTPUT, I-O, or EXTEND mode. The WRITE statement has five formats:  Format 1 (Sequential Files)  Format 2 (Indexed and Relative Files)  Format 3 (FORMATFILE)  Format 4 (TRANSACTION Nonsubfile)  Format 5 (TRANSACTION Subfile) ═══ Format 1 (Sequential Files) ═══ Description Sequential 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 (a disk, for example), the format, when edited or browsed, may appear different than the expected output. Format 1 (Sequential Files) ───WRITE record-name-1──┬───────────────────┬─────────────── └─FROM identifier-1─┘ ─┬───────────────────────────────────────────────────────┬─── └┬─BEFORE─┬─┬───────────┬─┬─┬─identifier-2─┬─┬───────┬─┬┘ └─AFTER──┘ └─ADVANCING─┘ │ └─integer-1────┘ ├─LINE──┤ │ │ └─LINES─┘ │ ├─mnemonic-name-1────────────┤ └─PAGE───────────────────────┘ ────┬────────────────────────────────────────────────────┬─── └─┬─────┬─┬──END-OF-PAGE─┬─imperative-statement-1────┘ └─AT──┘ └─────EOP──────┘ ────┬────────────────────────────────────────────────────┬─── └──NOT─┬────┬┬─END-OF-PAGE─┬─imperative-statement-2──┘ └─AT─┘└────EOP──────┘ ────END-WRITE──────────────────────────────────────────────── ═══ Format 2 (Indexed and 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 indexed and relative files must be open in OUTPUT, I-O, or EXTEND mode. Format 2 (Indexed and Relative Files) ───WRITE record-name-1──┬─────────────────┬──────────── └FROM identifier-1┘ ────┬────────────────────────────────┬────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬─────────────────────────────────────────┬───────── └─INVALID──┬─────┬─imperative-statement-1─┘ └─KEY─┘ ────┬──────────────────────────────────────┬─┬─────────┬ └NOT INVALID┬───┬imperative-statement-2┘ └END-WRITE┘ └KEY┘ ═══ INVALID KEY Phrase ═══ The INVALID KEY phrase must be specified for files for which there is not an appropriate 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. For indexed files, 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 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.  The value of the key field in the record area equals that of an already existing record and DUPLICATES are not allowed.  The value of the key field in the record area is not greater than that for the previous record. For a file that allows duplicate keys, the INVALID KEY condition exists only if the value of the record key is less than that for the previous record. For relative files, 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 contains data. 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. ═══ Format 3 (FORMATFILE) ═══ Description The WRITE statement releases a logical record for an output or input/output file. When the WRITE statement is executed, the associated file must be open in OUTPUT, I-O, or EXTEND mode. Format 3 (FORMATFILE) ───WRITE record-name-1──┬─────────────────┬───────────────── └FROM identifier-1┘ ────┬────────────────────────────────┬─────────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬──────────────────────────────────────────┬───────────── └─┬─INDICATOR──┬──┬─────┬──identifier-3────┘ ├─INDICATORS─┤ ├─IS──┤ └─INDIC──────┘ └─ARE─┘ ────┬────────────────────────────────────────────────────┬─── └─┬─────┬─┬──END-OF-PAGE─┬─imperative-statement-1────┘ └─AT──┘ └─────EOP──────┘ ────┬────────────────────────────────────────────────────┬─── └──NOT─┬────┬┬─END-OF-PAGE─┬─imperative-statement-2──┘ └─AT─┘└────EOP──────┘ ────END-WRITE──────────────────────────────────────────────── ═══ Format 4 (TRANSACTION Nonsubfile) ═══ Description The WRITE statement releases a logical record to the file. Format 4 (TRANSACTION Nonsubfile) ───WRITE record-name-1──┬─────────────────┬────────────── └FROM identifier-1┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬──────────────────────────────────┬────────────────── └─TERMINAL─┬────┬─┬─identifier-3─┬─┘ └─IS─┘ └─literal-2────┘ ────┬───────────────────────────────────────────┬───────── └─STARTING─┬────┬─┬──────┬─┬─identifier-4─┬─┘ └─AT─┘ └─LINE─┘ └─literal-3────┘ ────┬─────────────────────────────────────────────────────1 └─┬─BEFORE─┬─ROLLING─┬───────┬──┬─identifier-5─┬──────2 └─AFTER──┘ ├─LINES─┤ └─literal-4────┘ └─LINE──┘ 1─────────────────────────────────────────────────────────3 2───┬─────────┬──┬─identifier-6─┬─────────────────────────4 ├─THROUGH─┤ └─literal-5────┘ └─THRU────┘ 3──────────────────────────────────────────┬────────────── 4───┬─UP───┬──┬─identifier-7─┬──┬───────┬──┘ └─DOWN─┘ └─literal-6────┘ ├─LINES─┤ └─LINE──┘ ────┬──────────────────────────────────────────┬────────── └─┬─INDICATOR──┬──┬─────┬──identifier-8────┘ ├─INDICATORS─┤ ├─IS──┤ └─INDIC──────┘ └─ARE─┘ ────END-WRITE───────────────────────────────────────────── ═══ STARTING Phrase ═══ The STARTING phrase specifies the starting line number for the record formats that use the variable starting line keyword. This phrase is only valid for display devices. The actual line number on which a field begins can be determined by the following equation: Actual-line = Start-line + DDS Start-line - 1 Where: Actual-line is the actual line number Start-line is the starting line number specified in the program DDS Start-line is the line number specified in positions 39 through 41 of the Data Description Specifications form. The write operation is successful if:  The result of the equation is positive and less than or equal to the number of lines on the workstation screen.  The value specified for the STARTING phrase is 0. In this case, a value of 1 is assumed. ═══ ROLLING Phrase ═══ The ROLLING phrase allows you to move lines displayed on the workstation screen. All or some of the lines on the screen can be rolled up or down. The lines vacated by the rolled lines are cleared, and can have another screen format written into them. This phrase is only valid for display devices. You specify ROLLING in the WRITE statement that is writing a new format to the workstation screen. You must specify whether the write is before or after the roll, the range of lines you want to roll, how many lines you want to roll these lines, and whether the roll operation is up or down. After lines are rolled, the field on these lines retain their DDS display attributes, for example, underlining, but lose their DDS usage attributes, for example, input capability. Fields on lines that are written and then rolled (BEFORE ROLLING phrase) also lose their usage attributes. If any part of a format is rolled, the entire format loses its usage attributes. If more than one format exists, only the rolled formats lose their usage attributes. ═══ Format 5 (TRANSACTION Subfile) ═══ Description The WRITE statement releases a logical record to the file. Format 5 (TRANSACTION Subfile) ───WRITE SUBFILE record-name-1──┬─────────────────┬────── └FROM identifier-1┘ ────┬────────────────────────────────┬──────────────────── └─FORMAT─┬────┬─┬─identifier-2─┬─┘ └─IS─┘ └─literal-1────┘ ────┬──────────────────────────────────┬────────────────── └─TERMINAL─┬────┬─┬─identifier-3─┬─┘ └─IS─┘ └─literal-2────┘ ────┬──────────────────────────────────────────┬────────── └─┬─INDICATOR──┬──┬─────┬──identifier-4────┘ ├─INDICATORS─┤ ├─IS──┤ └─INDIC──────┘ └─ARE─┘ ────┬─────────────────────────────────────────┬─────────── └─INVALID──┬─────┬─imperative-statement-1─┘ └─KEY─┘ ────┬──────────────────────────────────────┬─┬─────────┬── └NOT INVALID┬───┬imperative-statement-2┘ └END-WRITE┘ └KEY┘ ═══ 1.80. 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 compiler-directing statements. 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: *CONTROL(*CBL) COPY EJECT SKIP1/2/3 TITLE USE PROCESS ═══ 1.81. *CONTROL(*CBL) Statement ═══ Description *CONTROL(*CBL) allows you to selectively display or suppress the listing of source code 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.82. COPY Statement ═══ Description The Format 1 COPY statement is a library statement that places prewritten text in a COBOL program. The Format 2 COPY statement can be used to create COBOL Data Division statements to describe a file that exists on the system. The two formats of the COPY statement are:  Format 1 (COPY)  Format 2 (COPY DDS Translate) ═══ Format 1 (COPY) ═══ Description The Format 1 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. Format 1 (COPY) ───COPY──text-name───────────────────────────────────────────── ────┬──────────────────────────┬──file-name──┬────────────┬───── ├──OF──┬────library-name- ─┘ └──SUPPRESS──┘ └──IN──┘ ──┬───────────────────────────────────────────────────────────┬─ │ ┌────────────────────────────────────────────┐ │ │  │ │ └──REPLACING─┬ ==pseudo-text-1== ┬─BY─┬ ==pseudo-text-2== ┼─┘ ├────identifier-1───┤ ├───identifier-2────┤ ├────literal-1──────┤ ├───literal-2───────┤ └────word-1─────────┘ └───word-2──────────┘ ═══ Format 2 (COPY DDS Translate) ═══ Description The Format 2 COPY statement (DD, DDR, DDS, DDSR option) can be used to create COBOL Data Division statements to describe a file that exists on the system. These descriptions are based on the version of the file in existence at compile time. They do not make use of the DDS source statements for the file. You can use the Format 2 Copy statement only in the Data Division, and you must precede the statement with a group level item that has a level number less than 05. When the RECORD KEY clause specifies EXTERNALLY-DESCRIBED-KEY, a format can be copied only once under the FD entry for the file. Format 2 (COPY DDS Translate) ───COPY──┬─DD-format-name───┬──┬───────┬──┬──────────────┬───── ├─DD-ALL-FORMATS───┤ ├─ -I───┤ ├─ -INDICATOR──┤ ├─DDR-format-name──┤ ├─ -O───┤ ├─ -INDICATORS─┤ ├─DDR-ALL-FORMATS──┤ └─ -I-O─┘ └─ -INDIC──────┘ ├─DDS-format-name──┤ ├─DDS-ALL-FORMATS──┤ ├─DDSR-format-name─┤ └─DDSR-ALL-FORMATS─┘ ────┬──────────────────────────┬──file-name──┬────────────┬───── ├──OF──┬────library-name- ─┘ └──SUPPRESS──┘ └──IN──┘ ──┬───────────────────────────────────────────────────────────┬─ │ ┌────────────────────────────────────────────┐ │ │  │ │ └──REPLACING─┬ ==pseudo-text-1== ┬─BY─┬ ==pseudo-text-2== ┼─┘ ├────identifier-1───┤ ├───identifier-2────┤ ├────literal-1──────┤ ├───literal-2───────┤ └────word-1─────────┘ └───word-2──────────┘ ═══ REPLACING ═══ In the following discussion, each operand may consist of one of the following:  Pseudo-text  An identifier  A literal  A COBOL word (except COPY). When you specify REPLACING, the library text is copied, and each properly matched occurrence of the first operand within the library text is replaced by the second operand. For example, identifier-1 is replaced by identifier-2. 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 delimiters (==). Both characters of each pseudo-text delimiter must appear on one line; however, character-strings within pseudo-text-1 can be continued. Because of the replacement rules, the continued line of pseudo-text-2 can begin in area A. 2. A character-string for pseudo-text can consist of single-byte characters of any kind. The prefix portion of a data name, however, cannot be replaced using pseudo-text unless the entire data name is used. 3. Pseudo-text-1 must not be null, nor may it consist solely of the space character, separator comma, separator semicolon, and/or comment lines. Beginning and ending blanks are not included in the text comparison process. Embedded blanks are used in the text comparison process to indicate multiple text words. 4. Pseudo-text-2 may be null; it may consist solely of space characters and/or comment lines. Each text word in pseudo-text-2 that is to be copied into the program is placed in the same area of the resultant program as the area in which it appears in pseudo-text-2.  Identifier - May be defined in any Data Division section  Literal - May be numeric or nonnumeric  Word - May be any single COBOL word (except COPY) For purposes of matching, each identifier-1, literal-1, or word-1 is treated, respectively, as pseudo-text containing only identifier-1, literal-1, or word-1. ═══ 1.83. EJECT 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.84. SKIP1/2/3 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.85. TITLE 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.86. USE Statement ═══ Description USE is a compiler-directing statement that can appear only in the Procedure Division, and that can begin only in Area B. The USE statement has two declaratives:  EXCEPTION/ERROR 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 system-defined procedures.  The EXCEPTION/ERROR procedures are activated when an input/output error occurs during execution of a ACQUIRE, DROP, READ, WRITE, REWRITE, START, OPEN, CLOSE, or DELETE statement.  After execution of the EXCEPTION/ERROR declarative procedure, control is returned to the statement immediately following the input/output statement which caused the error.  The words EXCEPTION and ERROR are synonymous and may be used interchangeably. ──USE AFTER─┬──────────┬─┬─EXCEPTION─┬───────────────── └─STANDARD─┘ └─ERROR─────┘ ┌───────────┐  │ ──PROCEDURE─┬────┬─┬─file-name-1─┴─┬──────────────────── └─ON─┘ ├─INPUT─────────┤ ├─OUTPUT────────┤ ├─I-O───────────┤ └─EXTEND────────┘ ═══ DEBUGGING Declarative ═══ Description The USE FOR DEBUGGING sentence in the Procedure Division identifies the items in the source program that are to be monitored by the associated debugging declarative procedure. Note: Debugging sections are obsolete language elements and are to be deleted from the next revision of the ANSI Standard. 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─┬────┬────────────────────────── └─FOR─┘ └─ON─┘ ┌──────────────────────────────────────────┐  │ ────┬─┬───────────────────────┬──identifier-1──┼────────── │ └─ALL─┬───────────────┬─┘ │ │ └─REFERENCES OF─┘ │ ├─file-name-1──────────────────────────────┤ ├─procedure-name-1─────────────────────────┤ └─ALL PROCEDURES───────────────────────────┘ ═══ ALL REFERENCES OF Phrase ═══ When you specify ALL REFERENCES OF identifier-1, that debugging section is executed for every statement that explicitly references identifier-1 at each of the following times:  Before the execution of a WRITE or REWRITE identifier-1 and after the execution of any implicit move resulting from the presence of the FROM phrase.  Before control is transferred with GO TO DEPENDING ON identifier-1, and before any debugging section for the procedure-name runs.  After each initialization, modification, or evaluation of the contents of identifier-1 in PERFORM VARYING/AFTER/UNTIL identifier-1.  After any other COBOL statement explicitly referring to identifier-1. If identifier-1 is specified in a phrase that is not executed or evaluated, the associated debugging section is not executed. ═══ Identifier-1 ═══ An identifier in a USE FOR DEBUGGING sentence:  Must be specified without the subscripting or indexing normally required if it contains an OCCURS clause or is subordinate to an entry containing an OCCURS clause. (A SEARCH or SEARCH ALL statement that refers to such an identifier does not call the USE FOR DEBUGGING procedures.)  Must not be a special register.  Cannot be reference modified. When you specify identifier-1, that debugging section is executed at each of the following times:  Before the execution of a WRITE or REWRITE statement that explicitly references identifier-1 and after the execution of any implicit move resulting from the presence of the FROM phrase.  After each initialization, modification, or evaluation of the contents of identifier-1 in PERFORM VARYING/AFTER/UNTIL identifier-1.  After any other COBOL statement explicitly referring to identifier-1 and causes a change in the contents of identifier-1. Any given identifier may appear in only one USE FOR DEBUGGING sentence, and only once in that sentence. If identifier-1 is specified in a phrase that is not executed or evaluated, the associated debugging section is not executed. ═══ 1.87. PROCESS Statement ═══ Description The PROCESS statement is an optional part of the COBOL source program. It lets you specify options that you would normally specify at compilation time. Options specified in the PROCESS statement override the corresponding options specified in the Compiler Options Dialog. ┌────────┐  │ ──PROCESS───option-1─┴───┬─────┬──────────────────── └─ . ─┘ ═══ PROCESS Statement ═══ The following rules apply to the PROCESS statement:  The statement must be placed before the first source statement in the COBOL program immediately preceding the IDENTIFICATION DIVISION header.  The statement begins with the word PROCESS. Options can appear on more than one line; however, only the first line can contain the word PROCESS.  The word PROCESS and all options must appear within positions 8 through 72. Position 7 must be left blank. The remaining positions can be used as in COBOL source statements: positions 1 through 6 for sequence numbers, positions 73 through 80 for identification purposes.  The options must be separated by blanks and/or commas.  The options can appear in any order. If conflicting options are specified, for example, LIST and NOLIST, the last option encountered takes precedence.  For any options with suboptions, if the option keyword is correct and the suboption is in error, the default suboption is assumed. ═══ Option-1 ═══ Option-1 represents the options available with the PROCESS statement. Following is a list of these options. You may click on each one for a description of the option. GENLVL(nn) NOBLK GEN BLK NOGEN STDINZ NOMAP NOSTDINZ MAP FS21DUPKEY NONUMBER NOFS21DUPKEY NUMBER RANGE LINENUMBER NORANGE NOSECLVL UNREF SECLVL NOUNREF NOOPTIONS NOVARCHAR OPTIONS VARCHAR QUOTE NODATETIME APOST DATETIME NOSEQUENCE NOCVTGRAPHIC SEQUENCE CVTGRAPHIC SOURCE (or SRC) NOFIPS NOSOURCE (or NOSRC) MINIMUM NOVBSUM INTERMEDIATE VBSUM HIGH NOXREF NOSEG XREF SEG1 PRTCORR SEG2 NOPRTCORR NODEB NOINZDLT DEB1 INZDLT DEB2 NOLIST NOOBSOLETE LIST OBSOLETE STDERR EXTDSPOPT(a b c) NOSTDERR NOSAAFLAG NODDSFILLER SAAFLAG DDSFILLER FLAG(nn) NOSYNC NOFS9MTO0M SYNC FS9MTO0M NOCRTF NOGRAPHIC CRTF GRAPHIC NODUPKEYCHK NOFS9ATO0A DUPKEYCHK FS9ATO0A NOEXTACCDSP SRTSEQ(a) EXTACCDSP LANGID(a) ═══ EXTDSPOPT Option ═══ EXTDSPOPT specifies the options to use for extended ACCEPT and extended DISPLAY statements for workstation I/O, and takes the form: EXTDSPOPT(a b c) Where a is DFRWRT or NODFRWRT, b is UNDSPCHR or NOUNDSPCHR, and c is ACCUPDALL or ACCUPDNE.  DFRWRT indicates that extended DISPLAY statements are held in a buffer until an extended ACCEPT statement is encountered, or until the buffer is filled. DFRWRT is the default value. If an extended ACCEPT statement is not encountered before the buffer is filled, the contents of the buffer are written to the display. When an extended ACCEPT statement is encountered, the current contents of the buffer are written to the display.  NODFRWRT indicates that each extended DISPLAY statement is performed as it is encountered.  UNDSPCHR indicates that displayable and undisplayable characters are handled by extended ACCEPT and extended DISPLAY statements. UNDSPCHR is the default value.  NOUNDSPCHR indicates that only displayable characters are handled by extended ACCEPT and extended DISPLAY statements. Although you must use this option for display stations attached to remote 3174 and 3274 controllers, you can also use it for local work stations. If you do use this option, your data must contain displayable characters. If the data contains values less than hexadecimal 20, the results are unpredictable, and can range from unexpected display formats to severe errors.  ACCUPDALL indicates that all types of data are predisplayed in the extended ACCEPT statements regardless of the existence of the UPDATE phrase. ACCUPDALL is the default value.  ACCUPDNE indicates that only numeric edited data are predisplayed in the extended ACCEPT statements that do not contain the UPDATE phrase. ═══ SRTSEQ Option ═══ SRTSEQ specifies the sort sequence used when NLSSORT is associated with an alphabet-name in the ALPHABET clause. The SRTSEQ option is used in conjunction with the LANGID option to determine which system-defined or user-defined sort sequence table the program will use. SRTSEQ takes the form: SRTSEQ(a) Where a is HEX, JOB, JOBRUN, LANGIDUNQ, LANGIDSHR, "table-name" or "library-name/table-name".  HEX indicates that no sort sequence table will be used and the hexadecimal values of the characters will be used to determine the sort sequence. This is the default value.  JOB indicates that the sort sequence of the program will be resolved and associated with the program at compile time. The sort sequence table must exist in the system at compile time.  JOBRUN indicates that the sort sequence of the program will be resolved and associated with the program at run time. At compile time, the compiler will associate the sort sequence of the compile job with the program. At run time, this sort sequence will be replaced by the sort sequence associated with the job at run time. This value allows a program to be compiled once and used with different sort sequences at run time.  LANGIDUNQ indicates that the sort sequence table being used must contain a unique weight for each character in the code page. The sort sequence table used will be the unique weighted table associated with the language specified in the LANGID option.  LANGIDSHR indicates that the sort sequence table being used can contain the same weight for multiple characters in the code page. The sort sequence table used will be the shared weighted table associated with the language specified in the LANGID option.  "table-name" or "library-name/table-name" indicates the name of the sort sequence table to be used. The table contains weights for all characters in a given code page. A weight is associated with the character that is defined at the code point. The library is specified as LIBL, CURLIB or library-name. - LIBL indicates the library list is searched to find the library where the sort sequence table is located. This is the default value. - CURLIB indicates that the current library is searched. If you have not assigned a library as the current library, QGPL is used. - library-name indicates the name of the library where the sort sequence table is found. ═══ LANGID Option ═══ LANGID specifies the language identifier which is used in conjunction with the sort sequence. The LANGID option is used only when the SRTSEQ value in effect is LANGIDUNQ or LANGIDSHR. LANGID takes the form: LANGID(a) Where a is JOBRUN, JOB or "language-identifier".  JOBRUN indicates that the language identifier of the program will be resolved at run time. When the compiled program is run, the language identifier of the job is used. This value allows a program to be compiled once and used with different language identifiers at run time. This is the default value.  JOB indicates that the language identifier of the program will be resolved at compile time.  "language-identifier" is a valid 3 character language identifier. ═══ 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. NLSSORT The Sort sequence (SRTSEQ) and Language identifier (LANGID) specifications in the compiler options (or implied defaults) are used to determine the character code set used for all nonnumeric comparisons. literal The collating sequence established by the specification of literals in the alphabet-name clause is used for all nonnumeric comparisons. ═══ 1.88. 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 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. The compiler always returns +2. If the value of an expression to be raised to a power is zero, the exponent must have a value greater than zero. Otherwise, the size error condition exists. In any case, where no real number exists as a result of the evaluation, the size error condition exists. 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 innermost to the outermost 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 Parentheses either eliminate ambiguities in logic where consecutive operations appear at the same hierarchic level, or modify the normal hierarchic sequence of execution when this is necessary. When the order of consecutive operations at the same hierarchic level is not completely specified by parentheses, the order is from left to right. 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. There must be a one-to-one correspondence between left and right parentheses in an arithmetic expression, with each left parenthesis placed to the left of its corresponding right parenthesis. 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.89. 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 exists after an input-output operation, actions are taken according to the type of error handling in effect:  With standard error handling, if there is an applicable file status clause (but not an applicable USE procedure), the file status is updated, and control returns to the program. In the absence of a file status clause, USE procedure, or INVALID KEY phrase to handle the error, a run-time message is issued, giving you the option to end or return to the program.  Without standard error handling, the status key, if specified, is updated. If an explicit or implicit EXCEPTION/ERROR procedure is specified for the file, the procedure runs. If no such procedure is specified, the results are unpredictable. 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.90. Program-name ═══  The program-name is a user-defined word that identifies your program. The system uses the first 10 characters of the program-name as the identifying name of the program.  The first character must be alphabetic. If the first character is not alphabetic, it is converted as follows: - 0 is changed to J - 1 through 9 are changed to A through I.  If you use a non-trailing hyphen in positions 2 through 9 of the program-name, the hyphen is changed to zero (0). ═══ 1.91. 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. ═══ 1.92. 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.  Zero is raised to a negative number. If a SIZE ERROR clause is present, the SIZE ERROR imperative statement is executed.  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 phrase is not present and a size error condition occurs, the value of the affected resultant identifier is unpredictable. Values of other resultant identifiers are not affected, as long as no size error occurred for them. The size error condition applies only to final results, not to intermediate results. If the resultant identifier is defined with USAGE IS BINARY, 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 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.93. Reference Modification ═══ Reference modification resembles substringing in other computer languages. Reference modification defines a data item by specifying a starting position and length for the item. It is generally allowed anywhere an identifier referencing an alphanumeric data item is allowed. ┌──────────────────┐  │ ──data-name-1──┬──────────────────┼───────────────────── ├─OF─┬─data-name-2─┘ └─IN─┘ ───(leftmost-character-position:─┬────────┬─)──────────── └─length─┘ Without reference modification, you cannot use operands that are longer than 32 767 bytes in the following statements: ACCEPT CANCEL DISPLAY EVALUATE (relational condition) IF (relational condition) PERFORM (relational condition) STRING UNSTRING USE (USE FOR DEBUGGING) Note: When you use IF condition-name, an implicit comparison of the condition-name (88-level item) with its condition variable takes place, even though the condition variable is not referenced in the IF statement. Therefore, IF condition-name cannot be used when the associated condition variable is longer than 32 767 bytes. With reference modification, this 32 767-byte limit does not apply if the length of the operand is known at compilation time. In other words, the reference modification length specification (or starting position in the absence of a length specification) must be a numeric literal. Evaluation of Operands Reference modification for an operand is evaluated as follows:  If subscripting is specified for the operand, the reference modification is evaluated immediately after evaluation of the subscript.  If subscripting is not specified for the operand, the reference modification is evaluated at the time subscripting would be evaluated if subscripts had been specified. Reference modification creates a unique data item which is a subset of the data item referenced by data-name-1. This unique data item is considered an elementary data item without the JUSTIFIED clause. It has the same class and category as that defined for the data item referenced by data-name-1, except that the categories numeric, numeric-edited, and alphanumeric-edited are considered class and category alphanumeric. For example: MOVE whole-name(1:25) TO last-name This example transfers the first 25 characters in the variable whole-name to the variable last-name. Range Errors An out-of-range reference modification component, such as a leftmost-character-position of zero, causes system message MCH0603. This is the same message that signals errors in subscript ranges and character-string boundaries. Restrictions on Reference Modification The INDICATORS phrase does not support reference modification, and the same is generally true of record-names. The following statements do not support reference modification: INSPECT Extended ACCEPT Extended DISPLAY In addition, you cannot reference modify: identifier-3 of the STRING statement. identifier-1 of the UNSTRING statement. identifier-1 of the USE FOR DEBUGGING statement. identifier-3 of the STRING statement. For the START statement, you can reference modify the last occurrence of data-name-1 only. ═══ 1.94. ADDRESS Menu ═══ Select which occurrence of ADDRESS you want to display:  CALL STATEMENT Format 1 (CALL ON OVERFLOW)  CALL STATEMENT Format 2 (CALL ON EXCEPTION)  SET STATEMENT Format 5 (Pointer Data Item) ═══ 1.95. AFTER Menu ═══ Select which occurrence of AFTER you want to display:  USE AFTER EXCEPTION/ERROR PROCEDURE (USE Compiler-Directing Statement)  INSPECT Statement  PERFORM Statement Format 3 (PERFORM with UNTIL)  PERFORM Statement Format 4 (PERFORM with VARYING) ═══ 1.96. 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.97. ASSIGN Menu ═══ Select which occurrence of ASSIGN you want to display:  ASSIGN Clause (FILE-CONTROL Format 1 through Format 4)  ASSIGN Clause (FILE-CONTROL Format 5, Transaction File Entries) ═══ 1.98. BACKGROUND-COLOR/BACKGROUND-COLOUR Menu ═══ Select which occurrence of BACKGROUND-COLOR or BACKGROUND-COLOUR you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.99. BELL/BEEP Menu ═══ Select which occurrence of BELL or BEEP you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.100. 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.101. BLANK Menu ═══ Select which occurrence of BLANK you want to display:  BLANK WHEN ZERO Clause  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.102. BLINK Menu ═══ Select which occurrence of BLINK you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.103. CHARACTERS Menu ═══ Select which occurrence of CHARACTERS you want to display:  BLOCK CONTAINS Clause (Formatfile, Database, Disk Files)  BLOCK CONTAINS Clause (Diskette Files)  BLOCK CONTAINS Clause (Tapefile Files)  BLOCK CONTAINS Clause (Printer Files)  INSPECT Statement (with TALLYING Phrase)  INSPECT Statement (with REPLACING Phrase)  INSPECT Statement (with TALLYING and REPLACING Phrases)  RECORD Clause ═══ 1.104. 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.105. COLUMN/COL Menu ═══ Select which occurrence of COLUMN or COL you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.106. COMMITMENT Menu ═══ Select which occurrence of COMMITMENT you want to display:  COMMITMENT CONTROL Clause (I-O-CONTROL Format 1, Sequential Files)  COMMITMENT CONTROL Clause (I-O-CONTROL Format 2, Indexed and Relative Files) ═══ 1.107. CORRESPONDING/CORR Menu ═══ Select which occurrence of CORRESPONDING or CORR you want to display:  ADD Statement Format 3 (ADD with CORRESPONDING)  MOVE Statement Format 2 (MOVE with CORRESPONDING)  SUBTRACT Statement Format 3 (SUBTRACT with CORRESPONDING) ═══ 1.108. CRT Menu ═══ Select which occurrence of CRT you want to display:  CONSOLE IS CRT Clause (SPECIAL-NAMES Paragraph)  CRT STATUS Clause (SPECIAL-NAMES Paragraph)  FROM CRT Phrase (ACCEPT Statement Format 7)  FROM CRT Phrase (DISPLAY Statement Format 3) ═══ 1.109. DATA Menu ═══ Select which occurrence of DATA you want to display:  Data Division  DATA RECORDS Clause (Formatfile, Database, Disk Files)  DATA RECORDS Clause (Diskette Files)  DATA RECORDS Clause (Tapefile Files)  DATA RECORDS Clause (Printer Files)  DATA RECORDS Clause (Sort/Merge Files)  DATA RECORDS Clause (Transaction Files) ═══ 1.110. DEBUGGING Menu ═══ Select which occurrence of DEBUGGING you want to display:  DEBUGGING Declarative  DEBUGGING MODE Clause (SOURCE-COMPUTER Paragraph) ═══ 1.111. DEPENDING Menu ═══ Select which occurrence of DEPENDING you want to display:  Conditional GO TO Statement  OCCURS DEPENDING ON Clause (Variable-Length Tables) ═══ 1.112. DISPLAY Menu ═══ Select which occurrence of DISPLAY you want to view:  USAGE IS DISPLAY (USAGE Clause)  DISPLAY Statement ═══ 1.113. DIVISION Menu ═══ Select which occurrence of DIVISION you want to display:  Data Division  Environment Division  Identification Division  Procedure Division ═══ 1.114. END-ACCEPT Menu ═══ Select which occurrence of END-ACCEPT you want to display:  ACCEPT Statement Format 5 (PIP Data Area)  ACCEPT Statement Format 7 (Workstation I/O) ═══ 1.115. END-OF-PAGE/EOP Menu ═══ Select which occurrence of END-OF-PAGE or EOP you want to display:  WRITE Statement Format 1 (Sequential Files)  WRITE Statement Format 3 (Formatfile) ═══ 1.116. 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.117. EXIT Menu ═══ Select which occurrence of EXIT you want to display:  EXIT Statement  EXIT PROGRAM Statement ═══ 1.118. EXTERNALLY-DESCRIBED-KEY Menu ═══ Select which occurrence of EXTERNALLY-DESCRIBED-KEY you want to display:  EXTERNALLY-DESCRIBED-KEY (FILE-CONTROL Format 2, Indexed File Entries)  START Statement ═══ 1.119. FILE Menu ═══ Select which occurrence of FILE you want to display:  FILE SECTION  FILE-CONTROL Paragraph  MULTIPLE FILE TAPE Clause (I-O-CONTROL Paragraph, Sequential Files) ═══ 1.120. FOREGROUND-COLOR/FOREGROUND-COLOUR Menu ═══ Select which occurrence of FOREGROUND-COLOR or FOREGROUND-COLOUR you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.121. FORMAT Menu ═══ Select which occurrence of FORMAT you want to display:  DELETE Statement  READ Statement Format 1 (Sequential Retrieval using Sequential Access)  READ Statement Format 2 (Sequential Retrieval using Dynamic Access)  READ Statement Format 3 (Random Retrieval)  READ Statement Format 4 (TRANSACTION Nonsubfile)  READ Statement Format 5 (TRANSACTION Subfile)  REWRITE Statement Format 1  REWRITE Statement Format 2 (TRANSACTION Subfile)  START Statement  WRITE Statement Format 2 (Indexed and Relative Files)  WRITE Statement Format 3 (Formatfile)  WRITE Statement Format 4 (TRANSACTION Nonsubfile)  WRITE Statement Format 5 (TRANSACTION Subfile) ═══ 1.122. HIGHLIGHT Menu ═══ Select which occurrence of HIGHLIGHT you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.123. INDEXED Menu ═══ Select which occurrence of INDEXED you want to display:  INDEXED BY Phrase (OCCURS Clause)  ORGANIZATION IS INDEXED Clause (Indexed File Entries)  INDEXED BY Phrase (Data Description Entry Format 4, Boolean Data) ═══ 1.124. INDIC/INDICATOR/INDICATORS Menu ═══ Select which occurrence of INDIC, INDICATOR, or INDICATORS you want to display:  INDICATOR Clause (Data Description Entry Format 4, Boolean Data)  INDICATOR Clause (READ Statement Format 4, TRANSACTION Nonsubfile)  INDICATOR Clause (READ Statement Format 5, TRANSACTION Subfile)  INDICATOR Clause (REWRITE Statement Format 2, TRANSACTION Subfile)  INDICATOR Clause (WRITE Statement Format 3, Formatfile)  INDICATOR Clause (WRITE Statement Format 4, TRANSACTION Nonsubfile)  INDICATOR Clause (WRITE Statement Format 5, TRANSACTION Subfile)  INDICATOR Attribute (COPY Statement Format 2, DDS Translate) ═══ 1.125. INVALID Menu ═══ Select which occurrence of INVALID you want to display:  INVALID KEY Phrase (DELETE Statement)  INVALID KEY Phrase (READ Statement, Random Retrieval)  INVALID KEY Phrase (READ Statement, TRANSACTION Subfile)  INVALID KEY Phrase (REWRITE Statement)  INVALID KEY Phrase (REWRITE Statement, TRANSACTION Subfile)  INVALID KEY Phrase (START Statement)  INVALID KEY Phrase (WRITE Statement, Indexed and Relative Files)  INVALID KEY Phrase (WRITE Statement, TRANSACTION Subfile) ═══ 1.126. KEY Menu ═══ Select which occurrence of KEY you want to display:  RECORD KEY Clause (Indexed File Entries)  RELATIVE KEY Clause (Relative File Entries)  RELATIVE KEY Clause (Transaction File Entries)  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 Retrieval)  INVALID KEY Phrase (READ Statement, TRANSACTION Subfile)  INVALID KEY Phrase (REWRITE Statement)  INVALID KEY Phrase (REWRITE Statement, TRANSACTION Subfile)  INVALID KEY Phrase (START Statement)  INVALID KEY Phrase (WRITE Statement, Indexed and Relative Files)  INVALID KEY Phrase (WRITE Statement, TRANSACTION Subfile) ═══ 1.127. LABEL Menu ═══ Select which occurrence of LABEL you want to display:  LABEL RECORDS Clause (Formatfile, Database, Disk Files)  LABEL RECORDS Clause (Diskette Files)  LABEL RECORDS Clause (Tapefile Files)  LABEL RECORDS Clause (Printer Files)  LABEL RECORDS Clause (Transaction Files) ═══ 1.128. LIKE Menu ═══ Select which occurrence of LIKE you want to display:  LIKE Clause (Data Description Entry Format 1, All Data Division Sections)  LIKE Clause (Data Description Entry Format 4, Boolean Data) ═══ 1.129. NULL Menu ═══ Select which occurrence of NULL you want to display:  NULL Value Clause  SET Statement Format 5 (Pointer Data Item) ═══ 1.130. ORGANIZATION Menu ═══ Select which occurrence of ORGANIZATION you want to display:  ORGANIZATION IS INDEXED (Indexed File Entries)  ORGANIZATION IS RELATIVE (Relative File Entries)  ORGANIZATION IS SEQUENTIAL (Sequential File Entries)  ORGANIZATION IS TRANSACTION (Transaction File Entries) ═══ 1.131. PROCEDURE Menu ═══ Select which occurrence of PROCEDURE you want to display:  Procedure Division  USE Compiler-Directing Statement  MERGE Statement  SORT Statement ═══ 1.132. PROGRAM Menu ═══ Select which occurrence of PROGRAM you want to display:  EXIT PROGRAM Statement  PROGRAM COLLATING SEQUENCE Clause (OBJECT-COMPUTER Paragraph) ═══ 1.133. RANDOM Menu ═══ Select which occurrence of RANDOM you want to display:  ACCESS IS RANDOM (Indexed File Entries)  ACCESS IS RANDOM (Relative File Entries) ═══ 1.134. RECORD Menu ═══ Select which occurrence of RECORD you want to display:  RECORD Clause  RECORD KEY Clause (Indexed File Entries)  SAME RECORD AREA Clause (Sequential Files)  SAME RECORD AREA Clause (Indexed and Relative Files)  SAME RECORD AREA Clause (Sort/Merge Files)  DELETE Statement  READ Statement  RETURN Statement ═══ 1.135. RECORDS Menu ═══ Select which occurrence of RECORDS you want to display:  BLOCK CONTAINS Clause (Formatfile, Database, Disk Files)  BLOCK CONTAINS Clause (Diskette Files)  BLOCK CONTAINS Clause (Tapefile Files)  BLOCK CONTAINS Clause (Printer Files)  DATA RECORDS Clause (Formatfile, Database, Disk Files)  DATA RECORDS Clause (Diskette Files)  DATA RECORDS Clause (Tapefile Files)  DATA RECORDS Clause (Printer Files)  DATA RECORDS Clause (Sort/Merge Files)  DATA RECORDS Clause (Transaction Files)  LABEL RECORDS Clause (Formatfile, Database, Disk Files)  LABEL RECORDS Clause (Diskette Files)  LABEL RECORDS Clause (Tapefile Files)  LABEL RECORDS Clause (Printer Files)  LABEL RECORDS Clause (Transaction Files) ═══ 1.136. REMAINDER Menu ═══ Select which occurrence of REMAINDER you want to display:  DIVIDE Statement Format 4 (DIVIDE INTO, GIVING, with REMAINDER)  DIVIDE Statement Format 5 (DIVIDE BY, GIVING, with REMAINDER) ═══ 1.137. REPLACING Menu ═══ Select which occurrence of REPLACING you want to display:  COPY Compiler-Directing Statement  INITIALIZE Statement  INSPECT Statement Format 2  INSPECT Statement Format 3 ═══ 1.138. RERUN Menu ═══ Select which occurrence of RERUN you want to display:  RERUN Clause (I-O-CONTROL Format 1, Sequential Files)  RERUN Clause (I-O-CONTROL Format 2, Indexed and Relative Files) ═══ 1.139. REVERSE-VIDEO Menu ═══ Select which occurrence of REVERSE-VIDEO you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.140. REWIND Menu ═══ Select which occurrence of REWIND you want to display:  NO REWIND Clause (CLOSE Statement Format 1, Sequential Files)  NO REWIND Clause (OPEN Statement Format 1, Sequential Files) ═══ 1.141. SAME Menu ═══ Select which occurrence of SAME you want to display:  SAME AREA Clause (Sequential Files)  SAME AREA Clause (Indexed and Relative Files)  SAME AREA Clause (Sort/Merge Files)  SAME RECORD AREA Clause (Sequential Files)  SAME RECORD AREA Clause (Indexed and Relative Files)  SAME RECORD AREA Clause (Sort/Merge Files)  SAME SORT AREA Clause (Sort/Merge Files)  SAME SORT-MERGE AREA Clause (Sort/Merge Files) ═══ 1.142. 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.143. SEQUENTIAL Menu ═══ Select which occurrence of SEQUENTIAL you want to display:  ACCESS IS SEQUENTIAL (Sequential File Entries)  ACCESS IS SEQUENTIAL (Indexed File Entries)  ACCESS IS SEQUENTIAL (Relative File Entries)  ACCESS IS SEQUENTIAL (Transaction File Entries)  ORGANIZATION IS SEQUENTIAL (Sequential File Entries) ═══ 1.144. SIZE Menu ═══ Select which occurrence of SIZE you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.145. SORT Menu ═══ Select which occurrence of SORT you want to display:  SAME SORT AREA Clause (Sort/Merge Files)  SORT Statement ═══ 1.146. SUBFILE Menu ═══ Select which occurrence of END-ACCEPT you want to display:  READ Statement Format 5 (TRANSACTION Subfile)  REWRITE Statement Format 2 (TRANSACTION Subfile)  WRITE Statement Format 5 (TRANSACTION Subfile) ═══ 1.147. TALLYING Menu ═══ Select which occurrence of TALLYING you want to display:  INSPECT Statement Format 1 (INSPECT TALLYING)  INSPECT Statement Format 3 (INSPECT TALLYING, REPLACING)  UNSTRING Statement ═══ 1.148. TERMINAL Menu ═══ Select which occurrence of TERMINAL you want to display:  READ Statement Format 4 (TRANSACTION Nonsubfile)  READ Statement Format 5 (TRANSACTION Subfile)  REWRITE Statement Format 2 (TRANSACTION Subfile)  WRITE Statement Format 4 (TRANSACTION Nonsubfile)  WRITE Statement Format 5 (TRANSACTION Subfile) ═══ 1.149. 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.150. UNDERLINE Menu ═══ Select which occurrence of UNDERLINE you want to display:  ACCEPT Statement Format 7 (Workstation I/O)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.151. UPON Menu ═══ Select which occurrence of UPON you want to display:  DISPLAY Statement Format 1 (Data Transfer)  DISPLAY Statement Format 3 (Workstation I/O) ═══ 1.152. USAGE Menu ═══ Select which occurrence of USAGE you want to display:  USAGE Clause (Data Description Entry Format 1, All Data Division Sections)  USAGE Clause (Data Description Entry Format 4, Boolean Data) ═══ 1.153. USING Menu ═══ Select which occurrence of USING you want to display:  USING Phrase (Procedure Division Header)  CALL Statement Format 1 (CALL ON OVERFLOW)  CALL Statement Format 2 (CALL ON EXCEPTION)  MERGE Statement  SORT Statement ═══ 1.154. VALUE Menu ═══ Select which occurrence of VALUE you want to display:  VALUE Clause  VALUE OF Clause (Formatfile, Database, Disk Files)  VALUE OF Clause (Diskette Files)  VALUE OF Clause (Tapefile Files)  VALUE OF Clause (Printer Files) ═══ 1.155. WHEN Menu ═══ Select which occurrence of WHEN you want to display:  BLANK WHEN ZERO Clause (Data Description Entry Format 1, All Data Division Sections)  EVALUATE Statement ═══ 1.156. 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. ═══ ═══ The PROGRAM-ID paragraph specifies the name by which the program is known to the system. It is required and must be the first paragraph in the Identification Division. ═══ ═══ 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. 04/29/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. ═══ ═══ Computer-name represents a system-name. For example: IBM-AS400. ═══ ═══ MEMORY SIZE is the amount of storage needed to run 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 segment-number is an integer ranging from 1 through 49. ═══ ═══ Environment-name-2 is a 1-byte User Programmable Status Indicator (UPSI) switch, defined as UPSI-0 through UPSI-7, or as SYSTEM-SHUTDOWN. UPSI-0 through UPSI-7 represent eight 1-byte program switches. They are COBOL names that identify program switches defined outside the COBOL program at object time. Their contents are considered alphanumeric. A value of zero is off; a value of one is on. SYSTEM-SHUTDOWN is an internal switch that is set to ON status when the system operator puts the system in a shutdown-pending state or when the job is canceled in a controlled manner. The associated ON or OFF condition-names can be referenced anywhere a condition-name is valid. The program cannot alter their status. ═══ ═══ 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. ═══ ═══ 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 or literal-1 as a user-defined word or a nonnumeric literal. Any assignment-name or literal 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. ═══ ═══ NLSSORT specifies that the Sort sequence (SRTSEQ) and Language identifier (LANGID) specifications in the compiler options (or implied defaults) are used to determine the character code set used for all nonnumeric comparisons. ═══ ═══  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-1 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-1 consists. ═══ ═══ When you specify the THROUGH phrase, the contiguous EBCDIC characters 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 EBCDIC sequence. ═══ ═══ The CURRENCY SIGN IS clause specifies the currency symbol to be used in the PICTURE clause. When you omit the CURRENCY SIGN clause, 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 CONSOLE IS CRT clause treats any ACCEPT or DISPLAY statement without format-specific phrases (such as LOCAL-DATA or PIP-DATA) as an extended ACCEPT or DISPLAY statement. ═══ ═══ The CURSOR IS data-name-1 clause specifies the data item that will contain the cursor address used by the ACCEPT statement. ═══ ═══ The CRT STATUS IS data-name-2 clause specifies a data item into which a status value returns after an extended ACCEPT statement. ═══ ═══ data-name-2 Data-name-2 must be a 6-byte alphanumeric field or a 6-byte unsigned zoned integer, and it must be described in the WORKING-STORAGE SECTION of the program. ═══ ═══ The SELECT clause chooses a file in the COBOL program to be associated with an external medium. When file-name 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. ═══ ═══ File-name must be an FD or SD entry in the Data Division. File-name 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 specifies a sort or a merge file, only the ASSIGN clause may follow the SELECT clause. ═══ ═══ Device specifies the type of device that the file will use. The compiler checks whether the file is described and used in a consistent manner. ═══ ═══ Device specifies the type of device that the file will use. For TRANSACTION files device must be WORKSTATION. ═══ ═══ Attribute can be SI, which indicates that a separate indicator area is specified in the DDS for a FORMATFILE or WORKSTATION file. ═══ ═══ The attribute -SI specifies the file level option for a separate indicator area. If you code -SI, then -file-name must refer to a file that has the file level keyword INDARA specified in its DDS. ═══ ═══ -file-name is a 1- through 10-character external name of the display file or ICF file specified on the create device file commands CRTDSPF or CRTICFF. ═══ ═══ The RESERVE clause reserves input-output areas. It is syntax-checked, but is treated as documentation. ═══ ═══ 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. For database files, the ORGANIZATION clause indicates the current program usage of the file in the program. Therefore, the same database file can use SEQUENTIAL, INDEXED (assuming a keyed sequence access path exists), or RELATIVE in the ORGANIZATION clause. This is true regardless of what other programs that use this file specify. ═══ ═══ When you specify the ORGANIZATION IS INDEXED clause, the position of each logical record in the file is determined by the key sequence access path created with the file and maintained by the system. The access path is based on an embedded key 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 within the arrival sequence access path. ═══ ═══ The ORGANIZATION IS TRANSACTION clause signifies interaction between a COBOL program and either a workstation user or another system. ═══ ═══ 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. ═══ ═══  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 (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. ═══ ═══  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 (Indexed File Entries), records in the files are accessed in the sequence of ascending record key values according to the collating sequence of the file. ═══ ═══  When you specify ACCESS IS SEQUENTIAL, the format name contained in the format name field of the control area specifies which record was accessed.  When you specify ACCESS IS SEQUENTIAL for a TRANSACTION file, do not specify the RELATIVE KEY data item. ═══ ═══  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 2 (Indexed File 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.  In Format 3 (Relative File Entries), the value placed in a relative key data item specifies the record to be accessed. ═══ ═══  Dynamic-Access Mode allows a specific input-output to determine the access mode. Therefore, records may be processed sequentially or randomly.  In Format 2 (Indexed File Entries), records in the file may be accessed sequentially or randomly, depending on the form of the specific input-output request. ═══ ═══  Dynamic-Access Mode allows a specific input-output request to determine the access mode. Therefore, records may be processed sequentially and/or randomly.  In Format 3 (Relative File Entries), records in the file may be accessed sequentially or randomly, depending on the form of the specific input-output request. ═══ ═══  Dynamic-Access Mode allows a specific input-output request to determine the access mode. Therefore, records may be processed sequentially or randomly.  Random accessing of a TRANSACTION file is only valid if you are performing subfile processing. For subfile processing, you must specify ACCESS IS DYNAMIC. ═══ ═══ The RELATIVE KEY clause identifies a data-name that specifies the relative record number for a specific logical record within a relative file. ═══ ═══ The RELATIVE KEY clause specifies the relative record number for a specific record in a subfile. ═══ ═══ Data-name-3 is the RELATIVE KEY data item and you must define it as an unsigned integer. It cannot be scaled. You must not define the data item in a record description entry associated with the TRANSACTION file. ═══ ═══ The RECORD KEY clause specifies the data item within the record that is the record key for an indexed file. Each record in the file must have a unique record key value. ═══ ═══ 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. ═══ ═══ 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: - 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. ═══ ═══  The CONTROL-AREA clause specifies device-dependent and system-dependent information used to control input/output operations for TRANSACTION 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. ═══ ═══ The MULTIPLE FILE TAPE clause specifies that two or more files share the same physical reel of tape. This clause is syntax-checked, but it has no effect on the running of the program. The function is provided by the system through the CRTTAPF, CHGTAPF, and OVRTAPF CL commands. ═══ ═══ Assignment-name-1 can be any user defined word. ═══ ═══  A checkpoint record is to be written for every integer-1 record in file-name-2 that is processed.  When you specify multiple integer-1 RECORDS phrases, no two of them may specify the same file-name-2. ═══ ═══ 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. ═══ ═══ You must specify file-name-3 and file-name-4 in the FILE-CONTROL paragraph of the same program. ═══ ═══ 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 clause, at least one file-name specified must name a sort or merge file. ═══ ═══ The SAME SORT AREA clause is equivalent to the SAME SORT-MERGE AREA clause. 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. ═══ ═══ File-name-2 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.  You can also specify the record description entry for a file by using the Format 2 COPY statement (DD, DDR, DDS, DDSR option). This allows the field descriptions for a file to be exactly as defined in DDS. Also, programs are easier to write because you maintain the record format description in one place. ═══ ═══  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. ═══ ═══  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.  The ADDRESS OF special register exists for each record (01 or 77) in the Linkage Section, except for those records that redefine each other. In such cases, the ADDRESS OF special register is similarly redefined. The ADDRESS OF special register is implicitly defined USAGE IS POINTER. ═══ ═══ 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 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 keyword), it must be the first word following the level-number. If you omit the data-name or the keyword 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 between 1 and 3 000 000 bytes. ═══ ═══ Data-name-2 must be the name of the subject entry, or the name of an entry subordinate to the subject entry. If data-name-2 names the subject entry, that entire entry becomes the 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. ═══ ═══ 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. ═══ ═══ 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 no more than 32 767. ═══ ═══ 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 any table, that is, any storage position from the first character position in the table through the last character position in the table. ═══ ═══ 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, 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 running of the program; the program runs 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. ═══ ═══ Data-name refers to an elementary item, a group item, or an index-name. ═══ ═══ Integer specifies the difference in length between the new and existing items. If a blank or a + precedes the integer, the new item is longer. If a - precedes the integer, the new item is shorter. ═══ ═══ 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. ═══ ═══ Specify the COMPUTATIONAL phrase for internal decimal items. Such an item appears in storage as 2 digits per byte, with the sign contained in the 4 rightmost bits of the rightmost byte. An internal decimal item can contain any of the digits 0 through 9 plus a sign. If the PICTURE of an internal decimal item does not contain an S, the sign is occupied by a bit configuration that is interpreted as positive. ═══ ═══ 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. USAGE IS DISPLAY is valid for items that are:  Alphabetic  Alphanumeric  Alphanumeric-edited  Numeric-edited  Boolean  External decimal (numeric) ═══ ═══ A data item defined with the INDEX phrase is an index data item. An index data item is a 4-byte elementary item (not necessarily connected with any table) that you can use to save index-name values for future reference. You can use the SET statement to assign an index-name value to an index data item. ═══ ═══ 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 USING phrase of a CALL statement or the Procedure Division header  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 condition-name is a user-specified name that associates a single value, multiple values, and/or ranges 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. ═══ ═══ Data-name-1 explicitly identifies the data being described. If you specify data-name-1, it identifies a data item used in the program. If specified, data-name-1 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 keyword), it must be the first word following the level-number. If you omit data-name-1 or the keyword FILLER, the data item being described is treated as though FILLER had been specified. ═══ ═══ A PICTURE containing a single 1 defines an elementary Boolean data-name. ═══ ═══ A single 1 is a character position that contains a Boolean value of B"1" or B"0". Usage must be explicitly or implicitly defined as DISPLAY. ═══ ═══ USAGE must be defined implicitly or explicitly as DISPLAY. ═══ ═══ Data-name-4 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. ═══ ═══ If indicator fields are in a separate indicator area, the INDICATOR clause associates an indicator defined in DDS with a Boolean data item. If indicator fields are in the record area, the INDICATOR clause is syntax-checked, but is treated as documentation. You must specify the INDICATOR clause at an elementary level only. INDICATOR, INDICATORS, and INDIC are equivalent. ═══ ═══ Integer-3 must be a value of 1 through 99. ═══ ═══ The VALUE clause specifies the initial content of a Boolean data item. ═══ ═══ The allowable values for Boolean literals are B"0", B"1", and ZERO. ═══ ═══ For a STANDARD file, labels conforming to system specifications exist. ═══ ═══ For an OMITTED file, no labels exist. ═══ ═══  The CODE-SET clause specifies the character code used to represent data on the external media. When you specify the CODE-SET clause, an alphabet-name identifies the character code convention used to represent data on the input-output device.  The CODE-SET clause also specifies the algorithm for converting the character codes on the input-output medium from/to the internal EBCDIC character set.  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.  You can specify the CODE-SET clause for all files with sequential organization. ═══ ═══ You must define alphabet-name-1 in the SPECIAL-NAMES paragraph as:  STANDARD-1 (for ASCII-encoded files)  STANDARD-2 (for ISO 7-bit encoded files)  NATIVE (for EBCDIC-encoded files). When you specify NATIVE, the CODE-SET clause is syntax-checked, but it has no effect on the execution of the program. ═══ ═══ The BLOCK CONTAINS clause specifies the size of the physical records. If the records in ther file are not blocked, you may omit the BLOCK CONTAINS clause. Thus, you can omit this clause when each physical record contains only one complete logical record. For diskette files, this clause is syntax-checked only. ═══ ═══ Integer-1, integer-2 must be nonzero unsigned integers. The value of integer-2 only specifies the number CHARACTERS or RECORDS. Integer-2 specifies the exact character size of the physical record, and must include any control bytes or padding contained in the physical record. (Logical records do not include padding.) If integer-2 is zero, the system default blocking factor applies. ═══ ═══ The CHARACTERS phrase specifies the number of character positions required to store the physical record, independent of the USAGE the characters have within the data record. The CHARACTERS phrase is the default. You must specify CHARACTERS when the physical record contains padding. ═══ ═══ The RECORDS phrase 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 1 (with integer-4 only) of the RECORD CONTAINS clause specifies the number of character positions for fixed-length records. Integer-4 must be an unsigned integer that specifies the number of character positions contained in each record in the file. Format 2 (with both integer-3 and integer-4) of the RECORD CONTAINS clause specifies the number of character positions for either fixed- or variable-length records. Integer-3, integer-4 must be unsigned integers. Integer-3 specifies the size of the smallest data record, and integer-4 specifies the size of the largest data record. ═══ ═══ The LABEL RECORDS clause indicates the presence or absence of labels. ═══ ═══ The VALUE OF clause describes an item in the label records associated with this file. ═══ ═══ Data-name-1 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-2 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-3, integer-6 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-7 or the value of the data item in data-name-4 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-8 or the value of the data item in data-name-5 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-9 or the value of the data item in data-name-6 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. ═══ ═══ 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 must follow the level indicator (FD or SD), and must be the same as that specified in the associated SELECT clause. File-name must adhere to the rules of formation for a user-defined word; at least one character must be alphabetic. File-name must be unique within this program. One or more record description entries must follow file-name. 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 are optional; they may appear in any order. ═══ ═══  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. - 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 keyword SECTION, optionally followed by a segment-number, followed by a separator period. ═══ ═══  Segment-number is an integer varying in value from 1 through 49. ═══ ═══  A user-defined word that identifies a paragraph. A paragraph-name, because it can be qualified, need not be unique. Paragraph-name must begin in Area A. ═══ ═══  End each Declarative Section with another section-name followed by a USE sentence, or with the keywords END DECLARATIVES.  END DECLARATIVES must begin in Area A and must be followed by a separator period. No other text may appear on the same line. ═══ ═══ 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. ═══ ═══  Paragraph-name is a user-defined word that identifies a paragraph. A paragraph-name, because it can be qualified, need not be unique. ═══ ═══ Identifier is the receiving data item. ═══ ═══ Mnemonic-name must be associated in the SPECIAL-NAMES paragraph with an input/output device: a workstation (REQUESTOR), or a system operator's message queue (CONSOLE or SYSTEM-CONSOLE). ═══ ═══ Environment-name may be specified in place of mnemonic-name. Valid environment-names are CONSOLE and SYSIN. ═══ ═══ 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, 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, 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, and TIME implicitly have USAGE DISPLAY. Since they are conceptual items, they cannot be described in the COBOL program. ═══ ═══ Identifier is any fixed-length group item or an elementary alphabetic, alphanumeric, or external decimal item. The file must be defined in an FD entry, and must be open prior to the execution of the ACCEPT statement. If the file is not open, the contents of identifier remain unchanged. ═══ ═══ Mnemonic-name must be associated with an environment-name of OPEN-FEEDBACK or I-O-FEEDBACK in the SPECIAL-NAMES paragraph. ═══ ═══ File-name, in the FOR phrase, specifies the file from which the feedback information comes. When you do not specify the FOR phrase, the feedback information is from the last file opened or used in an input or output operation. ═══ ═══ Identifier-1 is the receiving data item. ═══ ═══ Mnemonic-name must be associated with an environment-name of LOCAL-DATA in the SPECIAL-NAMES paragraph. ═══ ═══ When you specify the FOR phrase, it is syntax checked during compilation but treated as a comment during execution. ═══ ═══ The value of literal or identifier-2 indicates the program device associated with the local data area. If you specify literal, it must be nonnumeric and 10 characters or less in length. If you specify identifier-2, it must refer to an alphanumeric data item, 10 characters or less in length. ═══ ═══ Mnemonic-name must be associated with an environment-name of PIP-DATA in the SPECIAL-NAMES paragraph. ═══ ═══ Any imperative statement specified in the ON EXCEPTION phrase is processed if the PIP data area does not exist (the job is not a prestart job). In the absence of the ON EXCEPTION phrase, a run-time message is issued if the PIP data area does not exist. ═══ ═══ Any imperative statement specified in the NOT ON EXCEPTION phrase is processed if the PIP data area exists (the job is a prestart job). ═══ ═══ Mnemonic-name must be associated with an environment-name of ATTRIBUTE-DATA in the SPECIAL-NAMES paragraph. You can only use the ATTRIBUTE-DATA mnemonic name to obtain information about a program device acquired by a TRANSACTION file. Attribute data does not provide information about the status of a completed or attempted I-O operation. Use the Format 3 ACCEPT statement with the I-O-FEEDBACK or OPEN-FEEDBACK mnemonic names to obtain information about I-O operations. ═══ ═══ If you omit both FOR phrases:  The default TRANSACTION file is being used, and the ACCEPT statement uses the program device from which a READ, WRITE, REWRITE, or ACCEPT (Attribute Data) operation on the default file was most recently performed.  If the only prior operation on the file was an OPEN, the ACCEPT statement uses the program device implicitly acquired by the file when the file was opened.  A program device must have been acquired in order to use this format of the ACCEPT statement. ═══ ═══ Literal-1 or the contents of identifier-2 indicates the program device name for which attribute data is made available. If you specify literal-1, it must be nonnumeric and 10 characters or less in length. The contents of identifier-2, if specified, must be an alphanumeric data item 10 characters or less in length. ═══ ═══ File-name-1 is the TRANSACTION file with which the interactive device is associated. If file-name-1 is not specified, the default file for the ACCEPT statement is the first TRANSACTION file specified in a SELECT clause of the FILE-CONTROL paragraph. ═══ ═══ Identifier-1 is a data item whose value may be updated. Fields accepted or displayed require an attribute byte before and after the field. For this reason, you cannot use line 1 and column 1 for data because that position is required for the first display attribute. The lowest position that you can use on the screen for data is line 1, column 2. ═══ ═══ The AT phrase indicates the absolute address on the screen at which the ACCEPT operation is to start. If you do not specify the AT phrase, the ACCEPT operation starts at line 1, column 2. The AT phrase does not indicate the starting position of the initial display attribute. ═══ ═══ The LINE phrase specifies the line number at which the screen item starts on the screen. The LINE and COLUMN phrases can appear in any order. ═══ ═══ Identifier-2 and integer-1 must be unsigned numeric integers with a value greater than or equal to zero. If the value for LINE or COLUMN is negative, the absolute value is taken. Identifier-2 or integer-1 is moved into a PIC 9(3) number. ═══ ═══ The COLUMN phrase specifies the column number at which the screen item starts on the screen. The LINE and COLUMN phrases can appear in any order. COL is an abbreviation for COLUMN. ═══ ═══ Identifier-3 must be a PIC 9(4) or a PIC 9(6) field. Integer-2 must be a 4- or 6-byte numeric field. If identifier-3 or integer-2 is 4 digits long, the first 2 digits specify the line, and the second 2 digits specify the column. If identifier-3 or integer-2 is 6 digits long, the first 3 digits specify the line, and the second 3 digits specify the column. ═══ ═══ The FROM CRT phrase indicates that the ACCEPT statement is extended. ═══ ═══ The MODE IS BLOCK phrase indicates that the identifier is treated as an elementary item; even if it is a group item, it is accepted as one item. ═══ ═══ The WITH phrase allows you to specify options for the ACCEPT operation. If you specify more than one item prior to this phrase, only the item immediately before the phrase is affected by it. ═══ ═══ When a field has been filled by operator input, the AUTO phrase automatically steps the cursor to the next input field, rather than waiting for a terminating character to be entered. If the field is the last in a group, AUTO-SKIP acts as if the ENTER key had been pressed. You can use AUTO and AUTO-SKIP interchangeably. ═══ ═══ If you specify the BELL phrase, an audible alarm sounds each time the item containing this phrase is accepted. You can use BELL and BEEP interchangeably. ═══ ═══ If you specify the BLINK phrase, the screen item blinks when it appears on the screen. ═══ ═══ If you specify the FULL phrase, the operator must either leave the screen item completely empty or fill it entirely with data. The FIELD-EXIT, FIELD+, and FIELD- keys are not allowed. Any attempt to use the delete key on the data within the input field, followed by the enter key, is also not allowed. The FULL phrase can be satisfied by data that is initially displayed. If this phrase is specified at a group level, it applies to all suitable subordinate elementary items. The FULL phrase is effective during the execution of any ACCEPT statement. You can use FULL and LENGTH-CHECK interchangeably. ═══ ═══ If you specify the HIGHLIGHT phrase, the screen item is in high-intensity mode when it appears on the screen. ═══ ═══ Use the REQUIRED phrase to ensure that the field does not remain empty. For alphanumeric items, this means that the field must contain at least one character other then a space or a hexadecimal zero. For numeric items, the field must contain a value other than zero. If a field remains empty when this phrase is specified, a run-time message will be issued which requires the operator to press the reset key and then re-enter the data. You can use REQUIRED and EMPTY-CHECK interchangeably. ═══ ═══ If you specify the REVERSE-VIDEO phrase, the screen item is displayed in reverse image. ═══ ═══ The SECURE phrase prevents operator-keyed data from appearing on the screen. You may specify this phrase on a group screen item, in which case it applies to all suitable elementary items which are subordinate to that item. When you specify the SECURE phrase, only spaces and the cursor appear on the screen. You can use SECURE and NO-ECHO interchangeably. ═══ ═══ If you specify the UNDERLINE phrase, the screen item is underlined when it appears on the screen. ═══ ═══ If you specify the RIGHT-JUSTIFY phrase, operator-keyed characters are moved on the screen to the rightmost character positions of the field. Trailing spaces and trailing hexadecimal zeros are removed. This phrase affects only non-edited data items. It takes effect upon display of the initial data in the data item and also upon termination of the ACCEPT operation. This is the only way in which numeric data is handled. If you defined the data item with the JUSTIFIED RIGHT clause in the DATA DIVISION, the data item is treated as if you had specified the RIGHT-JUSTIFY phrase. ═══ ═══ The SPACE-FILL phrase pertains to non-edited data items, and converts trailing hexadecimal zeros to spaces. The items appear on the screen with zero-suppression in all character positions. This takes effect upon display of initial data in the data item and again when the ACCEPT operation into the data item terminates. This phrase has no affect on edited fields. ═══ ═══ If you specify the TRAILING-SIGN phrase, the operational sign appears in the rightmost character position of the field. This takes effect upon display of initial data in the data item and also upon termination of the ACCEPT operation. This phrase affects only signed, non-edited numeric data items. If you do not specify this phrase, the sign precedes the number. ═══ ═══ If you specify the UPDATE phrase, the current contents of the data item are displayed before the operator is prompted to key in any new data. The initial data is then treated as though it were operator-keyed. If you do not specify the UPDATE phrase, and if the SECURE phrase was not coded, the initial data will be displayed. UPDATE is in effect by default unless you code the SECURE phrase. ═══ ═══ If you specify the ZERO-FILL phrase, non-edited items appear on the screen with no zero-suppression. For left-justified data, trailing spaces and trailing hexadecimal zeros are converted to zeros. For right-justified data, leading spaces are converted to zeros. This takes effect upon display of initial data in the data item and again when the ACCEPT operation into the data item terminates. It has no affect on edited fields. ═══ ═══ This phrase is syntax checked but is treated as documentation by the compiler. ═══ ═══ If you specify the ON EXCEPTION phrase, imperative-statement-1 is executed if the ACCEPT operation finishes with anything other than a normal completion (that is, if CRT Status Key 1 is other than zero. Using the ON EXCEPTION phrase does not prevent the generation of a run-time message for such conditions as workstation boundaries or out-of-screen ranges. ═══ ═══ If you specify the NOT ON EXCEPTION phrase, imperative-statement-2 is executed if the ACCEPT operation finishes with a normal completion. ═══ ═══ The literal or the contents of the identifier specify the program device to be acquired by the specified file. If you specify the literal, it must be nonnumeric and 10 characters in length. If you specify the identifier, it must be an alphnumeric data item 10 characters or less in length. ═══ ═══ File-name must be the name of a file with an organization of TRANSACTION, and the file must be open when the ACQUIRE statement runs. ═══ ═══ In Format 1, identifiers must name elementary numeric items. ═══ ═══ Literal-1 must be a numeric literal. ═══ ═══ 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. ═══ ═══ Literal must be numeric. ═══ ═══ 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 keyword CORRESPONDING must name group items. ═══ ═══ 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 must be an alphanumeric data item. Its contents must follow the rules for formation of a program-name. The first 10 characters of identifier-1 are used to associate the calling program with the called subprogram. If you specify identifier-1, the call is classified as a dynamic call because the PROGRAM-ID is resolved at run time each time a call is made. ═══ ═══ Literal-1 must be nonnumeric, uppercase, and must follow the rules for formation of a program-name. The first 10 characters of the literal are used to associate the calling program with the called subprogram. The literal must specify the program-name of the called subprogram. If you specify literal-1, the call is classified as a static call because the PROGRAM-ID is determined at compile time. ═══ ═══ The USING phrase makes data items defined in a calling program available to a called subprogram. Include the USING phrase in the CALL statement only if there is a USING phrase in the Procedure Division header of the called subprogram. The number of operands in each USING phrase must be identical. The order of appearance of USING identifiers in both the calling program and the called subprogram determines the relationship of single sets of data available to both programs. The relationship is positional and not by name. Corresponding identifiers must contain the same number of characters, although their data descriptions may be different. Each USING identifier names 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. ═══ ═══ 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. It can 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). You can specify up to 30 occurrences of this identifier. ═══ ═══ The value of a parameter passed through the BY REFERENCE phrase is evaluated when the CALL statement is executed. The value is assigned to the corresponding parameter of the called subprogram. The number of characters in each parameter must be equal, however the data descriptions need not be the same. When a COBOL/400 parameter is passed BY REFERENCE, a pointer in the original data item is passed to the called subprogram. Thus, by changing a parameter in the called subprogram, the data item in the calling program is changed. ═══ ═══ The value of a parameter passed through the BY CONTENT phrase is evaluated when the CALL statement is executed. The value is assigned to the corresponding parameter of the called subprogram. The number of characters in each parameter must be equal, however the data descriptions need not be the same. For each COBOL/400 item passed BY CONTENT, a copy of the item is made in the calling program, and a pointer to this copy is passed to the called subprogram. Thus, any changes made to the parameter in the called subprogram, will not be reflected in the data item of the calling program. ═══ ═══ The ADDRESS OF special register exists for each record ( 01 or 77) in the Linkage Section, except for those records that redefine each other. In such cases, the ADDRESS OF special register is similarly redefined. ADDRESS OF special register is implicitly defined USAGE IS POINTER. When a pointer data item is passed in a CALL statement, the item is treated as all other USING items. That is, a pointer to the pointer data item (or copy of the pointer data item) is passed to the called subprogram. ═══ ═══ LENGTH OF creates an implicit special register whose contents equal the current length, in bytes, of the data item referenced by the identifier. 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). You can use the LENGTH OF special register in the BY CONTENT phrase of the CALL statement. ═══ ═══ Specify literal-2 as any of the following:  A nonnumeric literal  A figurative constant  A Boolean literal  A numeric literal ═══ ═══ If you specify the ON OVERFLOW phrase in the CALL statement, control is transferred to imperative-statement-1 when the called subprogram cannot be made available. ═══ ═══ File-name-1 must appear in an FD entry. It passes a pointer data item that refers to a File Information Block (FIB). ═══ ═══ An exception condition occurs when the called subprogram cannot be made available. This occurs in one of two ways: 1. If you specify the ON EXCEPTION phrase in the CALL statement, control is transferred to imperative-statement-1. Execution then continues according to the rules for each statement specified in imperative-statement-1. If a procedure branching or conditional statement that 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-1, control is transferred to the end of the CALL statement and the NOT ON EXCEPTION phrase, if specified, is ignored. 2. If the ON EXCEPTION phrase is not specified in the CALL statement, the NOT ON EXCEPTION phrase, if specified, is ignored. ═══ ═══ If you specify the NOT ON EXCEPTION phrase in the CALL statement and the called subprogram can be made available (that is, no exception condition exists), control is transferred to the called subprogram. After control returns from the called subprogram, the ON EXCEPTION phrase, if specified, is ignored and control is transferred to the end of the CALL statement or, if the NOT ON EXCEPTION phrase is specified, to imperative-statement-2. If control is transferred to imperative-statement-2, execution continues according to the rules for each statement specified in imperative-statement-2. If a procedure branching or conditional statement that 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 CALL statement. If you specify this phrase and the ON OVERFLOW phrase, an error occurs. ═══ ═══ Routine-name is the name of the graphics routine you want to use. ═══ ═══ Data-name-1 specifies the parameters necessary to use certain graphics routines. The number of parameters that you must specify varies, depending on which routines you select. When you select a graphics routine, make sure each parameter is the correct size and data type as required by that routine. ═══ ═══ Identifier-1 or literal-1 specify the name of the subprogram to be canceled. It must be nonnumeric. The contents must conform to the rules for formation of a program-name. The first 10 characters of the literal or of the contents of the identifier identify the connection between the calling program and the called subprogram. 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 for multivolume or single volume tape files. The system always rewinds and unloads the tape when you specify REEL/UNIT on the CLOSE statement. REEL and UNIT are interchangeable. ═══ ═══ The FOR REMOVAL phrase is applicable only to tape files. The current volume is rewound and unloaded. The system is notified that the volume is logically removed from the run unit. However, the volume can be accessed again after a CLOSE operation without the REEL/UNIT phrase, and an OPEN operation for this file. The system always rewinds and unloads the tape when you specify REEL/UNIT on the CLOSE statement. ═══ ═══ The WITH NO REWIND phrase is applicable only to tape files. The current volume is left in its present position. The reel is not rewound. The system always rewinds and unloads the tape when you specify REEL/UNIT on the CLOSE statement. ═══ ═══ The WITH LOCK phrase ensures that the file cannot be reopened during this processing of the program. The record area associated with the file-name is no longer available after a successful CLOSE operation. ═══ ═══ Identifier-1 must name elementary numeric or elementary numeric-edited items. ═══ ═══ You must define file-name in an FD entry in the Data Division. It must be the name of an indexed or relative file. ═══ ═══ Use the FORMAT phrase to specify the value containing the name of the record format to use for this I-O operation. The system uses this to specify or select which record format must be operated on. A value of all blanks is treated as though you did not specify the FORMAT phrase. If the value is not valid for the file, a FILE STATUS of 9K is returned and an EXCEPTION/ERROR procedure is invoked, if applicable, for the file. ═══ ═══ Identifier-1 must be a character-string of ten characters or less, and it must be the name of one of the following:  A Working-Storage Section entry  A Linkage Section entry  A record-description entry for a previously opened file. ═══ ═══ Literal-1 must be an uppercase character-string of ten characters or less. ═══ ═══ Literal-1 may be any figurative constant. When you specify a figurative constant, only a single occurrence of that figurative constant is displayed. Each numeric literal must be an unsigned integer. Signed noninteger numeric literals are allowed. ═══ ═══ The UPON phrase specifies the output device to be used for the DISPLAY statement. The logical record length depends on the device:  The job log = 120 characters  The workstation = 58 characters  The system operator's message queue = 58 characters When you omit the UPON phrase, the DISPLAY statement sends output to the REQUESTOR (workstation). ═══ ═══ Mnemonic-name must be associated in the SPECIAL-NAMES paragraph with an input/output device: a workstation (REQUESTOR), or a system operator's message queue (CONSOLE or SYSTEM-CONSOLE). ═══ ═══ Environment-name may be specified in place of mnemonic-name. Valid environment-names are CONSOLE and SYSOUT. ═══ ═══ The DISPLAY statement's literal operands, or the contents of the DISPLAY statement's identifier operands, are written to the system-defined local data area of the job containing the program that issues the DISPLAY. The data is written to the local data area according to the rules for the MOVE statement for a group move without the CORRESPONDING phrase, and without padding on the right with spaces. ═══ ═══ Mnemonic-name must be associated with an environment-name of LOCAL-DATA in the SPECIAL-NAMES paragraph. ═══ ═══ When you specify the FOR phrase, it is syntax checked during compilation but treated as a comment during execution. ═══ ═══ The value of literal-2 or identifier-2 indicates the program device name of the device that is writing data to the local data area. There is only one local data area for each job, and all devices in a job access the same local data area. If you specify literal-2, it must be nonnumeric and 10 characters or less in length. If you specify identifier-2, it must refer to an alphanumeric data item, 10 characters or less in length. ═══ ═══ The AT phrase indicates the absolute address on the screen at which the DISPLAY operation is to start. If you do not specify the AT phrase, the DISPLAY operation starts at line 1, column 2. The AT phrase does not indicate the starting position of the leading attribute. ═══ ═══ Identifier-2 and integer-1 must be unsigned numeric integers with a value greater than or equal to zero. If the value for LINE or COLUMN is negative, the absolute value is taken. ═══ ═══ Identifier-3 must be a PIC 9(4) or a PIC 9(6) field. Integer-2 must be a 4- or 6-byte numeric field. If identifier-3 or integer-2 is 4 digits long, the first 2 digits specify the line, and the second 2 digits specify the column. If identifier-3 or integer-2 is 6 digits long, the first 3 digits specify the line, and the second 3 digits specify the column. ═══ ═══ The UPON CRT/CRT-UNDER phrase indicates that the DISPLAY statement is extended. CRT-UNDER also underlines the displayed item preceding the UPON CRT-UNDER phrase. ═══ ═══ The MODE IS BLOCK phrase indicates that the identifier is treated as an elementary item; even if it is a group item, it is displayed as one item. ═══ ═══ The WITH phrase allows you to specify options for the DISPLAY operation. If you specify more than one item prior to this phrase, only the item immediately before the phrase is affected by it. ═══ ═══ If you specify the BELL phrase, an audible alarm sounds each time the item containing this phrase is displayed. You can use BELL and BEEP interchangeably. ═══ ═══ BLANK is effective each time the screen item containing the clause displays. BLANK LINE erases from the current cursor position to the end of the current line. BLANK SCREEN erases the entire screen and places the cursor at line 1. The erasing is done before the item is displayed. ═══ ═══ The SIZE phrase specifies the size of the data item on the screen. You can use this phrase with elementary data items only. The SIZE phrase has no effect if the size you specify is zero. In this case, the length of the field is used to display the data item. ═══ ═══ Identifier-4 must be an unsigned numeric integer, and must not be subject to an OCCURS clause. Integer-3 must be unsigned. If identifier-4 has a sign, the compiler uses the absolute value, and issues a warning message. ═══ ═══ Identifier-1 and identifier-2 must name an elementary numeric item. ═══ ═══ Literal must be a numeric literal. ═══ ═══ Identifier-3 must name an elementary numeric or numeric-edited item. ═══ ═══ Identifier-3 and identifier-4 must name an elementary numeric or numeric-edited item. ═══ ═══ The quotient used to calculate the remainder is in an intermediate field. The value of the intermediate field is truncated rather than rounded. ═══ ═══ The result of subtracting the product of the quotient and the divisor from the dividend is stored in identifier-4. If identifier-3, the quotient, is a numeric-edited item, the quotient used to calculate the remainder is an intermediate field that contains the unedited quotient. Any subscripts for identifier-4 in the REMAINDER phrase are evaluated after the result of the divide operation is stored in identifier-3 of the GIVING phrase. ═══ ═══ If a size error occurs in the quotient, no remainder calculation is meaningful. Therefore, the contents of the quotient field (identifier-3) and the remainder field (identifier-4) are unchanged. If a size error occurs in the remainder, the contents of the remainder field (identifier-4) are unchanged. In either of these cases, you must analyze the results to determine which situation has actually occurred. Click here for more information about SIZE ERROR/NOT SIZE ERROR phrases. ═══ ═══ Use literal or the contents of the identifier to indicate the program device name of the device to be dropped. If you specify literal, it must be nonnumeric and 10 characters or less in length. If you specify identifier, it must refer to an alphanumeric data item, 10 characters or less in length. ═══ ═══ File-name must refer to a file with an organization of TRANSACTION, and the file must be open in order to be used in the DROP statement. If no DROP statement is issued, program devices attached to a TRANSACTION file are implicitly released when that file is finally closed. ═══ ═══ Language-name has no defined meaning. It must follow the rules for formation of a user-defined word. 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. ═══ ═══ You can interpret operands before the WHEN phrase in one of two ways, depending on how you specify them:  Individually, they are called selection subjects.  Collectively they are called a set of selection subjects. You can interpret operands in the WHEN phrase in one of two ways, depending on how you specify them:  Individually, they are called selection objects.  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 rules:  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.  Where identifiers are permitted, they can reference items whose usage is implicitly or explicitly defined as POINTER. ═══ ═══ The ALSO phrase separates selection subjects within a set of selection subjects and separates selection objects within 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 rules:  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.  Condition-1, and condition-2 may be any form of a conditional expression. ═══ ═══ 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. ═══ ═══ 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: 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. ═══ ═══ After the comparison operation is completed, execution of the EVALUATE statement proceeds as follows:  If a WHEN phrase is selected, execution continues with the first imperative-statement-1 following the selected WHEN phrase. Note that multiple WHEN statements are allowed for a single imperative-statement-1.  If no WHEN phrase is selected and a WHEN OTHER phrase is specified, execution continues with imperative-statement-2.  If no WHEN phrase is selected and no WHEN OTHER phrase is specified, execution continues with the next executable statement following the scope delimiter.  The scope of execution of the EVALUATE statement is terminated when execution reaches the end of the scope of the selected WHEN phrase or WHEN OTHER phrase, or when no WHEN phrase is selected and no WHEN OTHER phrase is specified. ═══ ═══ Procedure-name must name a procedure or a section in the Procedure Division. ═══ ═══ Procedure-name-1 must be a procedure or a section in the same Procedure Division as GO TO. ═══ ═══ 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. ═══ ═══ NEXT SENTENCE can be specified with END-IF. ═══ ═══ You can omit the ELSE NEXT SENTENCE phrase if it immediately precedes a separator period that ends the IF statement. ═══ ═══ Identifier-2 or literal-1 is the sending area. ═══ ═══ Identifier-1 is the inspected item and must be an elementary or group item with USAGE DISPLAY. ═══ ═══ Identifier-2, the count field, must be an elementary numeric data item defined without the symbol P in its PICTURE character-string. You must initialize identifier-2 before the INSPECT statement is performed. ═══ ═══ 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. ═══ ═══ 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. ═══ ═══ 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, provided that the leftmost such occurrence is at the point where comparison began in the first comparison cycle for which this tallying operand is eligible to participate. ═══ ═══ Identifier-3 is the tallying operand. Identifier-3 must be an elementary data item with USAGE DISPLAY. When the tallying operand is a figurative constant, it is considered to be a 1-character nonnumeric literal. ═══ ═══ 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. ═══ ═══ With the REPLACING phrase, the subject field and the substitution field must be the same length. ═══ ═══ If you specify CHARACTERS, the substitution field 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. ═══ ═══ 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. ═══ ═══ 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 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. ═══ ═══ 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. ═══ ═══ If you specify FIRST, the leftmost occurrence of the subject field in the inspected item is replaced by the substitution field. ═══ ═══ Identifier-3 is in the subject field when you specify the REPLACING phrase. Identifier-3 must be an elementary data item with USAGE DISPLAY. The subject field and the substitution field must be the same length. ═══ ═══ Literal-1 is in the subject field when you specify the REPLACING phrase. 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. ═══ ═══ File-name-1 is the name given in the SD entry that describes the records to be merged. No file-name can be repeated in the MERGE statement. ═══ ═══ 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. When you specify ASCENDING, the sequence is from the lowest key value to the highest key value. ═══ ═══ 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. When you specify DESCENDING, the sequence is from the highest key value to the lowest key value. ═══ ═══ 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 PROGRAM COLLATING SEQUENCE clause, the EBCDIC collating sequence is used. ═══ ═══ When you specify the USING phrase, all the records in file-name-2 and file-name-3 (the input files) are transferred to file-name-1 during the MERGE operation. 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 have sequential, relative, or indexed organization and be described in FD entries in the Data Division. Their record descriptions must describe records of the same size as the record described in the merge file. If the elementary items that make up these records are not identical, input records must have an equal number of character positions as the merge record. ═══ ═══ The OUTPUT PROCEDURE phrase specifies the procedure-names of a procedure that is to select or modify output records from the merge operation. The OUTPUT PROCEDURE must not contain any SORT or MERGE statements. ═══ ═══ Procedure-name-1 specifies the first (or only) section or paragraph in the OUTPUT PROCEDURE. ═══ ═══ Procedure-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). At the start of the execution of the MERGE statement, the file referenced by file-name-4 must not be open. ═══ ═══ 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). If file-name-1 is a logical database file, the records are added to the end of the file. If file-name-4 references an INDEXED file, then the associated KEY data-name for that file must have an ASCENDING KEY phrase in the MERGE statement. This same data-name must occupy the identical character positions in its record as the data item associated with the prime record key for the file. If file-name-4 references an RELATIVE file, the relative key data item for the first record returned contains the value '1' ; for the record returned, the value '2', and so on. After execution of the MERGE statement, the content of the relative kay data item indicates the last record returned to the file. All output files must have a sequential, relative or indexed organization. ═══ ═══ Identifier-1 or literal-1 is the sending item. When you specify Format 1, all identifiers may be either group or elementary items. Any length evaluation, subscripting , or reference modification associated with the sending item is evaluated only once, immediately before data is moved into the first of the receiving items. (Click here for information about reference modification.) ═══ ═══ Identifier-2 represents the receiving item. When you specify Format 1, all identifiers may be either group or elementary items. Any length evaluation, subscripting , or reference modification associated with a receiving item is evaluated immediately before data is moved into it. (Click here for information about reference modification.) ═══ ═══ 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. ═══ ═══ The INPUT phrase permits opening the file for input operations. The file position indicator is set to the first record in the file. If no records exist in the file, the file position indicator is set so that processing of the first sequential READ statement results in an AT END condition. ═══ ═══ File-name-1, file-name-2, file-name-3, and file-name-4, each designate 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. ═══ ═══ When you specify REVERSED, the OPEN operation positions the sequential tapefile at the last record in the file. When you read from an input file that is REVERSED, data records are read sequentially from the last record to the first record. You can use the REVERSED phrase only for sequential tapefiles opened in input mode. The REVERSED phrase is an obsolete element and will be deleted from the next revision of the ANSI Standard. ═══ ═══ Normally, the OPEN statement for a tapefile repositions the file so that it is read or written from the beginning. The NO REWIND phrase indicates that the OPEN operation will not reposition the tapefile. The system keeps track of the current position on the tape and automatically positions the tape to the proper place. When you process a multifile tape volume, specify the NO REWIND phrase on all CLOSE statements. When the next file on the volume is opened, the system determines which direction the tape should be moved to most efficiently get to the desired file. You can use the NO REWIND phrase for sequential tapefiles opened in input mode or output mode. ═══ ═══ When you specify the OUTPUT phrase, the file is opened to allow only output operations. When the file is successfully opened, it contains no records. If you open a physical file in output mode, all of the records in the file are cleared. If you open a logical file for OUTPUT, no records are cleared. The file is treated as though you had specified the EXTEND phrase. To clear a logical file, you must clear all of the members on which the logical file is based. ═══ ═══ When you specify the I-O phrase, the file is opened to allow both input and output operations. The file position indicator is set to the first record in the file. If no records exist in the file, the file position indicator is set so that processing of the first sequential READ statement results in an AT END condition. ═══ ═══ When you specify the EXTEND phrase, the sequential file is opened to allow you to add records immediately following the last record in the file. When you create a sequential file, you can open the file in extend mode. The EXTEND phrase is not allowed for files for which the LINAGE clause has been specified. ═══ ═══ File-name 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. ═══ ═══ 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. ═══ ═══ Imperative-statement represents the statements to be executed for an in-line PERFORM statement. ═══ ═══ 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 must be a positive signed integer. ═══ ═══ 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. ═══ ═══ 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 an integer data item. ═══ ═══ Literal-1 thru 4 must represent a numeric literal. ═══ ═══ 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, the subscript is evaluated each time the condition is tested. ═══ ═══ File-name must be defined in a Data Division FD entry, and must not name a sort or merge file. If more than one record-description entry is associated with file-name, these records automatically share the same storage area. That is, they are implicitly redefined. ═══ ═══ When you specify the INTO phrase, the current record moves from the input area to the identifier area according to the rules for the MOVE statement without the CORRESPONDING phrase. Any subscripting, indexing, or reference modification associated with the identifier is evaluated after the record has been read and immediately before it is transferred to the identifier. (Click here for information about reference modification.) You can specify the INTO phrase if:  Only one record description is subordinate to the file description entry, or,  All record-names associated with file-name, and the data item referenced by identifier-1, describe a group item, a numeric-edited item, or an elementary alphanumeric item. You cannot specify the INTO phrase when the file contains records of various sizes, as indicated by their record descriptions. The storage area associated with the identifier and the record area associated with the file-name cannot be the same storage area. ═══ ═══ Identifier-1 refers to a data item described as a group item, a numeric-edited item, or an elementary alphanumeric item. ═══ ═══ The NO LOCK phrase prevents the READ operation from obtaining record locks on files that you open in I-O (update) mode. A READ statement with this phrase also releases records that have been locked by a previous READ operation. If you use this phrase for a file that is not open in I-O mode, you receive an error message. ═══ ═══ The value specified in the FORMAT phrase contains the name of the record format to use for this I-O operation. The system uses this to specify or select which record format to operate on. ═══ ═══ Literal-1 or identifier-2 specifies the name of the record format to be read. If you specify literal-1 it must be nonnumeric, uppercase, and 10 characters or less in length. If you specify identifier-2, it must refer to an alphanumeric data item, 10 characters or less in length. If identifier-2 contains blanks, the READ statement runs as if the FORMAT phrase were omitted. ═══ ═══ The AT END phrase serves to explicitly delimit the scope of the READ statement. The imperative statement is executed when the AT END condition is detected. Any EXCEPTION/ERROR procedure for the file is not run. If the AT END phrase is not specified, any EXCEPTION/ERROR procedure for the file is run. Return from that procedure is to the next executable statement following the end of the READ statement. ═══ ═══ The NOT AT END phrase transfers control to the imperative statement upon successful completion of the READ operation. The imperative statement specifies procedures that will be performed when the AT END condition does not exist. ═══ ═══ For a dynamic access READ NEXT statement, the file position indicator is positioned to point to the next record in the file. That record is then made available. This applies to sequential retrieval from disk and database files, with either relative or indexed organization. If you omit NEXT, a random access read is done. ═══ ═══ For a dynamic access READ FIRST statement, the file position indicator is positioned to point to the first record in the file. That record is then made available. This applies to sequential retrieval from a database file with indexed organization. If you omit FIRST, a random access read is done. ═══ ═══ For a dynamic access READ LAST statement, the file position indicator is positioned to point to the last record in the file. That record is then made available. This applies to sequential retrieval from a database file with indexed organization. If you omit LAST, a random access read is done. ═══ ═══ For a dynamic access READ PRIOR statement, the file position indicator is positioned to point to the previous existing record in the file. That record is then made available. This applies to sequential retrieval from a database file with indexed organization. If you omit PRIOR, a random access read is done. ═══ ═══ The KEY IS phrase may be specified only for indexed files. The KEY IS phrase is syntax checked only and has no effect on the operation of the READ statement. ═══ ═══ Data-name-1 must identify a record key associated with file-name. Data--name-1 may be qualified but it may not be subscripted. ═══ ═══ The INVALID KEY phrase must be specified for files for which there is not an appropriate EXCEPTION/ERROR procedure. Click here for further information about the invalid key condition. ═══ ═══ After successful completion of a READ statement with the NOT INVALID KEY phrase, control transfers to the imperative statement associated with the phrase. ═══ ═══ The TERMINAL phrase specifies the program device from which the data record is made available. The program device must have been acquired before the READ operation. For a single device file, the TERMINAL phrase can be omitted. The program device is assumed to be that single device. If the TERMINAL phrase is omitted for a READ of a TRANSACTION file that has acquired multiple program devices, the default program device is used. ═══ ═══ Literal-2 or identifier-3 specifies the program device name. If you specify literal-2, it must be nonnumeric and 10 characters or less in length. If you specify identifier-3, it must refer to an alphanumeric data item 10 characters or less in length. If identifier-3 contains blanks, the READ statement executes as if the TERMINAL phrase had been omitted. ═══ ═══ The INDICATOR phrase specifies which indicators are to be read. When a data record is read, indicators can be read with it. The indicators can be used to pass information about the data record and how it was entered into the program. INDICATOR, INDICATORS, and INDIC are equivalent. ═══ ═══ Identifier-4 must be either an elementary Boolean data item specified without the OCCURS clause, or a group item that has elementary Boolean data items subordinate to it. ═══ ═══ When you specify the NO DATA phrase, the READ statement will determine whether data is immediately available. If data is available, the data is returned in the record area. If no data is immediately available, imperative-statement-1 is executed. The NO DATA phrase prevents the READ statement from waiting for data to become available. ═══ ═══ When you specify the SUBFILE phrase, it indicates that all formats referenced by the statement are subfiles. When you do not specify SUBFILE in a TRANSACTION I/O statement, it indicates that none of the formats referenced by the statement are subfiles. When SUBFILE is specified, a RELATIVE KEY data item must be defined for the file. Its value is referenced, and sometimes changed, by the I/O operation. When SUBFILE is not specified, the RELATIVE KEY data item associated with the file, if specified, is not referenced or changed by the I/O operation. You can specify the SUBFILE phrase only for display files. ═══ ═══ If you specify the FORMAT phrase, literal-1 or the contents of identifier-2 must specify a format which is active for the appropriate program device. The READ statement reads a data record of the specified format. When a format-name is not specified, the format used is the last record format written to the display device that contains input fields, input/output fields, or hidden fields. If no such format exists for the display file, the format used is the record format of the last WRITE operation to the display device. To ensure correct results, always specify the FORMAT phrase for multiple format files. ═══ ═══ The TERMINAL phrase specifies the program device from which the data record is made available. The program device must have been acquired before the READ operation. For a single device file, the TERMINAL phrase can be omitted. The program device is assumed to be that single device. If the TERMINAL phrase is omitted for a READ of a TRANSACTION file that has acquired multiple program devices, the default program device is used. If the TERMINAL phrase is omitted for a file that has multiple devices acquired for it, a record is read from the subfile associated with the default program device. ═══ ═══ The INVALID KEY phrase should be specified if the NEXT MODIFIED phrase is not specified and there is no applicable USE procedure specified for the file name. If the RELATIVE KEY data item contains a value that does not correspond to a relative record number for the subfile at the time of the execution of the READ statement, the INVALID KEY condition exists and the execution of the READ statement is unsuccessful. Click here for further information about the invalid key condition. ═══ ═══ The AT END phrase serves to explicitly delimit the scope of the READ statement. Specify the AT END phrase when you use the NEXT MODIFIED phrase and no applicable USE procedure is specified for the file name. If the AT END phrase and a USE procedure are both specified for a file, and the AT END condition arises, control transfers to the AT END imperative statement and the USE procedure is not executed. If you specify NEXT MODIFIED and there is no user-modified record in the subfile, the AT END condition exists, and the READ operation is unsuccessful. ═══ ═══ 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 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. If the SD entry is specified in a SAME RECORD AREA clause, record-name-1 is still available as a record of the other files named in that clause. ═══ ═══ 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 and record-name-1 must not refer to the same storage area. After the RELEASE statement has successfully executed, the information 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 on 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 a 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 specified by the NOT AT END phrase. Otherwise, control is passed to the end of the RETURN statement. ═══ ═══ Record-name-1 must be the name of a logical record in a Data Division FD entry. It must have the same number of character positions as the record being replaced. Record-name-1 may be qualified but it must not be subscripted, indexed, or reference modified. Identifier-1 and record-name-1 must not refer to the same storage area. ═══ ═══ FROM identifier-1 makes the REWRITE statement equivalent to: MOVE identifier TO record-name REWRITE record-name The MOVE is performed according to the rules for the MOVE statement without the CORRESPONDING phrase. 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 no longer available in record-name-1, but is still available in identifier-1. ═══ ═══ The value specified in the FORMAT phrase contains the name of the record format to use for this I-O operation. The system uses this to specify or select which record format to operate on. The FORMAT phrase is optional when processing a file that has one record format. ═══ ═══ Literal-1 or identifier-2 specifies the name of the record format to use for the rewrite operation. If you specify literal-1 it must be uppercase and 10 characters or less in length. If you specify identifier-2, it must be a character-string of 10 characters or less, and it must name one of the following:  A Working-Storage Section entry  A Linkage Section entry  A record-description entry for a previously opened file. A value of all blanks is treated as though the FORMAT phrase were not specified. ═══ ═══ When an INVALID KEY condition exists, the updating operation does not take place. The data in record-name is unaffected. 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 access mode is dynamic or random, and the file does not contain the record specified in the RELATIVE KEY data item. You must not specify the INVALID KEY phrase for a file with sequential organization. You can specify an EXCEPTION/ERROR procedure. Click here for further information about the invalid key condition. ═══ ═══ After successful completion of a REWRITE statement with the NOT INVALID KEY phrase, control transfers to the imperative statement associated with the phrase. ═══ ═══ The number of character positions in the record referenced by record-name-1 must be equal to the number of character positions in the record being replaced. The record replaced in the subfile is that record accessed by the previous read operation. ═══ ═══ Multiple data records, each with a different format, can be concurrently active for a TRANSACTION file. If you specify the FORMAT phrase, it must specify a valid format name that is defined to the system, and the I-O operation must be performed on a data record of the same format. The record format specified in the FORMAT phrase must be the record format accessed on the previous read operation. Literal-1 or the contents of identifier-2 must be the name of the subfile format accessed on the previous READ. ═══ ═══ The TERMINAL phrase indicates which program device's subfile is to have a record rewritten. If the TERMINAL phrase is specified, literal-2 or identifier-3 must refer to a workstation that has been acquired by the TRANSACTION file. The program device specified by the TERMINAL phrase must have been acquired, either explicitly or implicitly, and must have a subfile associated with the device. If you omit the TERMINAL phrase from a TRANSACTION file that has acquired multiple program devices, the subfile used is the subfile associated with the last program device from which a READ of the TRANSACTION file was attempted. ═══ ═══ Literal-2 or identifier-3 must be a valid program device name. If you specify literal-2, it must be nonnumeric and 10 characters or less in length. If you specify identifier-3, it must refer to an alphanumeric data item 10 characters or less in length. If literal-2 or identifier-3 contains blanks, the TERMINAL phrase has no effect. ═══ ═══ The INDICATOR phrase specifies which indicators are to be rewritten. When a data record is rewritten, indicators can be rewritten with it. The indicators can be rewritten with a data record to control how the data record is displayed. INDICATOR, INDICATORS, and INDIC are equivalent. ═══ ═══ The INVALID KEY condition exists at the time of the rewrite operation, if the RELATIVE KEY data item contains a value that does not correspond to the relative record number of the record from the previous read operation. The INVALID KEY phrase should be specified for files for which an appropriate USE procedure is not specified. Undesirable results may occur if the INVALID KEY phrase is not specified, and no USE procedure is specified. Click here for further information about the invalid key condition. ═══ ═══ 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 must refer to all occurrences within the table element; that is, it must not be subscripted or reference modified. Identifier-1 can be an index data item. ═══ ═══ 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. Before the search takes place, the values of all indexes should be set for higher dimensions of the table to define a specific table of identifier-1 elements. Identifier-1 must refer to all occurrences within the table element; that is, it must not be subscripted or indexed. Identifier-1 cannot be a pointer data item. The Data Division description of identifier-1 must contain an OCCURS clause with the INDEXED BY option. It must contain the KEY IS phrase in its OCCURS clause. In the WHEN phrase, if you specify an ASCENDING/DESCENDING KEY data item, explicitly or implicitly, you must also specify all preceding ASCENDING/DESCENDING KEY data-names for identifier-1. ═══ ═══ Identifier-2 must be either an index data item or an elementary integer item. ═══ ═══ 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 the VARYING index-name-1 phrase, the first (or only) index-name for identifier-1 is used for the search. ═══ ═══ 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. ═══ ═══ Condition-1 may be any conditional expression. ═══ ═══ If you specify the END-SEARCH phrase, you must not specify the NEXT SENTENCE phrase. ═══ ═══ Data-name-1, data-name-2 must specify an ASCENDING/DESCENDING KEY data item in the identifier-1 table element and must be indexed by the first identifier-1 index-name, along with other indexes or literals, as required. Data-name-1, data-name-2 may be qualified. ═══ ═══ Identifier-3 and identifier-4 must not be POINTER data items. They must not be ASCENDING/DESCENDING KEY data items for identifier-1 or an item that is indexed by the first index-name for identifier-1. ═══ ═══ 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 indexed by the first index-name for identifier-1. Click here for a description of arithmetic expressions. ═══ ═══ 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. ═══ ═══ 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. If you specify the END-SEARCH phrase, you must not specify the NEXT SENTENCE phrase. ═══ ═══ 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. ═══ ═══ Identifier-3 is the sending field and must name an elementary integer data item. ═══ ═══ Integer-2 is the sending field and must be an integer. ═══ ═══ Index-name-3 is the receiving field. 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, its 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. It can be subscripted, reference modified, or both. (Click here for information about reference modification.) Identifier-7 must name an item in the Linkage Section of any level except 66 or 88. ═══ ═══ 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 cannot be subscripted or 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 specify sequential or dynamic access mode, and 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 that is 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 specify sequential or dynamic access mode and must be described in FD entries in the Data Division. The output files must be indexed, relative or sequential files. ═══ ═══ 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 that is to select or modify input records before the sorting operation begins. ═══ ═══ 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. ═══ ═══ 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. ═══ ═══ EXTERNALLY-DESCRIBED-KEY indicates that the complete key field in the record area should be used in the comparison. You must specify RECORD KEY IS EXTERNALLY-DESCRIBED-KEY in the FILE-CONTROL paragraph for the file. ═══ ═══ For indexed files data-name-1 can be:  The RECORD KEY itself  An alphanumeric data item within a record description for the file whose leftmost character position corresponds to the leftmost character position of the key field in the record area. This data item must be less than or equal to the length of the record key for the file. For relative files data-name-1 must specify the RELATIVE KEY. When you do not specify the KEY phrase, KEY IS EQUAL (to the prime record key) is implied. Data-name-1 can be qualified or reference modified; it cannot be subscripted. (Click here for information about reference modification.) You can specify multiple data-names, however, all data-names following the initial data-name are syntax-checked only. ═══ ═══ Literal-1 or identifier-1 specifies the name of the record format to use for the start operation. If you specify literal-1 it must be uppercase and 10 characters or less in length. If you specify identifier-1, it must be a character-string of 10 characters or less, and it must name one of the following:  A Working-Storage Section entry  A Linkage Section entry  A record-description entry for a previously opened file. A value of all blanks is treated as though the FORMAT phrase were not specified. ═══ ═══ If the comparison is not satisfied by any record in the file, an invalid key condition exists; the value of the file position indicator is undefined, and the INVALID KEY imperative-statement, if specified, is processed. The INVALID KEY phrase must be specified for files in which an appropriate USE procedure is not specified, or if no EXCEPTION/ERROR procedure is explicity or implicitly specified. Click here for further information about the invalid key condition. ═══ ═══ After successful completion of a START statement with the NOT INVALID KEY phrase, control transfers to the imperative statement associated with the phrase. ═══ ═══ The NO LOCK phrase allows a START statement to be performed on a file without a record lock being applied to the file on which the START statement is performed. ═══ ═══ When you specify STOP RUN, execution of the run unit terminates, and control returns to the system. If a STOP RUN appears in a sequence of imperative statements, it must be the last or only statement in the sequence. The STOP RUN statement closes all files. ═══ ═══ Literal may be numeric or nonnumeric. It may be any figurative constant, except ALL literal. If literal is numeric, it must be an unsigned integer. When you specify STOP literal, the literal is communicated to the system operator, for batch jobs, and to the workstation, for interactive jobs. Program execution is suspended. The program resumes only after operator intervention. STOP literal is an obsolete element and is to be deleted from the next revision of the ANSI Standard. ═══ ═══ 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. ═══ ═══ 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. ═══ ═══ 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 or identifier-2 occupies the same storage area as identifier-3 or identifier-4, undefined results will occur, even if the identifiers are defined by the same data description entry. ═══ ═══ 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. ═══ ═══ SIZE transfers the complete sending area. ═══ ═══ 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-3 and identifier-4 occupy the same storage area, undefined results will occur, even if the identifiers are defined by the same data description entry. ═══ ═══ Identifier-4 represents the pointer field, which points to a character position in the receiving field. It must be an elementary integer item large enough to contain a value equal to the length of the receiving area plus 1. The pointer field must not contain the symbol P in its PICTURE character-string. ═══ ═══ 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. When this condition occurs, an overflow condition exists, and no more data is transferred. ═══ ═══ If at the time of execution of the STRING statement, conditions that would cause an overflow condition are not encountered, then after completion of the transfer of data, the ON OVERFLOW phrase, if specified, is ignored. Control is then transferred to the end of the STRING statement, or if the NOT ON OVERFLOW phrase is specified, to imperative-statement-2. ═══ ═══ In Format 1, identifier must name an elementary numeric item. ═══ ═══ In all formats, literal must be numeric. ═══ ═══ In Format 2, identifier must name an elementary numeric item, unless the identifier follows the word GIVING, in which case it must name a numeric or numeric-edited elementary item. ═══ ═══ In Format 3, identifier must name a group item. ═══ ═══ Identifier-1 represents the sending field. Data is transferred from this field to the receiving fields. Identifier-1 must be an alphanumeric data item; it cannot be reference modified. ═══ ═══ 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. ═══ ═══ Identifier-2 and identifier-3 each represent one delimiter and each must be an alphanumeric data item. ═══ ═══ Each literal-1 and literal-2 must be nonnumeric literals. 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. ═══ ═══ The ALL literal treats one or more contiguous occurrences of any delimiters as if they were only one occurrence, and this one occurrence is moved to the delimiter receiving field, if specified. The delimiting characters in the sending field are treated as an elementary alphanumeric item and are moved into the current delimiter receiving field, according to the rules of the MOVE statement. ═══ ═══ 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. ═══ ═══ DELIMITER IN represents the delimiter receiving fields. Unless you specify DELIMITED BY, you must not specify DELIMITER IN. Identifier-5 must be alphanumeric and must not be defined as alphanumeric-edited or numeric-edited. ═══ ═══ 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. Unless you specify DELIMITED BY, you must not specify COUNT IN. ═══ ═══ In the POINTER phrase, identifier-7 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. ═══ ═══ 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 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. ═══ ═══ If at the time of execution of the UNSTRING statement, conditions that would cause an overflow condition are not encountered, then after completion of the transfer of data, the ON OVERFLOW phrase, if specified, is ignored. Control is then transferred to the end of the UNSTRING statement, or if the NOT ON OVERFLOW phrase is specified, to imperative-statement-2. ═══ ═══ 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. ═══ ═══ 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, or a record description for another previously opened file. Identifier-1 must be an alphanumeric or numeric-edited item. Data is transferred from this field to the receiving fields. Identifier-1 and record-name-1 must not refer to the same storage area. After the WRITE statement has successfully executed, the information is still available in identifier-1, even though it may not be in record-name-1. ═══ ═══ The ADVANCING phrase controls the positioning of the output record on the page. If you omit this phrase, AFTER ADVANCING 1 LINE is assumed. When you specify:  BEFORE ADVANCING, the line is printed before the page is advanced.  AFTER ADVANCING, the page is advanced before the line is printed.  Identifier-2, the page is advanced the number of lines equal to the current value in identifier-2.  Integer-1, the page is advanced the number of lines equal to the value of integer-1.  Mnemonic-name-1, a system-specific action takes place.  PAGE, the record is printed on the logical page BEFORE or AFTER (depending on the phrase used) the device is positioned to the next logical page. If PAGE has no meaning for the device used, then BEFORE or AFTER (depending on the phrase specified) ADVANCING 1 LINE is provided. If the FD entry contains a LINAGE clause, the repositioning is to the first printable line of the next page, as specified in that clause. If you omit the LINAGE clause, the repositioning is to line 1 of the next succeeding page. Integer-1 or the value in identifier-2 may be zero. ═══ ═══ If the END-OF-PAGE condition does not exist after the processing of a WRITE statement with the NOT AT END-OF-PAGE phrase, control transfers to imperative-statement-2. ═══ ═══ Identifier-2 must be an integer data item. ═══ ═══ 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. ═══ ═══ Literal-1 or identifier-1 specifies the name of the record format to use for the write operation. If you specify literal-1 it must be uppercase and 10 characters or less in length. If you specify identifier-1, it must be a character-string of 10 characters or less, and it must name one of the following:  A Working-Storage Section entry  A Linkage Section entry  A record-description entry for a previously opened file. A value of all blanks is treated as though the FORMAT phrase were not specified. ═══ ═══ 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 passes to the imperative statement associated with this phrase. Click here for further information about the invalid key condition. ═══ ═══ The INDICATOR phrase specifies which indicators are to be written. When a data record is written, indicators can be written with it. The indicators can be used to pass information about the data record and how it was entered into the program. INDICATOR, INDICATORS, and INDIC are equivalent. ═══ ═══ Identifier-3 must be either an elementary Boolean data item specified without the OCCURS clause, or a group item that has elementary Boolean data items subordinate to it. ═══ ═══ The TERMINAL phrase specifies the program devices to which the output record is sent. If only a single program device file was acquired by the TRANSACTION file, the TERMINAL phrase can be omitted. That program device is always used for the WRITE. If the TERMINAL phrase is omitted for a WRITE operation to a TRANSACTION file that has acquired multiple program devices, the default program device is used. ═══ ═══ The contents of literal-2 or identifier-3 must be the name of a program device previously acquired, either implicitly or explicitly, by the file. If you specify literal-2, it must be nonnumeric and 10 characters or less in length. If you specify identifier-3, it must refer to an alphanumeric data item 10 characters or less in length. A value of blanks is treated as if the TERMINAL phrase were omitted. ═══ ═══ Identifier-4 must be an elementary numeric item. ═══ ═══ Literal-3 must be a numeric literal. ═══ ═══ All identifiers and literals must represent positive integer values. The roll starting line number (identifier-5 or literal-4) must not exceed the ending line number (identifier-6 or literal-5). ═══ ═══ All identifiers and literals must represent positive integer values. ═══ ═══ Identifier-8 must be either an elementary Boolean data item specified without the OCCURS clause, or a group item that has elementary Boolean data items subordinate to it. ═══ ═══ When you specify the SUBFILE phrase, it indicates that all formats referenced by the statement are subfiles. When you specify SUBFILE, the RELATIVE KEY clause must have been specified on the SELECT clause for the file being written. The record written to the subfile is the record in the subfile identified by the format name that has a relative record number equal to the value of the RELATIVE KEY data item. ═══ ═══ The TERMINAL phrase specifies which program device's subfile is to have a record written to it. If you specify the TERMINAL phrase, literal-2 or identifier-3 must refer to a workstation associated with the TRANSACTION file. If literal-2 or identifier-3 contains blanks, the TERMINAL phrase is treated as if it was not specified. The workstation specified by the TERMINAL phrase must have been acquired either explicitly or implicitly. If you omit the TERMINAL phrase, the subfile used is the subfile associated with the default program device. ═══ ═══ The contents of literal-2 or identifier-3 must be the name of a work station previously acquired, either implicitly or explicitly, by the file. If you specify literal-2, it must be nonnumeric and 10 characters or less in length. If you specify identifier-3, it must refer to an alphanumeric data item 10 characters or less in length. A value of blanks is treated as if the TERMINAL phrase were omitted. ═══ ═══ Identifier-4 must be either an elementary Boolean data item specified without the OCCURS clause, or a group item that has elementary Boolean data items subordinate to it. ═══ ═══ The INVALID KEY condition exists if a record is already in the subfile with that record number, or if the relative record number specified is greater than the maximum allowable subfile record number. The INVALID KEY phrase should be specified in the WRITE SUBFILE statement for all files for which an appropriate USE procedure is not specified. Click here for further information about the invalid key condition. ═══ ═══ The NOT INVALID KEY phrase allows you to specify procedures that will be performed when an invalid key condition does not exist for the WRITE statement. ═══ ═══ Start the characters *CONTROL or *CBL in any column beginning with column 8, followed by at least one space or comma and one or more option keywords. The option keywords must be separated by one or more spaces or commas. This statement must be the only statement on the line, and continuation is not allowed. The statement can end with a period. ═══ ═══ The input source program lines are printed from the point at which you specify *CONTROL SOURCE. If you specify *NOSOURCE as a compiler option, printing of the source is always suppressed. ═══ ═══ Specify NOSOURCE in order to suppress the printing of the source listing. If you specified *SOURCE as a compiler option, printing of the source listing is suppressed when the *CONTROL NOSOURCE statement is encountered. ═══ ═══ You can use the LIST, NOLIST, MAP, NOMAP options for compatibility only. ═══ ═══ 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. The resulting text must not contain a COPY statement. ═══ ═══ Text-name must follow the rules for formation of a program-name. The first 10 characters of text-name are used as the member name; these first 10 characters must, therefore, be unique within one file. If text-name is not qualified, QLBLSRC is assumed as the file name. If the file name is not qualified by a library name, it is assumed to reside in a library in the library list. ═══ ═══ Library-name must follow the rules for formation of a program-name. The first 10 characters of library-name are used as the identifying name; these first 10 characters must be unique within the system. ═══ ═══ File-name must follow the rules for formation of a program-name. ═══ ═══ The SUPPRESS phrase causes a COPY statement to suppress the listing of copied statements. For its duration, this type of COPY statement overrides any *CONTROL or *CBL statement. If the copied member contains *CONTROL or *CBL statements, the last one runs once the COPY member has been processed. ═══ ═══ Use the DD option to reference alias (alternate) names. The specification of an alias name in DDS allows a data name of up to 30 characters to be included in the COBOL program. When you use the DD option, any alias names present replace the corresponding DDS field names. All underscores in the alias names are translated into hyphens before any replacing occurs. ═══ ═══ The format-name is the name of the DDS record format definition that is to be translated into COBOL data description entries. The format-name must follow the rules for formation of any AS/400 name. ═══ ═══ If you specify ALL-FORMATS without the indicator attribute, each record format is generated as a redefinition of a 05 elementary item defined as either:  The size of the largest record format in the file, if the COPY statement appears in the FILE SECTION.  The size of the largest record format that will be generated, if the COPY statement appears outside of the FILE SECTION. When the indicator attribute is specified, no redefinition takes place. Instead, each of the formats generates a separate data structure. ═══ ═══ The DDR option does everything that the DD option does. It also replaces the characters which are not valid for COBOL: @, #, $, and _ in a field name (or alias name, if applicable), with the corresponding valid COBOL characters A, N, D, and - . As well, it removes underscores from the end of a field name. ═══ ═══ The DDS option copies in the internal DDS format field names. ═══ ═══ The DDSR option does everything the DDS option does. It also copies the internal DDS format field names, replacing the characters which are not valid for COBOL: @, #, $, and _ , with the valid COBOL characters A, N, D, and - , respectively. This option also removes any underscores from the ends of the field names. ═══ ═══ I, O, and I-O represent the usage attributes for the data description entries generated by the COPY statement. If you do not specify either -I or -O, I-O is assumed. If the file is a database file, a single I-O format is generated. Subfile records with only output or input/output fields, and no field indicators specified, generate I-O formats. For all other file types the description generated varies as follows:  If you specify -I, the generated data description entries contain either: - The input and input/output fields for a nonsubfile format - The input, output, and input/output fields for a subfile format.  If you specify -O, the generated data description entries contain the output and input/output fields. ═══ ═══ The INDICATOR attribute specifies whether or not data description entries are generated for indicators. If the INDICATOR attribute is specified, data description entries are generated for indicators, but not for data fields. INDICATOR, INDICATORS, and INDIC are equivalent. The data description entries that are generated are determined by which one of the usage attributes (I, O, I-O) is specified or assumed in the COPY statement.  If you specify I-INDICATOR, data description entries for input (response) indicators are generated for indicators used in the input record area.  If you specify O-INDICATOR, data description entries for output (option) indicators are generated for indicators used in the output record area.  If you specify I-O-INDICATOR, or it is assumed, separate data description entries for both input and output (response and option) indicators are generated for indicators used in the input and output record areas. ═══ ═══ 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 TITLE statement may appear anywhere in any of the divisions. The word TITLE may begin in either Area A or Area B. The TITLE statement may not be continued on another line. 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 must not be a figurative constant. ═══ ═══ File-name-1 is valid for all files. When you specify file-name-1, the procedure is run only for the files 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. The file-name phrase is also valid for TRANSACTION files. 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. ═══ ═══ INPUT is valid for all files. When you specify INPUT, the procedure is run for all files opened in INPUT mode that get an error. ═══ ═══ OUTPUT is valid for all files. When you specify OUTPUT, the procedure is run for all files 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 run for all files opened in I-O mode that get an error. The I-O phrase is also valid for TRANSACTION files. ═══ ═══ EXTEND is valid only for files with sequential organization and sequential access mode. When you specify EXTEND, the procedure is run for all files opened in EXTEND mode that get an error. ═══ ═══ When you specify file-name-1, that debugging section is executed:  After the execution of any CLOSE, DELETE, OPEN, or START statement that references file-name-1.  After execution of a READ file-name-1 where the AT END phrase or the INVALID KEY phrase was not run. Any given file-name may appear in only one USE FOR DEBUGGING sentence, and only once in that sentence. ═══ ═══ When you specify procedure-name-1, that degugging section is executed:  Before each running of the named procedure.  After running an ALTER statement referring to the named procedure. Except for the USE FOR DEBUGGING sentence itself, statements within a debugging declarative section can only refer to procedure names defined in a different USE procedure through the PERFORM statement. Procedure names within debugging declarative sections must not appear in USE FOR DEBUGGING sentences. Any given procedure-name may appear in only one USE FOR DEBUGGING sentence, and only once in that sentence. ═══ ═══ The ALL PROCEDURES phrase can be specified only once in a program. When ALL PROCEDURES is specified in a USE FOR DEBUGGING sentence, individual procedure-names must not be specified in any USE FOR DEBUGGING sentence. ═══ ═══ GENLVL specifies the severity level that determines if a program object is created. The severity level corresponds to the severity level of the messages produced during compilation of the program. If the severity level of error messages is greater than the value you specify, a program object is not created. For example, if you specify 19 for this parameter, a program object is not created if the severity level of any of the messages is 20 or greater. You can specify a one or two-digit number, 0 through 29. If errors occur with a severity level greater than this level, no program object is created. The default value for GENLVL is 29. ═══ ═══ When the COBOL source is compiled:  GEN indicates that the compiler creates a program object after the source program is compiled. GEN is the default value.  NOGEN indicates that the compiler does not create a program object after the source program is compiled. You might specify this option if you want only error listings at this time. ═══ ═══ When the COBOL source is compiled:  NOMAP indicates that the compiler does not list the Data Division map. NOMAP is the default value.  MAP indicates that the compiler lists the Data Division map. ═══ ═══ When the COBOL source is compiled:  NONUMBER indicates that the source-file sequence numbers are used for reference numbers. NONUMBER is the default value.  NUMBER indicates that the user-supplied sequence numbers (columns 1 through 6) are used for reference numbers.  LINENUMBER indicates that the sequence numbers created by the compiler are used for reference numbers. This option combines program source code and source code introduced by COPY statements into one consecutively numbered sequence. Use this option if you specify FIPS (Federal Information Processing Standards) flagging or SAA flagging. ═══ ═══ When the COBOL source is compiled:  NOSECLVL indicates that second-level message text is not listed for this compilation. NOSECLVL is the default value.  SECLVL indicates that second-level message text is listed for this compilation, along with the first-level message text. ═══ ═══ When the COBOL source is compiled:  NOOPTIONS indicates that options in effect are not listed for this compilation. NOOPTIONS is the default value.  OPTIONS indicates that options in effect are listed for this compilation. ═══ ═══ When the COBOL source is compiled:  QUOTE indicates that the delimiter quotation mark (") is used for nonnumeric literals and Boolean literals. This also specifies that the value of the figurative constant QUOTE has the EBCDIC value of a quotation mark. QUOTE is the default value.  APOST indicates that the delimiter apostrophe (') is used for nonnumeric literals and Boolean literals. This also specifies that the value of the figurative constant QUOTE has the EBCDIC value of an apostrophe. ═══ ═══ When the COBOL source is compiled:  NOSEQUENCE indicates that the reference numbers are not checked for sequence errors. NOSEQUENCE is the default value.  SEQUENCE indicates that the reference numbers are checked for sequence errors. Sequence errors do not occur if the LINENUMBER option is specified. ═══ ═══ When the COBOL source is compiled:  SOURCE or SRC indicates that the compiler produces a source listing, consisting of the COBOL source input and all compilation-time error messages. SOURCE or SRC are the default values.  NOSOURCE or NOSRC indicates that the compiler does not produce the source part of the listing. If you do not require a source listing, you should use this option because compilation may take less time. ═══ ═══ When the COBOL source is compiled:  NOVBSUM indicates that verb-usage counts are not printed. NOVBSUM is the default value.  VBSUM indicates that verb-usage counts are printed. ═══ ═══ When the COBOL source is compiled:  NOXREF indicates the compiler does not produce a cross-reference listing for the source program. NOXREF is the default value.  XREF indicates that the compiler produces a cross-reference listing for the source program. ═══ ═══ When the COBOL source is compiled:  PRTCORR indicates that the compiler inserts comment lines in the compiler listing indicating which elementary items were included as a result of the use of the CORRESPONDING phrase. PRTCORR is the default value.  NOPRTCORR indicates that the compiler does not insert comment lines in the compiler listing when the CORRESPONDING phrase is used. ═══ ═══ When the program object is created:  NOINZDLT indicates that relative files with sequential access are not initialized with deleted records during the CLOSE operation if the files were opened for OUTPUT. That is, the record boundary is determined by the number of records written at OPEN OUTPUT time. Subsequent OPEN operations allow access only up to the record boundary. NOINZDLT is the default value.  INZDLT indicates that relative files with sequential access are initialized with deleted records during the CLOSE operation if the files were opened for OUTPUT. Active records in the files are not affected. That is, the record boundary is defined as the file size for subsequent OPEN operations. ═══ ═══ When the program object is created:  NOLIST indicates that no IRP (intermediate representation of program), associated hexadecimal code, or error messages are listed. NOLIST is the default value.  LIST indicates that the IRP, its associated hexadecimal code, and any error messages are listed. ═══ ═══ When the program object is created:  STDERR indicates that standard error handling is used. STDERR is the default value.  NOSTDERR indicates that the error handling method of Version 1, Releases 1 and 2, is used. See the chapter on error handling in the COBOL/400 User's Guide for more information about error handling. ═══ ═══ When the program object is created:  NODDSFILLER indicates that if no matching fields are found by a COPY DDS statement, no field descriptions are created. NODDSFILLER is the default value.  DDSFILLER indicates that when no matching fields are found by a COPY DDS statement, a single character FILLER field description, "07 FILLER PIC X", is always created. ═══ ═══ When the program object is created:  NOSYNC indicates that the SYNCHRONIZED clause is syntax checked. NOSYNC is the default value.  SYNC indicates that the SYNCHRONIZED clause causes the alignment of an elementary item on a natural boundary in storage. ═══ ═══ When the program object is created:  NOCRTF indicates that files that are unavailable at the time of an OPEN operation are not created dynamically. NOCRTF is the default value.  CRTF indicates that files that are unavailable at the time of an OPEN operation are created dynamically. ═══ ═══ When the program object is created:  NODUPKEYCHK does not check for duplicate keys for INDEXED files. NODUPKEYCHK is the default value.  DUPKEYCHK checks for duplicate keys for INDEXED files. ═══ ═══ When the program object is created:  NOEXTACCDSP indicates that the compiler does not allow extended ACCEPT or extended DISPLAY statements. NOEXTACCDSP is the default value.  EXTACCDSP indicates that the compiler allows extended ACCEPT and extended DISPLAY statements. ═══ ═══ When the program object is created:  NOBLK indicates that the compiler allows blocking only of SEQUENTIAL access files with no START statement. If a BLOCK CONTAINS clause is specified, the BLOCK CONTAINS clause is ignored, except for tape files. NOBLK is the default value.  BLK indicates that the compiler allows blocking from DYNAMIC access files and SEQUENTIAL access files with a START statement, when used with BLOCK CONTAINS clause. Blocking is not allowed for RELATIVE files opened for output operations. The BLOCK CONTAINS clause controls the number of records to be blocked. When no BLOCK CONTAINS clause is specified, the compiler allows blocking only of SEQUENTIAL access files with no START statement. The operating system determines the number of records to be blocked. ═══ ═══ When the program object is created:  STDINZ indicates that the compiler initializes data items to system defaults, provided that the items are not subject to a VALUE clause. STDINZ is the default value.  NOSTDINZ indicates that for those items with no VALUE clause, the compiler does not initialize data items to system defaults. ═══ ═══ When the program object is created:  FS21DUPKY indicates that the compiler reports a file status of 21 when processing an indexed file with duplicate keys in random or dynamic access mode, if the value of the key is changed between the mandatory READ statement and a following REWRITE or DELETE statement. FS21DUPKY is the default value.  NOFS21DUPKY indicates that the compiler does not report a file status of 21 when processing an indexed file with duplicate keys in random or dynamic access mode. A REWRITE statement can change the key of a record. ═══ ═══ When the program object is created:  RANGE indicates that, at run-time, the system verifies that subscripts are within the correct ranges, but does not verify index ranges. It also checks for reference modification and compiler-generated substring operations. RANGE is the default value. (Click here for information about reference modification.)  NORANGE indicates that the system does not verify ranges at run-time. ═══ ═══ When the program object is created:  UNREF includes unreferenced data items in the compiled program. UNREF is the default value.  NOUNREF does not include unreferenced data items in the compiled program. This reduces the number of ODT (object definition table) entries used, allowing a larger program to be compiled. The unreferenced data items still appear in the cross-reference listings produced through the *XREF option. ═══ ═══  NOVARCHAR indicates that variable-length fields are ignored, and are declared as FILLER fields. NOVARCHAR is the default value.  VARCHAR indicates that variable-length fields are declared as fixed-length group items, and are accessible to the program. ═══ ═══  NODATETIME indicates that date, time, and timestamp data types are ignored, and are declared as FILLER fields. NODATETIME is the default value.  DATETIME indicates that date, time, and timestamp data types are declared as fixed-length character fields, and are accessible to the program. ═══ ═══  NOCVTGRAPHIC indicates that DBCS-graphic data types are ignored, and are declared as FILLER fields. NOCVTGRAPHIC is the default value.  CVTGRAPHIC indicates that fixed-length DBCS-graphic data types are declared as fixed-length alphanumeric fields, and are accessible to the program. When the VARCHAR option is also in use, variable-length DBCS-graphic data types are declared as fixed-length group items, and are accessible to the program. ═══ ═══ For FIPS flagging:  NOFIPS indicates that the source program is not FIPS flagged. NOFIPS is the default value.  MINIMUM indicates FIPS flag for minimum subset and higher.  INTERMEDIATE indicates FIPS flag for intermediate subset and higher.  HIGH indicates FIPS flag for high subset. ═══ ═══ For FIPS flagging:  NOSEG indicates that optional module SEGMENTATION is not FIPS flagged. NOSEG is the default value.  SEG1 performs FIPS flagging for optional module SEGMENTATION level 1 and higher.  SEG2 performs FIPS flagging for optional module SEGMENTATION level 2. ═══ ═══ For FIPS flagging:  NODEB indicates that optional module DEBUG is not FIPS flagged. NODEB is the default value.  DEB1 performs FIPS flagging for optional module DEBUG level 1 and higher.  DEB2 performs FIPS flagging for optional module DEBUG level 2. ═══ ═══ For FIPS flagging:  NOOBSOLETE indicates that obsolete language elements are not flagged. NOOBSOLETE is the default value.  OBSOLETE indicates that obsolete language elements are flagged. ═══ ═══ To specify if you want flagging of COBOL/400 functions that are not supported by SAA COBOL:  NOSAAFLAG indicates that SAA COBOL flagging is not performed. NOSAAFLAG is the default value.  SAAFLAG indicates that SAA COBOL flagging is performed. ═══ ═══ FLAG(nn) specifies the minimum severity level of messages to be printed.  0 indicates that all messages are printed. This is the default value.  severity-level (a one or two-digit number) indicates the minimum severity level of messages that are printed. Messages that have severity levels of the specified value or higher are listed. ═══ ═══ For file status 9M:  NOFS9MTO0M indicates that file status 9M is not changed to file status 0M. This is the default value.  FS9MTO0M indicates that file status 9M is changed to file status 0M. ═══ ═══ The GRAPHIC option of the PROCESS statement is available for processing DBCS characters in DBCS literals. This option is for DBCS systems only.  NOGRAPHIC indicates that DBCS characters in DBCS/SBCS (mixed) literals are processed. This is the default value.  GRAPHIC indicates that DBCS characters in DBCS literals are processed. ═══ ═══ For file status 9A:  NOFS9ATO0A indicates that file status 9A is not changed to file status 0A. This is the default value.  FS9ATO0A indicates that file status 9A is changed to file status 0A. ═══ ═══ 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. ═══ ═══ Data-name-1 must refer to a non-Boolean data item whose implicit or explicit usage is DISPLAY. Data-name-1 can be qualified or subscripted. Each character of a data item referenced by data-name-1 is assigned an ordinal number incrementing by one from the leftmost position to the rightmost position. The leftmost position is assigned the ordinal number of one. If the data description entry for data-name-1 contains a SIGN IS SEPARATE clause, the sign position is assigned an ordinal number within that data item. If the data item referenced by data-name-1 is described as numeric, numeric-edited, or alphanumeric-edited, it is operated upon for purposes of reference modification as if it were redefined as an alphanumeric data item of the same size as the data item referenced by data-name-1. ═══ ═══ Leftmost-character-position must be a numeric literal or an arithmetic expression. The evaluation of the leftmost-character-position must result in a positive nonzero integer that is less than or equal to the number of characters in the data item referenced by data-name-1. ═══ ═══ Length must be a numeric literal or an arithmetic expression. The evaluation of length must result in an integer that is greater than zero, and less than 32 768. If length is not specified, the unique data item created extends from and includes the character identified by leftmost-character-position up to and including the rightmost character of the data item referenced by data-name-1. Note: If the result of an arithmetic expression is something other than an integer, truncation occurs, resulting in an integer.