Data Division for File Input and Output [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Language Reference for the Series 700 and 800
Data Division for File Input and Output
File Section
In a COBOL program the file description entry (FD) represents the highest
level of organization in the File Section. The FILE SECTION header is
followed by a file description entry consisting of a level indicator
(FD), a file-name and a series of independent clauses. The FD clauses
specify the size of the logical and physical records, the external name
of the file, and the names of the data records which comprise the file.
The entry itself is terminated by a period.
An SD file description gives information about the size and the names of
the data records associated with the file to be sorted or merged. There
are no label procedures which the user can control, and the rules for
blocking and internal storage are peculiar to the SORT and MERGE
statements.
Relationship with SORT-MERGE
The sort-merge module provides the capability to sort elements of a table
in the Data Division. The files specified in the USING and GIVING
phrases of the SORT and MERGE statements must be described implicitly or
explicitly in the FILE-CONTROL paragraph as having sequential
organization and sequential access mode. No input-output statement can
be executed for the file named in the sort-merge file description.
________________________________________________________________________
|(ANS85) |
|The files specified in the USING and GIVING phrases of the SORT and |
|MERGE statements can be described explicitly in the FILE-CONTROL |
|paragraph as having either indexed or relative organization and can |
|have either sequential or dynamic access mode. |
________________________________________________________________________
Record Description Structure
A record description consists of a set of data description entries which
describe the characteristics of a particular record. Each data
description entry consists of a level-number, a data-name if required and
a series of independent clauses as required. A record description has a
hierarchical structure and, therefore, the clauses used with an entry can
vary considerably, depending upon whether or not it is followed by
subordinate entries. The structure of a record description is defined in
the section "Concept of Levels" in the chapter COBOL Concepts, while
the elements allowed in a record description are shown in the section
"The Data Description - Complete Entry Skeleton" in the chapter The
Nucleus.
The File Description - The Complete Entry Skeleton
Function
The file description comprises information concerning the physical
structure, identification, and record names pertaining to a given file.
________________________________________________________________________
|(MF) |
|It determines the internal or external attributes of a file connector,|
|of the associated data records, and of the associated data items. The|
|file description entry also determines whether a file-name is a local |
|name or a global name. |
________________________________________________________________________
General Formats
Format 1 (Record Sequential Files)
Format 3 (Relative and Indexed Files)
Format 4 (Sort-Merge Files)
Syntax Rules
All Formats (All Files)
1. The level indicator FD identifies the beginning of a file
description and must precede the file-name.
2. The clauses which follow the name of the file are optional in many
cases, and their order of appearance is immaterial.
________________________________________________________________________
|All clauses are optional. (ANS85) |
________________________________________________________________________
3. One or more record description entries must follow the file
description entry.
________________________________________________________________________
|(MF) |
| |
| |
| |
|4. If the VALUE OF FILE-ID clause is specified, literal-1 |
| must be a nonnumeric literal and cannot be a figurative |
| constant. |
| |
________________________________________________________________________
Format 4 (Sort-Merge Files)
5. The level indicator SD identifies the beginning of the sort-merge
file description and must precede the file-name.
6. The clauses which follow the name of the file are optional and their
order of appearance is immaterial.
7. One or more record description entries must follow the sort-merge
file description entry, however, no input-output statements can be
executed for this file.
________________________________________________________________________
|(MF) |
| |
| |
| |
|8. If the VALUE OF FILE-ID clause is specified, literal-1 |
| must be a nonnumeric literal and cannot be a figurative |
| constant. |
| |
________________________________________________________________________
General Rule
Format 1 (Record Sequential Files)
If the file description entry for a sequential file contains the LINAGE
clause and the EXTERNAL clause, the LINAGE-COUNTER data item is an
external data item. If the file description entry for a sequential file
contains the LINAGE clause and the GLOBAL clause, the special register
LINAGE-COUNTER is a global name.
The BLOCK CONTAINS Clause
Function
The BLOCK CONTAINS clause specifies the size of a physical record.
________________________________________________________________________
|(XOPEN) Although it is a part of the standard COBOL definition, this |
|feature is explicitly excluded from the X/Open COBOL language |
|definitions and should not be used in X/Open COBOL source programs. |
________________________________________________________________________
General Format
General Rule
________________________________________________________________________
|This clause is documentary only. (MF) |
________________________________________________________________________
The CODE-SET Clause
Function
The CODE-SET clause specifies the character code set used to represent
data on the external media.
It can only be specified for files with record sequential and line
sequential (MF) organization.
________________________________________________________________________
|(XOPEN) |
|Although it is a part of the standard COBOL definition, this feature |
|is explicitly excluded from the X/Open COBOL language definitions and |
|should not be used in X/Open COBOL source programs. |
________________________________________________________________________
General Format
CODE-SET IS alphabet-name [ FOR {identifier-1} ... ]
Syntax Rules
1. When the CODE-SET clause is specified for a file, all data in that
file must be described as usage is DISPLAY and any signed numeric
data must be described with the SIGN IS SEPARATE clause.
________________________________________________________________________
|These restrictions do not apply. (MF) |
________________________________________________________________________
2. The alphabet-name clause referenced by the CODE-SET clause must
not specify the literal phrase.
________________________________________________________________________
|These restrictions do not apply. (MF) |
________________________________________________________________________
________________________________________________________________________
|(MF) |
| |
| |
| |
|3. Identifier-1 can be qualified, but must not be subscripted. |
| |
|4. Each identifier-1 must be a data item described in a record |
| description for the file, and must not itself be a record |
| description. All identifier-1s must be described in the same |
| record description. |
| |
|5. If the optional FOR phrase is specified, the CODE-SET clause |
| specifies the character code to be used for the data items |
| named. If the FOR phrase is not specified, the CODE-SET |
| clause specifies the character code to be used for the whole |
| file. |
| |
|6. It is assumed for any file, or data item in a file, that no |
| CODE-SET clause applies to the native character set. This is by |
| default ASCII but can be changed by a COBOL system directive as |
| described in the COBOL System Reference. |
| |
|7. The data in the record area is always in ASCII. If alphabet-name |
| has been equated in the Special-names paragraph to EBCDIC, then |
| data affected by the CODE-SET clause is translated from ASCII to |
| EDCDIC as it is written to the file; or from EBCDIC to ASCII as |
| it is read from the file. If alphabet-name has been equated in |
| the Special- Names paragraph to STANDARD-1, STANDARD-2, NATIVE, |
| or ASCII, no translation is necessary. |
| |
|8. For the purposes of this translation, any data item to which a |
| CODE-SET clause applies is treated as alphanumeric. No account |
| is taken of the class and category of the item as described in |
| its data description. |
| |
|9. If identifier-1 has an OCCURS clause, the CODE-SET clause applies|
| to only the first occurrence of it. If identifier-1 has a |
| subordinate item with an OCCURS clause, the CODE-SET clause |
| applies to the whole of identifier-1. |
| |
________________________________________________________________________
The DATA RECORDS Clause
Function
The DATA RECORDS clause serves only as documentation for the names of
data records with their associated file.
________________________________________________________________________
|(ANS85) |
|The DATA RECORDS clause of the file description entry is classed as an|
|obsolete element in the ANSI'85 standard and is scheduled to be |
|deleted from the next full revision of the ANSI Standard. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|All dialects within this COBOL implementation fully support this |
|syntax. Refer to your COBOL System Reference for details on |
|using the FLAGSTD directive to detect all occurrences of this |
|syntax. |
________________________________________________________________________
________________________________________________________________________
|(XOPEN) |
|Although it is a part of the standard COBOL definition, this |
|feature is explicity excluded from the X/Open COBOL language |
|definitions and should not be used in a X/Open COBOL source |
|programs. |
________________________________________________________________________
General Format
Syntax Rule
Data-name-1 and data-name-2 are the names of data records and should have
01 level-number record descriptions, with the same names, associated with
them.
General Rules
1. The presence of more than one data-name indicates that the file
contains more than one type of data record. These records can be
of differing sizes, different formats, and so on. The order in
which they are listed is not significant.
2. Conceptually, all data records within a file share the same area.
This is in no way altered by the presence of more than one type of
data record within the file.
________________________________________________________________________
|The EXTERNAL Clause |
| |
|(ANS85) |
| |
|Function |
| |
|The EXTERNAL clause specifies that a data item or a file connector is |
|external. The constituent data items and group items of an external |
|data record are available to every program in the run unit which |
|describes that record. |
| |
|General Format |
| |
| IS EXTERNAL |
| |
|Syntax Rules |
| |
| |
| 1. The EXTERNAL clause can be specified only in file description |
| entries, or in record description entries in the |
| Working-Storage Section. |
| |
| 2. In the same program, the data-name specified as the subject of |
| the entry whose level-number is 01 that includes the EXTERNAL |
| clause must not be the same data-name specified for any |
| other data description entry which includes the EXTERNAL |
| clause. |
| |
| 3. The VALUE clause must not be used in any data description entry|
| that includes, or is subordinate to an entry that includes, the|
| EXTERNAL clause. The VALUE clause can be specified for |
| condition-name entries associated with such data description |
| entries. |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
|General Rules |
| |
| |
| 1. The data contained in the record named by the data-name clause |
| is external and can be accessed and processed by a program in |
| the run unit which describes and, optionally, redefines its |
| subject to the following general rules. |
| |
| 2. Within a run unit, if two or more programs describe the same |
| external data record, each record-name of the associated record|
| description entries must be the same and the records must |
| define the same number of standard data format characters. |
| However, a program which describes an external record can |
| contain a data description entry including the REDEFINES clause|
| which redefines the complete external record, and this complete|
| redefinition which need not occur identically in other programs|
| in the run unit. See the section "The REDEFINES Clause" in|
| the chapter The Nucleus. |
| |
| 3. Use of the EXTERNAL clause does not imply that the associated |
| file-name or data-name is a global name. See the section "The |
| GLOBAL Clause" later in this chapter. |
| |
| 4. The file connector associated with this description entry is an|
| external file connecter. |
| |
| |
| |
|5. See your COBOL System Reference for further information on files |
| with the EXTERNAL attribute. (MF) |
| |
________________________________________________________________________
The GLOBAL Clause
________________________________________________________________________
|(ANS85) |
| |
|Function |
| |
|The GLOBAL clause specifies that a data-name, a file-name, or |
|a report-name is a global name. A global name is available |
|to every program contained within the program which declares |
|it. |
| |
|General Format |
| |
| IS GLOBAL |
| |
|Syntax Rules |
| |
| |
| 1. The GLOBAL clause can be specified only in data description |
| entries whose level-number is 01 in the File Section or the |
| Working-Storage Section, file description entries, or report |
| description entries. |
| |
| The GLOBAL clause can also be specified in the Linkage Section.|
| (MF) |
| |
| 2. In the same Data Division, the data description entries for any|
| two data items for which the same data-name is specified must |
| not include the GLOBAL clause. |
| |
| 3. If the SAME RECORD AREA clause is specified for several files, |
| the record description entries or the file description entries |
| for these files must not include the GLOBAL clause. |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
|General Rules |
| |
| |
| 1. A data-name, file-name or report-name described using a GLOBAL |
| clause is a global name. All data-names subordinate to a |
| global name are global names. All condition-names associated |
| with a global name are global names. |
| |
| 2. A statement in a program contained directly or indirectly |
| within a program which describes a global name can reference |
| that name without describing it again. See the section Scope |
| Of Names in the chapter COBOL Concepts. |
| |
| 3. If the GLOBAL clause is used in a data description entry which |
| contains the REDEFINES clause, it is only the subject of that |
| REDEFINES clause which possesses the global attribute. |
________________________________________________________________________
The LABEL RECORDS Clause
Function
The LABEL RECORDS clause specifies whether labels are present.
________________________________________________________________________
|(ANS85) |
|The LABEL RECORDS clause is classed as an obsolete element in the |
|ANSI'85 standard and is scheduled to be deleted from the next full |
|revision of the ANSI Standard. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|All dialects within this COBOL implementation fully support this |
|syntax. Refer to your COBOL System Reference for details on |
|using the FLAGSTD directive to detect all occurrences of this |
|syntax. |
________________________________________________________________________
________________________________________________________________________
|(XOPEN) |
|Although it is a part of the standard COBOL definition, this feature |
|is explicitly excluded from the X/Open COBOL language definitions and |
|should not be used in X/Open COBOL source programs. |
________________________________________________________________________
General Format
Syntax Rules
1. This clause should be present in every file description entry.
________________________________________________________________________
|It is not required. (ANS85) |
________________________________________________________________________
________________________________________________________________________
|(OSVS) (VSC2) |
| |
| |
| |
|2. Data-name-1 is the name of a label record and should have a 01 |
| level-number record description, with the same name, associated |
| with it. |
| |
|3. Data-name-1 must not appear in the DATA RECORDS clause for the |
| file. |
| |
|4. Both LABEL RECORDS IS and LABEL RECORD ARE are accepted as valid |
| syntax. |
| |
________________________________________________________________________
General Rule
________________________________________________________________________
|This clause is documentary only. (MF) |
________________________________________________________________________
Linage-Counter
The reserved word LINAGE-COUNTER is a name for a special register
generated by the presence of a LINAGE clause in a file description entry
for a record sequential file. The implicit description is that of an
unsigned integer whose size is equal to integer-1 or the data item
referenced by data-name-1 in the LINAGE clause.
The LINAGE Clause
Function
The LINAGE clause allows the user to specify the depth of a logical page
in terms of number of lines. The user can also specify the size of the
top and bottom margins on the logical page, and the line number, within
the page body, at which the footing area begins.
It can be specified only for files with record sequential organization.
General Format
Syntax Rules
1. Data-name-1, data-name-2, data-name-3 and data-name-4 must
reference elementary unsigned numeric integer data items.
2. The value of integer-1 must be greater than zero.
3. The value of integer-2 must not be greater than integer-1.
4. The value of integer-3 and integer-4 can be zero.
General Rules
1. The LINAGE clause allows the user to specify the size of a logical
page in terms of number of lines. The logical page size is the
sum of the values referenced by each phrase except the FOOTING
phrase. If the FOOTING phrase is not specified, the values for
these functions are zero and no end-of-page condition independent
of the page overflow condition exists.
There is not necessarily any relationship between the size of the
logical page and the size of a physical page.
2. The value of integer-1 or the data item referenced by data-name-1
specifies the number of lines that can be written and/or spaced on
the logical page. The value must be greater than zero. That part
of the logical page in which these lines can be written and/or
spaced is called the page body.
3. The value of integer-2 or the data item referenced by data-name-2
specifies the line number within the page body at which the
footing area begins. The value must be greater than zero and not
greater than the value of integer-1 or the data item referenced by
data-name-1.
The footing area comprises the area of the logical page between
the line represented by the value of integer-2 of the data item
referenced by data-name-2, and the line represented by the value
of integer-1 or the data item referenced by data-name-1,
inclusive.
4. The value of integer-3 or the data item referenced by data-name-3
specifies the number of lines that comprise the top margin on the
logical page. The value can be zero.
The value of integer-4 or the data item referenced by data-name-4
specifies the number of lines that comprise the bottom margin on
the logical page. The value can be zero.
5. The value of integer-1, integer-3, and integer-4, if specified,
will be used at the time the file is opened by the execution of an
OPEN statement with the OUTPUT phrase, to specify the number of
lines that comprise each of the indicated sections of a logical
page. The value of integer-2, if specified, will be used at that
time to define the footing area. These values are used for all
logical pages written for the file during a given execution of the
program.
6. The values of the data items referenced by data-name-1,
data-name-3, and data-name-4, if specified at the time an open
statement with the OUTPUT phrase is executed for the file, will be
used to specify the number of lines that are to comprise each of
the indicated sections for the first logical page.
The value of the data item referenced by data-name-2, if
specified, will be used at the time an OPEN statement with the
OUTPUT phrase is executed for the file to define the footing area
for the first logical page.
7. A LINAGE-COUNTER is generated by the presence of a LINAGE clause.
The value in the LINAGE-COUNTER at any one time represents the
line number at which the device is positioned within the current
page body. The rules governing the LINAGE-COUNTER are as follows:
a. A separate LINAGE-COUNTER is supplied for each file
described in the File Section whose file description entry
contains a LINAGE clause.
b. LINAGE-COUNTER can be referenced, but can not be modified,
by PROCEDURE DIVISION statements. Since more than one
LINAGE-COUNTER can exist in a program, the user must
qualify LINAGE-COUNTER by file-name when necessary.
8. Each logical page is contiguous to the next with no additional
spacing provided.
Record Sequential Files Only
9. The values of the data items, at the time a WRITE statement with the
ADVANCING PAGE phrase is executed or page overflow condition occurs
(see the section "The WRITE Statement" later in this chapter),
will be used to specify the number of lines that are to comprise
each of the indicated sections for the next logical page.
10. The value of the data item referenced by data-name-2, if specified,
will be used at the time a WRITE statement with the ADVANCING PAGE
phrase is executed or a page overflow condition occurs, to define
the footing area for the next logical page.
11. LINAGE-COUNTER is automatically modified, according to the following
rules, during the execution of a WRITE statement to an associated
file:
* When the ADVANCING PAGE phrase of the WRITE statement is
specified, the LINAGE-COUNTER is automatically reset to one.
* When the ADVANCING identifier-2 or integer phrase of the
WRITE statement is specified, the LINAGE-COUNTER is
incremented by integer or the value of the data item
referenced by identifier-2.
* When the ADVANCING phrase of the WRITE statement is not
specified, the LINAGE-COUNTER is incremented by the value
one. (See the section "The WRITE Statement" later in
this chapter.)
* The value of LINAGE-COUNTER is automatically reset to one
when the device is repositioned to the first line that can be
written on for each of the succeeding logical pages. (See
the section "The WRITE Statement" later in this chapter.)
12. The value of LINAGE-COUNTER is automatically set to one when an OPEN
statement is executed for the associated file.
The RECORD Clause
Function
________________________________________________________________________
|(ANS85) |
|The RECORD clause specifies either the number of character positions |
|in a fixed length record or the range of character positions in a |
|variable length record. If the number of character positions varies, |
|the clause specifies the minimum and maximum number of character |
|positions. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|The concepts of FIXED and VARIABLE format files used throughout this |
|section do not directly apply to LINE SEQUENTIAL files. See your |
|COBOL System Reference for details on the implications of using LINE |
|SEQUENTIAL files in your COBOL implementation. |
________________________________________________________________________
________________________________________________________________________
|(XOPEN) |
|Although it is a part of the standard COBOL definition, the RECORD |
|CONTAINS clause is explicitly excluded from the X/Open COBOL |
|language definitions and should not be used in X/Open COBOL source |
|programs. |
________________________________________________________________________
General Formats
Format 1
RECORD CONTAINS integer-1 CHARACTERS
________________________________________________________________________
|(ANS85) |
| |
|Format 2 |
| |
| RECORD IS VARYING IN SIZE |
| [ [ FROM integer-2 ] [ TO integer-3 ] CHARACTERS ] |
| [ DEPENDING ON data-name-1 ] |
________________________________________________________________________
Format 3
RECORD CONTAINS [ integer-4 TO ] integer-5 CHARACTERS
Syntax Rules
Format 1
1. No record description entry for the file can specify a number of
character positions different from integer-1.
________________________________________________________________________
|(ANS85) |
| |
|Format 2 |
| |
| |
| |
|2. Record descriptions for the file must not describe records which |
| contain fewer character positions than specified by integer-2, |
| nor records which contain a greater number of character positions|
| than that specified by integer-3. |
| |
|3. Integer-3 must be greater than integer-2. |
| |
|4. Data-name-1 must describe an elementary unsigned integer in the |
| Working-Storage or Linkage Section. |
| |
________________________________________________________________________
General Rules
All Formats
1. If the RECORD clause is not specified, the size of each data is
completely defined in the record description entry.
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|2. If the associated file connector is an external file connector, |
| all file description entries in the run unit which are |
| associated with that file connector must specify the same |
| values for integer-1 or integer-2 and integer-3. If the |
| RECORD clause is not specified, all record description |
| entries associated with this file connector must be the same |
| length. |
| |
________________________________________________________________________
Format 1
3. Format 1 is used to specify fixed length records. Integer-1
specifies the number of character positions contained in each record
in the file.
________________________________________________________________________
|(ANS85) |
| |
|Format 2 |
| |
| |
| |
|4. Format 2 is used to specify variable length records. Integer-2 |
| specifies the minimum number of character positions to be |
| contained in any record of the file. Integer-3 specifies the |
| maximum number of character positions in any record of the |
| file. |
| |
|5. The number of character positions associated with a record |
| description is determined by the sum of the number of character |
| positions in all elementary data items excluding redefinitions |
| and renamings, plus any implicit FILLER due to synchronization. |
| If a table is specified: |
| |
| |
| a. The minimum number of table elements described in the |
| record is used in the summation above to determine the |
| minimum number of character positions associated with the |
| record description. |
| |
| b. The maximum number of table elements described in the |
| record is used in the summation above to determine the |
| maximum number of character positions associated with the |
| record description. |
| |
| c. If integer-2 is not specified, the minimum number of |
| character positions to be contained in any record of the |
| file is equal to the least number of character positions |
| described for a record in that file. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|6. If integer-3 is not specified, the maximum number of character |
| positions to be contained in any record of the file is equal to |
| the greatest number of character positions described for a record|
| in that file. |
| |
|7. If data-name-1 is specified, the number of character positions in|
| the record must be placed into the data item referenced by |
| data-name-1 before any RELEASE, REWRITE, or WRITE statement is |
| executed for the file. |
| |
|8. If data-name-1 is specified, the execution of a DELETE, RELEASE, |
| REWRITE, START, or WRITE statement or the unsuccessful execution |
| of a READ or RETURN statement does not alter the content of the |
| data item referenced by data-name-1. |
| |
|9. During the execution of a RELEASE, REWRITE, or WRITE statement, |
| the number of character positions in the record is determined by |
| the following conditions: |
| |
| |
| a. If data-name-1 is specified, by the content of the data |
| item referenced by data-name-1. |
| |
| b. If data-name-1 is not specified and the record does not |
| contain a variable occurrence data item, by the number of |
| character positions in the record. |
| |
| c. If data-name-1 is not specified and the record does |
| contain a variable occurrence data item, by the sum of the|
| fixed portion and that portion of the table described by |
| the number of occurrences at the time of execution of the |
| output statement. If the number of character positions |
| in the logical record which is to be written is |
| less than integer-2 or greater than integer-3, the |
| output statement is unsuccessful and, except during |
| execution of a RELEASE statement, the associated I/O |
| status is set to a value indicating the cause of the |
| condition. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|10. If data-name-1 is specified, after the successful execution of a |
| READ or RETURN statement for the file, the contents of the data |
| item referenced by data-name-1 will indicate the number of |
| character positions in the record just read. |
| |
|11. If the INTO phrase is specified in the READ or RETURN statement, |
| the number of character positions in the current record that |
| participate as the sending data items in the implicit MOVE |
| statement is determined by the following conditions: |
| |
| |
| a. If data-name-1 is specified, by the content of the data |
| item referenced by data-name-1. |
| |
| b. If data-name-1 is not specified, by the value that would |
| have been moved into the data item referenced by |
| data-name-1 had data-name-1 been specified. |
| |
________________________________________________________________________
Format 3
12. When format 3 of the RECORD clause is used, integer-4 and integer-5
refer to the minimum number of characters in the smallest size data
record and the maximum number of characters in the largest size data
record respectively. However, in this case, the size of each data
record is completely defined in the record description entry.
13. The size of each data record is specified in terms of the number of
character positions required to store the logical record, regardless
of the types of characters used to represent the items within the
logical record. The size of a record is determined by the sum of
the number of characters in all fixed length elementary items plus
the sum of the maximum number of characters in any variable length
item subordinate to the record. This sum can be different from the
actual size of the record. See the section "Selection of Character
Representation and Radix" in the chapter COBOL Concepts, and the
sections "The SYNCHRONIZED Clause" and "The USAGE Clause" in
the chapter The Nucleus.
The RECORDING MODE Clause
(OSVS) (VSC2) (MF)
Function
The RECORDING MODE clause specifies the format of the logical records in
the file.
General Formats
Format 1 (Record Sequential Files)
General Rules
(OSVS) (VSC2) (MF)
All Formats (All Files)
1. Specifying RECORDING MODE IS F causes all the records in the file to
be the same length. F and FIXED are synonyms. (MF)
Format 1 (Record Sequential Files)
________________________________________________________________________
| |
| 2. The "U" and "S" options are documentary only. (MF) |
| |
________________________________________________________________________
________________________________________________________________________
|(MF) |
| |
|Format 2 (Line Sequential Files) |
| |
| |
| |
|3. The RECORDING MODE IS V clause is documentary only. |
| |
________________________________________________________________________
Formats 1 and 3 (Record Sequential, Relative and Indexed Files)
4. When RECORDING MODE IS V is specified, the records in the file can
be either fixed or variable in length. Each data record includes a
record length field. These fields are not part of the record
description. V and VARIABLE are synonyms. (MF)
The VALUE OF Clause
Function
The VALUE OF clause specifies the description of an item in the label
records associated with a file.
________________________________________________________________________
|(ANS85) |
|The VALUE OF clause of the file description entry is classed as an |
|obsolete element in the ANSI'85 standard and is scheduled to be |
|deleted from the next full revision of the ANSI Standard. |
________________________________________________________________________
________________________________________________________________________
|(MF) |
|All dialects within this COBOL implementation fully support this |
|syntax. Refer to your COBOL System Reference for details on |
|using the FLAGSTD directive to detect all occurrences of this |
|syntax. |
________________________________________________________________________
________________________________________________________________________
|(XOPEN) |
|Although it is a part of the standard COBOL definition, this feature |
|is explicitly excluded from the X/Open COBOL language definitions and |
|should not be used in X/Open COBOL source programs. |
________________________________________________________________________
General Formats
Format 1 (All Files)
Syntax Rules
Format 1 (All Files)
1. Data-name-1 should be qualified when necessary but cannot be
subscripted or indexed, nor can it be an item described with the
USAGE IS INDEX clause.
2. Data-name-2 must be in the Working-Storage Section.
________________________________________________________________________
|(MF) |
| |
|Format 2 (All Files) |
| |
| |
| |
|3. Literal-2 must be a nonnumeric literal and cannot be a figurative|
| constant. |
| |
|4. The VALUE OF FILE-ID clause cannot be used if |
| external-file-reference, data-name-2 or literal-2 has been |
| specified in the ASSIGN clause in the File-Control Entry (see |
| the section "The FILE-CONTROL Entry" earlier in this |
| chapter). |
| |
________________________________________________________________________
General Rules
Format 1 (All Files)
________________________________________________________________________
|(MF) |
| |
| |
| |
|1. This clause is documentary only. |
| |
________________________________________________________________________
2. A figurative constant can be substituted wherever a literal is
specified.
3. If the category of data-name-1, data-name-3, and so on, is numeric
or a numeric edited item containing only Z's or 9's then the value
of literal-1, literal-2, and so on, should be numeric.
4. If the category of data-name-1, data-name-3, and so on, is
alphabetic, alphanumeric or alphanumeric edited then the value of
literal-1, literal-2, and so on, should be nonnumeric.
________________________________________________________________________
|(MF) |
| |
| |
| |
|5. The character-string specified in literal-2 or data-name-2 is |
| taken as the external file-name. |
| |
________________________________________________________________________
MPE/iX 5.0 Documentation