File Section (Continued) [ Micro Focus COBOL Language Reference ] MPE/iX 5.0 Documentation
Micro Focus COBOL Language Reference
File Section (Continued)
Linkage Section (Continued)
General Rules.
1. Format 3 is used for each condition-name. Each condition-name
requires a separate entry with level-number 88. Format 3 contains
the name of the condition and the value, values, or range of
values associated with the condition-name. The condition-name
entries for a particular conditional variable must immediately
follow the entry describing the item with which the condition-name
is associated. A condition-name can be associated with any data
description entry which contains a level-number except the
following:
a. Another condition-name.
b. A level 66 item.
c. A group containing items with descriptions including
JUSTIFIED, SYNCHRONIZED or USAGE (other than USAGE IS
DISPLAY).
d. An index or pointer (VSC2, MF) data item (see the section
The USAGE IS INDEX Clause in this chapter)
e. For MF only: A constant-name.
2. For MF and VSC2 only: Condition-names can be associated with
internal floating-point items.
For MF only: Condition-names can be associated with external
floating-point items.
3. For MF only: Format 4 defines a constant-name, which is a
symbolic name representing a constant value assigned to it when
the source code is passed through your COBOL system. Your COBOL
system replaces each reference to a constant-name by its value.
4. For MF only: If the TYPEDEF clause is specified at a group
level, the components of the TYPEDEF are referenced using the
usual COBOL rules of qualification.
The BLANK WHEN ZERO Clause
Function.
The BLANK WHEN ZERO clause permits the blanking of an item when its value
is zero.
General Format.
Syntax Rules.
1. The BLANK WHEN ZERO clause can be used only for an elementary item
whose PICTURE is specified as numeric (with implicit or explicit
USAGE IS DISPLAY) or numeric edited. (See the section The PICTURE
Clause later in this chapter.)
2. The asterisk, when used as the zero suppression symbol, and the
clause BLANK WHEN ZERO should not appear in the same entry.
For OSVS only: This construct is, however, permitted in which
case, zero suppression overrides the BLANK WHEN ZERO clause.
General Rules.
1. When the BLANK WHEN ZERO clause is used, the item will contain
nothing but spaces if the value of the item is zero.
2. When the BLANK WHEN ZERO clause is used for an item whose PICTURE
is numeric, the category of the item is considered to be numeric
edited.
The BLOCK CONTAINS Clause
Function.
The BLOCK CONTAINS clause specifies the size of a physical record.
For OSVS 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.
General Rule.
For MF only: This clause is documentary only.
The CODE-SET Clause
Function.
The CODE-SET clause specifies the character code set used to represent
data on the external media.
It can be specified only for files with record sequential and line
sequential (MF) organization.
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 you COBOL
System Reference for details.
a. CHARSET - determines what is considered the native
code-set.
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.
For MF only: These restrictions do not apply.
2. The alphabet-name clause referenced by the CODE-SET clause must
not specify the literal phrase.
For MF only: These restrictions do not apply .
3. For MF only: Identifier-1 can be qualified, but must not be
subscripted.
4. For MF only: Each identifier-1 must be a data item described in
the same record description for the file, and must not itself be a
record description.
5. For MF only: 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. For MF only: The native character set is used for any file, or
data item in a file, to whick no CODE-SET clause applies.
7. For MF only: 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 MF only: For the purposes of this translation, any data
item to which a CODE-SET clauseapplies is treated as alphanumeric.
No account is taken of the class and category of the item as
described in its data description.
9. For MF only: 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.
For ANS85 only: 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.
For MF only: All dialects in 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.
For XOPEN only: Although 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 conforming X/Open COBOL source program.
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.
For OSVS and VSC2 only: These data-names do not have to be associated
with any data description entry in the program.
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.
NOTE When using multiple 01 level items within an FD, if the SELECT
statement contains key definitions, the key sizes must be contained
within the minimum record length of that FD.
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 Data-Name or FILLER Clause
Function.
A data-name specifies the name of the data being described. The word
FILLER can be used to specify an elementary item of the logical record
that cannot be referred to explicitly.
General Format.
For MF only: brackets.
Syntax Rule.
The data-name or FILLER clause , if specified, (ANS85) must be the first
word following the level-number in a data description entry.
General Rules.
1. The key word FILLER can be used to name an elementary item or
group in a record. Under no circumstances can a FILLER item be
referred to explicitly. However, a data item defined with the key
word FILLER can be used as a conditional variable because such use
does not require explicit reference to the FILLER item but only to
the value contained therein.
2. For ANS85 only: If this clause is omitted, the data item being
described is treated as though FILLER had been specified.
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.
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.
4. For MF only: Literal-1 must be a nonnumeric literal.
General Rules.
1. The data contained in the record named by the data-name clause is
external and can be accessed and processed by any program in the
run unit which describes and, optionally, redefines it 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 need
not occur identically in other programs in the run unit. See the
section The REDEFINES Clause.
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. For MF only: See your COBOL System Reference for further
information on files with the EXTERNAL attribute.
6. For MF only: Literal-1 identifies the external name of an
external data item or file connector. The same external name must
be used by all programs that reference the same external data item
or file connector.
For ANS85 only: The GLOBAL Clause
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.
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.
For MF only: The GLOBAL clause can also be specified in the
Linkage Section.
NOTE For VSC2 only: The GLOBAL clause can also be specified in the
Linkage Section in COBOL/370 but not in any release of VS COBOL II.
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.
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 Concepts of the COBOL Language.
3. For ANS85 only: 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 JUSTIFIED Clause
Function.
The JUSTIFIED clause specifies non-standard positioning of data within a
receiving data item.
General Format.
Syntax Rules.
1. The JUSTIFIED clause can be specified only at the elementary item
level.
2. JUST is an abbreviation for JUSTIFIED.
3. The JUSTIFIED clause cannot be specified for any data item
described as numeric or for which editing is specified.
4. The JUSTIFIED clause cannot be specified for an index data item
(see the section The USAGE IS INDEX Clause), or for a pointer data
item.(VSC2)(MF)
5. For MF, VSC2, and OSVS only: The JUSTIFIED clause cannot be
specified for external or internal floating-point data items.
General Rules.
1. When a receiving data item is described with the JUSTIFIED clause
and the sending data item is larger than the receiving data item,
the leftmost characters are truncated. When the receiving data
item is described with the JUSTIFIED clause and it is larger than
the sending data item, the data is aligned at the rightmost
character position in the data item with space fill for the
leftmost character positions.
The contents of the sending data item are not taken into account,
that is, trailing spaces within the sending data item are not
suppressed.
For example, if a data item PIC X(4) whose value is A_ _ _ (that
is, A followed by three spaces) is moved into a data item PIC X(6)
JUSTIFIED the result will be _ _A_ _ _. If the same data item is
moved to one with PIC X(3) JUSTIFIED the result will be _ _ _ that
is, the leftmost character is truncated.
2. When the JUSTIFIED clause is omitted, the standard rules for
aligning data within an elementary item apply. (See the section
Standard Alignment Rules in the chapter Concepts of the COBOL
Language.)
The LABEL RECORDS Clause
Function.
The LABEL RECORDS clause specifies whether labelsare present.
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 (ANS85).
All dialects in 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. (MF)
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 (XOPEN).
General Format.
Syntax Rules.
1. This clause should be present in every file description entry.
For ANS85 only: It is not required.
2. For OSVS and VSC2 only: 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. For OSVS and VSC2 only: Data-name-1 must not appear in the DATA
RECORDS clause for the file.
4. For OSVS and VSC2 only: Both LABEL RECORDS IS and LABEL RECORD
ARE are accepted as valid syntax.
General Rule.
For MF only: This clause is documentary only.
Level Number
Function.
The level-number shows the hierarchy of data within a logical record. In
addition, it is used to identify entries for working-storage items,
linkage items, condition-names , constant-names(MF)and the RENAMES
clause.
General Format.
Syntax Rules.
1. A level-number is required as the first element in each data
description entry.
2. Data description entries subordinate to an FD, CD, or SD entry
must have level-numbers with the values 01through 49, 66
,78 (MF) or 88. (See the section The FILE Description earlier in
this chapter.)
3. Data description entries in the Report Section and Screen Section
must have level-numbers with the values 01 through 49 , or 78.
(MF)
4. Data description entries in the Working-Storage Section,
Local-Storage (MF) and Linkage Section must have level-numbersith
the values 01 through 49, 66, 77, 78(MF) or 88
5. A level-number can be a one or two digit number.
General Rules.
1. The level-number 01 identifies the first entry in each record
description.
2. Special level numbers have been assigned to certain entries where
there is no real concept of level hierarchy:
a. The level-number 77 is assigned to identify noncontiguous
working-storage data items and noncontiguous linkage data
items. It can be used only as described by Format 1 of the
data description skeleton earlier in this chapter.
b. Level number 66 is assigned to identify RENAMES entries and
can be used only as described in Format 2 of the data
description skeleton earlier in this chapter.
c. Level number 88 is assigned to entries which define
condition-names associated with a conditional variableand
can be used only as described in Format 3 of the data
description skeleton earlier in this chapter.
d. For MF only: Level number 78 is assigned to entries
which define constant-names. It can be used only as
described in Format 4 of the data description skeleton
earlier in this chapter.
3. Multiple level 01 entries subordinate to a CD, FD or SD entry
represent implicit redefinitions of the same area.
MPE/iX 5.0 Documentation