File Section (Cont.) [ Micro Focus COBOL Language Reference ] MPE/iX 5.0 Documentation
Micro Focus COBOL Language Reference
File Section (Cont.)
For OSVS, MF and VSC2 only: The RECORDING MODE Clause
Function.
The RECORDING MODE clause specifies the format of the logical records in
the file.
General Formats.
Format 1 (Record Sequential Files).
For MF only: Format 2 (Line Sequential Files).
For MF only: Format 3 (Relative and Indexed Files).
For MF only: Syntax Rules.
1. F and FIXED are synonyms.
2. V and VARIABLE are synonyms.
General Rules.
All Formats (All Files).
1. Specifying RECORDING MODE IS F causes all the records in the file
to be the same length.
For MF only: Format 1 (Record Sequential Files).
2. The "U" and "S" options are documentary only.
For OSVS, MF and VSC2 only: Formats 1 and 3 (Record Sequential,
Relative.
and Indexed Files)
3. 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.
For MF only: Format 2.
4. Line sequential files are neither truly fixed nor truly variable
format files: the presence or absence of any RECORDING MODE,
RECORD CONTAINS or RECORD VARYING IN SIZE clause does not,
therefore, impact their performance.
The REDEFINES Clause
Function.
The REDEFINES clause allows the same computer storage area to be
described by different data description entries.
General Format.
Note that level-number and data-name-1 or FILLER (ANS85) are shown in the
above format to improve clarity. Level-number, and data-name-1 and
FILLER (ANS85) are not part of the REDEFINES clause.
Syntax Rules.
1. The REDEFINES clause, when specified, must immediately follow
data-name-1 or FILLER (ANS85), or it can follow the PICTURE or
USAGE clause (MF).
2. The level-numbers of data-name-1 and data-name-2 must be identical
but must not be 66, 78 (MF) or 88.
3. This clause must not be used in level 01 entries in the File
Section, since multiple level 01 entries subordinate to an FD or
SD indicator represent implicit redefinitions of the same areas.
(See General Rule 2 of the section The DATA RECORDS Clause in this
chapter.)
For MF only: This clause can be used on level 01 entries in the
File Section.
4. This clause must not be used in level 01 entries in the
Communication Section since multiple level 01 entries subordinate
to a CD indicator represent implicit redefinition of the same
area.
5. The data description for data-name-2 can contain a REDEFINES
clause (OSVS)(VSC2) and data-name-2 can be subordinate to an entry
which contains a REDEFINES clause. Its data description cannot
contain an OCCURS clause. However, data-name-2 can be subordinate
to an item whose data description entry contains an OCCURS clause.
In this case, the reference to data-name-2 in the REDEFINES clause
cannot be subscripted or indexed. Neither the original definition
nor the redefinition can include an item whose size is variable as
defined in the OCCURS clause. (See the section The OCCURS Clause
in this chapter.)
For MF and OSVS only: The data description for data-name-2 can
contain an OCCURS clause.
For MF only: Either or both of the original definition and the
redefinition can include an item whose size is variable as defined
in the OCCURS clause.
6. No entry having a level-number numerically lower than the
level-number of data-name-2 and data-name-1 can occur between the
data description entries of data-name-2 and data-name-1.
7. For OSVS, MF and VSC2 only: An external or internal
floating-point data item can be the subject or object of a
REDEFINES clause.
8. For ANS85 only: Data-name-2 must not be qualified even if it is
not unique since no ambiguity of reference exists in this case
because of the required placement of the REDIFINES clause within
the source program.
For OSVS only: Data-name-2 may be qualified but any qualification
specified is ignored.
General Rules.
1. Redefinition starts at data-name-2 and ends when a level-number
less than or equal to that of data-name-2 is encountered.
2. When the level-number of data-name-1 is other than 01, it must
specify the same number of character positions that the data item
referenced by data-name-2 contains except that the data-name-1
area can be either smaller than the data-name-2 area (OSVS, ANS85)
For MF only: or be larger than the data- name-2 area. In this
case, extra storage is reserved to provide sufficient storage for
the number of character positions in the largest of the redefining
or redefined items.
It is important to observe that the REDEFINES clause specifies the
redefinition of a storage area, not of the data items occupying
the area.
3. Multiple redefinitions of the same character positions are
permitted. The entries giving the new descriptions of the
character positions must follow the entries defining the area
being redefined, without intervening entries that define new
character positions. Multiple redefinitions of the same character
positions must all use the data-name of the entry that originally
defined the area or the data-name of any other preceding
redefinition of that entry (VSC2, OSVS).
4. The entries giving the new description of the character positions
must not contain any VALUE clauses except in condition-name
entries.
5. Multiple level 01 entries subordinate to any given level indicator
(FD, CD or SD) represent implicit redefinitions of the same area.
The RENAMES Clause
Function.
The RENAMES clause permits alternative, possibly overlapping, groupings
of elementary items.
General Format.
Level-number 66 and data-name-1 are shown in the above format to improve
clarity. Level-number and data-name-1 are not part of the RENAMES
clause.
Syntax Rules.
1. Any number of RENAMES entries can be written for a logical record.
2. All RENAMES entries referring to data items within a given logical
record must immediately follow the last data description entry of
the associated record description entry.
3. Data-name-2 and data-name-3 must be names of elementary items or
groups of elementary items in the same logical record, and cannot
be the same data-name. A 66 level entry cannot rename another 66
level entry, nor can it rename a 77, 78 (MF), 88, or 01 entry.
4. Data-name-1 cannot be used as a qualifier, and can be qualified
only by the names of the associated level 01, FD, CD or SD
entries. Neither data-name-2 nor data-name-3 can have an OCCURS
clause in its data description entry, nor be subordinate to an
item that has an OCCURS clause in its data description entry.
(See the section The OCCURS Clause.)
5. The beginning of the area described by data-name-3 must not be to
the left of the beginning of the area described by data-name-2.
The end of the area described by data-name-3 must be to the right
of the end of the area described by data-name-2. Data-name-3,
therefore, cannot be subordinate to data-name-2.
6. Data-name-2 and data-name-3 can be qualified.
7. The words THRU and THROUGH are equivalent.
8. None of the items within the range, including data-name-2 and
data-name-3, if specified, can be an item whose size is variable
as defined in the section The OCCURS Clause in this chapter.
General Rules.
1. When data-name-3 is specified, data-name-1 is a group item which
includes all elementary items starting with data-name-2 (if
data-name-2 is an elementary item) or the first elementary item in
data-name-2 (if data-name-2 is a group item), and concluding with
data-name-3 (if data-name-3 is an elementary item) or the last
elementary item in data-name-3 (if data-name-3 is a group item).
2. When data-name-3 is not specified, all of the attributes of
data-name-2 become the data attributes for data-name-1.
3. For OSVS and VSC2 only: When data-name-2 and data-name-3 are not
explicitly qualified and when no ambiguity of reference exists,
implied qualification of the 01 level item is used.
The SIGN Clause
Function.
The SIGN clause specifies the position and the mode of representation of
the operational sign when it is necessary to describe these properties
explicitly.
General Format.
Syntax Rules.
1. The SIGN clause can be specified only for a numeric data
description entry whose PICTURE contains the character "S" , or a
group item containing at least one such numeric data description
entry.
2. The numeric data description entries to which the SIGN clause
applies must be described, implicitly or explicitly, as USAGE IS
DISPLAY.
3. At most one SIGN clause can apply to any given numeric data
description entry.
For ANS85 only: This rule is removed.
4. If the CODE-SET clause is specified, any signed numeric data
description entries associated with that file description entry
must be described with the SIGN IS SEPARATE clause.
For MF only: This restriction is not enforced. See the section
The CODE-SET Clause in this chapter.
General Rules.
1. The optional SIGN clause, if present, specifies the position and
the mode of representation of the operational sign for the numeric
data description entry to which it applies, or for each numeric
data description entry subordinate to the group to which it
applies. The SIGN clause applies only to numeric data description
entries whose PICTURE contains the character "S"; the "S"
indicates the presence of, but neither the representation nor,
necessarily, the position of the operational sign.
2. A numeric data description entry whose PICTURE contains the
character "S", but to which no optional SIGN clause applies, has
an operational sign, but neither the representation nor,
necessarily, the position of the operational sign is specified by
the character "S". In this (default) case, General Rules 3
through 5 do not apply to such signed numeric data items. The
representation of the default operational sign is defined in the
section Selection Of Character Representation And Radix in the
chapter Concepts of the COBOL Language.
3. If the optional SEPARATE CHARACTER phrase is not present, then:
a. the operational sign will be presumed to be associated with
the leading (or, respectively, trailing) digit position of
the elementary numeric data item in a manner defined in the
section Selection Of Character Representation And Radix in
the chapter Concepts of the COBOL Language.
b. the letter "S" in a PICTURE character-string is not counted
in determining the size of the item (in terms of standard
data format characters).
4. If the optional SEPARATE CHARACTER phrase is present, then:
a. the operational sign will be presumed to be the leading
(or, respectively, trailing) character position of the
elementary numeric data item; this character position is
not a digit position.
b. the letter "S" in a PICTURE character-string is counted in
determining the size of the item (in terms of standard data
format characters).
c. the operational signs for positive and negative are the
standard data format characters "+" and "-", respectively.
5. Every numeric data description entry whose PICTURE contains the
character "S" is a signed numeric data description entry. If a
SIGN clause applies to such an entry and conversion is necessary
for purposes of computation or comparisons, conversion takes place
automatically.
6. For ANS85 only: If a SIGN clause is specified for an item (either
an elementary numeric data description entry or a group item)
which is subordinate to a group item for which a SIGN clause is
also specified, then the SIGN clause specified in the subordinate
item takes precedence.
7. For OSVS, MF and VSC2 only: The SIGN clause is treated as
documentary for external floating-point items. For internal
floating-point items, the SIGN clause is invalid and will result
in a diagnostic message.
The SYNCHRONIZED Clause
Function.
The SYNCHRONIZEDclause specifies the alignment of an elementary item on
the natural boundaries of the computer memory.
For XOPEN only: 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 a conforming X/Open COBOL source
program.
General Format.
Directives.
1. In addition to system directives which provide flagging and modify
the reserved word list, the following directive may impact either
the syntax or semantics described in this section. See your COBOl
System Reference for details.
* IBMCOMP - When NOIBMCOMP is specified, the SYNCHRONIZED
clause is treated as documentary only.
Syntax Rules.
1. This clause should appear only with an elementary item.
2. SYNCis an abbreviation for SYNCHRONIZED.
3. For OSVS and VSC2 only: The SYNCHRONIZED clause can appear with a
non-elementary item.
General Rules.
1. SYNCHRONIZED RIGHT specifies that the elementary item is to be
positioned so that it will terminate on the right character
position of the natural boundary in which the elementary item is
placed.
It takes effect only if the IBMCOMPdirectiveis set. See your
COBOL System Reference for details.
2. Specification of the LEFT phrase in the SYNCHRONIZED clause will
have no effect.
3. The effect of the SYNCHRONIZED clause is, by definition,
implementation-dependent.
4. This clause specifies that the subject data item is to be aligned
in the computer so that no other data item occupies any of the
character positions between the leftmost and rightmost natural
boundaries of the computer memory which delimits this data item.
If the number of character positions required to store this data
item is less than the number of character positions between those
natural boundaries, the unused character positions (or portions
thereof) must not be used for any other data item. Such unused
character positions are, however, included in:
a. the size of any group item(s) to which the elementary item
belongs, and:
b. the character positions redefined when this data item is
the object of a REDEFINES clause.
Thus the size of an elementary item is unchanged by the
SYNCHRONIZED clause, but extra character positions are assigned by
the use of the clause.
5. SYNCHRONIZED not followed by either RIGHT or LEFT specifies that
the elementary item is to be positioned between natural boundaries
so that it uses the elementary data item efficiently.
6. Whenever a SYNCHRONIZED item is referenced in the source program,
the original size of the item, as shown in the PICTURE clause, is
used in determining any action that depends on size, such as
justification, truncation or overflow.
7. If the data description of an item contains the SYNCHRONIZED
clause and an operational sign, the sign of the item appears in
the normal operational sign position, regardless of whether the
item is SYNCHRONIZED LEFT or SYNCHRONIZED RIGHT.
8. When the SYNCHRONIZED clause is specified in a data description
entry of a data item that also contains an OCCURS clause, or in a
data description entry of a data item subordinate to a data
description entry that contains an OCCURS clause, then:
a. each occurrence of the data item is SYNCHRONIZED.
b. any implicit FILLER generated for other data items within
that same table is generated for each occurrence of those
data items.
9. For OSVS and VSC2 only: If the SYNCHRONIZED clause is specified
with a non-elementary item, then the clause applies to all the
items subordinate to that non-elementary item.
10. The effect of using the SYNCHRONIZED clause is discussed in the
section Selection Of Character Representation And Radix in the
chapter Concepts of the COBOL Language.
For MF only: The TYPEDEF Clause
Function.
The TYPEDEF clause defines a record as a programmer-defined structure or
usage.
General Format.
IS TYPEDEF
Syntax Rules.
1. The TYPEDEF clause can be specified only in data description
entries whose level-number is 01.
2. If TYPEDEF is specified, the following clauses cannot be
specified:
* EXTERNAL
* GLOBAL
* OCCURS
* REDEFINES
* SYNCHRONIZED/SYNC
* VALUE
If the TYPEDEF clause is specified for a group item, then
subordinate items can be specified with OCCURS or REDEFINES
clauses.
The VALUE clause cannot be specified either in the data
descriptions specifying the TYPEDEF clause or in any subordinate
item except for condition-names (88 level entries) within the
TYPEDEF structure.
3. If the TYPEDEF clause is specified for a data description, then
that same data description must include a data-name, that is, it
must not be specified with either an implicit or explicit FILLER
clause.
4. If a TYPEDEF clause is specified in an EXTERNAL program (call
prototype) then that TYPEDEF can be referenced in any subsequent
source line of the compilation group.
General Rules.
1. The purpose of using the TYPEDEF clause is to create a
programmer-defined usage or structure that can subsequently be
referenced in the USAGE clause.
2. A record declared with the TYPEDEF clause does not allocate any
storage, but declares that data-name-1 can be specified in a
subsequent data description entry as typedef-name-1.
MPE/iX 5.0 Documentation