Data Division (cont.) [ 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 (cont.)
The OCCURS Clause
Function
The OCCURS clause eliminates the need for separate entries for repeated
data items and supplies information required for the application of
subscripts or indices.
General Formats
Format 1
Format 2
Syntax Rules
1. Where both integer-1 and integer-2 are used, integer-1 must be
greater than, or equal to, (OSVS) (ANS85) zero and integer-2 must
be greater than integer-1.
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
|In Format 2, if "integer-1 TO" is omitted, the default value one is |
|assumed. |
________________________________________________________________________
2. The data description of data-name-1 must describe a positive
integer or zero. (ANS85)
3. Data-name-1, data-name-2, data-name-3, ... can be qualified.
4. Data-name-2 must be either the name of the entry containing the
OCCURS clause or the name of an entry subordinate to the entry
containing the OCCURS clause.
5. Data-name-3, and so on, must be the name of an entry subordinate
to the group item which is the subject of this entry.
6. An INDEXED BY phrase is required if the subject of this entry, or
an entry subordinate to this entry, is to be referred to by
indexing,
________________________________________________________________________
|(OSVS) (VSC2) |
|unless it is to be indexed by an index defined for another table (see |
|the section "Indexing" in the chapter COBOL Concepts). |
________________________________________________________________________
The index-name identified by this clause is not defined elsewhere,
and not being data, cannot be associated with any data hierarchy.
7. A data description entry that contains Format 2 of the OCCURS
clause should only be followed, within that record description, by
data description entries which are subordinate to it.
________________________________________________________________________
|(OSVS) (VSC2) |
|A data description entry that contains Format 2 of the OCCURS clause |
|can be followed, within that record description, by data description |
|entries which are not subordinate to it. The positions of these |
|entries within the record will vary at run time with the value of the |
|data item referenced in the DEPENDING ON clause |
| |
|unless the NOODOSLIDE system directive is set. In this case, the |
|containing record is considered as always containing the maximum |
|number of occurrences of the Format 2 item, irrespective of |
|the value of data-name-1. If the ODOSLIDE directive is set, |
|(MF) |
| |
|when the value of data-name-1 is changed, the position referenced by |
|identifiers following, but not subordinate to, the table is changed. |
|The data these items contain can be lost. |
________________________________________________________________________
8. The OCCURS clause cannot be specified in a data description entry
that:
a. Has 66 or 88 level-number.
b. Describes an item whose size is variable. The size of an
item is variable if the data description of any subordinate
item contains Format 2 of the OCCURS clause.
________________________________________________________________________
|(OSVS) (VSC2) |
|An OCCURS clause can be specified for a data description subordinate |
|to another item with a Format 2 OCCURS clause. |
________________________________________________________________________
9. The OCCURS clause should not be specified in a data description
entry at the 01 level or as a 77 level-number. This restriction
can be ignored. (MF)
10. In Format 2, the data item defined by data-name-1 must not occupy
a character position within the range of the first character
position defined by the data description entry containing the
OCCURS clause and the last character position defined by the
record description entry containing that OCCURS clause.
11. If data-name-2 is not the subject of this entry, then:
a. All of the items identified by the data-names in the KEY IS
phrase must be within the group item which is the subject
of this entry.
b. Items identified by the data-name in the KEY IS phrase must
not contain an OCCURS clause.
c. There must not be any entry that contains an OCCURS clause
between the items identified by the data-names in the KEY
IS phrase and the subject of this entry.
12. Index-name-1, index-name-2, ... must be unique words within the
program.
________________________________________________________________________
|(OSVS) |
|Index-name-1, index-name-2, ... need not be unique and can be |
|qualified by the data-name which is the subject of this entry. |
________________________________________________________________________
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
| |
| |
| |
|13. The OCCURS clause can be specified for external or internal |
| floating-point data items. |
| |
________________________________________________________________________
General Rules
1. The OCCURS clause is used in defining tables and other homogenous
sets of repeated data items. Whenever the OCCURS clause is used,
the data-name which is the subject of this entry must be either
subscripted or indexed whenever it is referred to in a statement
other than SEARCH , SORT (MF) or USE FOR DEBUGGING. Further, if
the subject of this entry is the name of a group item, then all
data-names belonging to the group must be subscripted or indexed
whenever they are used as operands, except as the object of a
REDEFINES clause. (See the section "Subscripting" , "Indexing"
and "Identifier" in the chapter COBOL Concepts.)
2. Except for the OCCURS clause itself, all data description clauses
associated with an item whose description includes an OCCURS
clause apply to each occurrence of the item described. (See
restriction in general rule 2 under Data Description Entries Other
Than Condition-Names.)
3. [REV BEG]
Data-name-1 must have a fixed location, and must not follow an
item that contains an OCCURS DEPENDING ON clause.[REV END]
4. The number of occurrences of the subject entry is defined as
follows:
a. In Format 1, the value of integer-2 represents the exact
number of occurrences.
b. In Format 2, the current value of the data item referenced
by data-name-1 represents the number of occurrences.
This format specifies that the subject of this entry has a
variable number of occurrences. The value of integer-2
represents the maximum number of occurrences and the value
of integer-1 represents the minimum number of occurrences.
This does not imply that the length of the subject of the
entry is variable, but that the number of occurrences is
variable.
The value of the data item referenced by data-name-1 must
fall within the range of integer-1 through integer-2.
Reducing the value of this data item makes the contents of
data items, whose occurrence numbers now exceed the value
of the data item referenced by data-name-1, unpredictable.
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|5. When a group item, having subordinate to it an entry that |
| specifies Format 2 of the OCCURS clause, is referenced, the part |
| of the table area used in the operation is determined as |
| follows: |
| |
| |
| a. If the data item referenced by data-name-1 is outside the |
| group, only that part of the table area that is |
| specified by the value of the data item referenced by |
| data-name-1 at the start of the operation will be |
| used. |
| |
| b. If the data item referenced by data-name-1 is included in |
| the same group and the group data item is referenced as |
| a sending item, only that part of the table area |
| that is specified by the value of the data item |
| referenced by data-name-1 at the start of the operation |
| will be used in the operation. If the group is a |
| receiving item, the maximum length of the group will be |
| used. |
| |
________________________________________________________________________
6. The KEY IS phrase is used to indicate that the repeated data is
arranged in ascending or descending order according to the values
contained in data-name-2, data-name-3, and so on. The ascending or
descending order is determined according to the rules for comparison
of operands (see the section Comparison of Numeric Operands and
Comparison of Nonnumeric Operands). The data-names are listed in
their descending order of significance.
The PICTURE Clause
Function
The PICTURE clause describes the general characteristics and editing
requirements of an elementary item.
General Format
Syntax Rules
1. A PICTURE clause can be specified only at the elementary item
level.
2. A character-string consists of certain allowable combinations of
characters in the COBOL character set used as symbols. The
allowable combinations determine the category of the elementary
item.
3. The maximum number of characters allowed in the character- string
is 30.
4. The PICTURE clause must be specified for every elementary item
except an index data itempointer or internal floating-point data
item (VSC2) (MF) (OSVS) (VSC2) (MF) or the subject of a RENAMES
clause, in which case use of this clause is prohibited.
5. PIC is an abbreviation for PICTURE.
6. The asterisk when used as the zero suppression symbol and the
clause BLANK WHEN ZERO should not appear in the same entry.
________________________________________________________________________
|(OSVS) |
|This construct is, however, permitted in which case, zero suppression |
|overrides the BLANK WHEN ZERO clause. |
________________________________________________________________________
7. An integer in parentheses following a character indicates that the
character is repeated the number of times shown by the integer.
General Rules
There are seven categories of data that can be described with a PICTURE
clause: alphabetic, numeric, alphanumeric, alphanumeric edited, numeric
edited, DBCS and external floating-point. (OSVS) (VSC2) (MF) General
rules within these categories are given below:
Alphabetic Data Rules
1. Its PICTURE character-string can only contain the symbols "A" and
"B".
________________________________________________________________________
|(ANS85) |
|Its PICTURE character-string can contain only the symbol "A". |
________________________________________________________________________
2. Its contents when represented in standard data format must be one
or more alphabetic characters.
Numeric Data Rules
1. Its PICTURE character-string can contain only the symbols "9",
"P", "S", and "V". The number of digit positions that can be
described by the PICTURE character-string must range from 1 to 18
inclusive.
2. If unsigned, the data in standard data format must be a
combination of the Arabic numerals "0", "1", "2", "3", "4", "5",
"6", "7", "8", and "9" ; if signed, the item can also contain a
"+", "-", or other representation of an operational sign. (See
the section "The SIGN Clause" later in this chapter.)
Numeric Data can also be held in formats other than standard data
format (see the section "The USAGE Clause" later in this
chapter and the section "Selection of Character Representation and
Radix" in the chapter COBOL Concepts).
Alphanumeric Data Rules
1. Its PICTURE character-string is restricted to certain combinations
of the symbols "A", "X", "9" , and the item is treated as if the
character-string contained all X"s. A PICTURE character-string
which contains all As or all 9"s does not define an alphanumeric
item.
2. Its contents when represented in standard data format can consist
of any characters in the computer's character set.
Alphanumeric Edited Data Rules
1. Its PICTURE character-string is restricted to certain combinations
of the following symbols: "A", "X", "9", "B", "0", and "/" as
follows:
a. The character-string must contain at least one "B" and at
least one "X" or at least one "0" (zero) and at least one
"X" or at least one "/" (slant) and at least one "X", or:
b. The character-string must contain at least one "0" (zero)
and at least one "A" or at least one "/" (slant) and at
least one "A".
2. Its contents when represented in standard data format are
allowable characters in the computer's set.
Numeric Edited Data Rules
1. Its PICTURE character-string is restricted to certain combinations
of the symbols "B", "/", "P", "V" , "Z", "0", "9", ",", "." , "*",
"+", "-", "CR", "DB", and the currency symbol. The allowable
combinations are determined from the order of precedence of
symbols and the editing rules as follows:
a. The number of digit positions that can be represented in
the PICTURE character-string must range from 1 to 18
inclusive.
b. The character-string must contain at least one "0" , "B",
"/", "Z", "*", "+", ",", ".", "-", "CR" , "DB", or currency
symbol.
2. The contents of the character positions of these symbols that are
allowed to represent a digit in standard data format, must be one
of the numerals.
[REV BEG]
3. If all numeric edited character positions in the PICTURE
character-string are represented by an insertion character, at
least one of the insertion characters must be positioned to the
left of the decimal point.[REV END]
________________________________________________________________________
|External Floating point Data Items |
| |
|(OSVS) (VSC2) (MF) |
| |
| |
| 1. The PICTURE string must have the following form: |
| |
| |
| {+} mantissa E{+} exponent |
| {-} {-} |
| |
| |
| A sign character must immediately precede both the mantissa and|
| the exponent. |
| |
| A "+ " sign indicates that a positive sign will be used in the |
| output to represent positive values and that a negative sign |
| will represent negative values. |
| |
| A "- "sign indicates that a blank will be used in the output to|
| represent positive values and that a negative sign will |
| represent negative values. |
________________________________________________________________________
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
| |
| |
| |
| Each sign position occupies one byte of storage. |
| |
| mantissa |
| |
| The mantissa can contain the symbols: |
| |
| 9 . V |
| |
| An actual decimal point can be represented with a period while an|
| assumed decimal point is represented by a V. Either an |
| actual or an assumed decimal point must be present in the |
| mantissa; the decimal point can be leading, embedded or |
| trailing. The mantissa can contain from 1 to 16 numeric |
| characters. |
| |
| E |
| |
| Indicates the exponent. |
| |
| exponent |
| |
| The exponent must be a PIC "99". |
| |
|2. The OCCURS, REDEFINES and RENAMES clauses can be associated with |
| external floating-point items. |
| |
|3. The SIGN clause is documentary only and has no effect on the |
| representation of the sign. |
| |
|4. The SYNCHRONIZED clause is documentary only. |
| |
|5. The following clauses are invalid with external floating-point |
| items: |
| |
| BLANK WHEN ZERO |
| JUSTIFIED |
| VALUE |
| |
________________________________________________________________________
Elementary Item Size
The size of an elementary item, where size means the number of character
positions occupied by the elementary item in standard data format, is
determined by the number of allowable symbols that represent character
positions. An integer which is enclosed in parentheses following the
symbols "A", ",", "X" , "9", "P", "Z", "*", "B", "/", "0", "+", "-", or
the currency symbol indicates the number of replications of the symbol.
Note that the following symbols can appear only once in a given PICTURE:
"S" , "V", ".","E", (OSVS) (VSC2) (MF) "CR", and "DB".
Symbols Used
The functions of the symbols used to describe an elementary item are
explained as follows:
A Each "A" in the character-string represents a character position
which can contain only a letter of the alphabet or a space.
B Each "B" in the character-string represents a character position
into which the space character will be inserted.
________________________________________________________________________
|(OSVS) (VSC2) (MF) |
| |
| |
| |
|E Marks the start of the exponent in an external floating-point |
| item. The exponent occupies 1 byte of storage at runtime. |
| |
________________________________________________________________________
P Each "P" indicates an assumed decimal scaling position and is used
to specify the location of an assumed decimal point when the point
is not within the number that appears in the data item. The scaling
position character "P" is not counted in the size of the data item.
Scaling position characters are counted in determining the maximum
number of digit positions (18) in numeric edited items or numeric
items. The scaling position character "P" can appear only to the
left or right as a continuous string of "P"s within a PICTURE
description; since the scaling position character "P" implies an
assumed decimal point (to the left of "P" s if "P"s are leftmost
PICTURE characters and to the right if "P"s are rightmost PICTURE
characters), the assumed decimal point symbol "V" is redundant as
either the leftmost or rightmost character within such a PICTURE
description.
The character "P" and the insertion character "." (period) cannot
both occur in the same PICTURE character-string. If, in any
operation involving conversion of data from one form of internal
representation to another, the data item being converted is
described with the PICTURE character "P", each digit position
described by a "P" is considered to contain the value zero, and the
size of the data item is considered to include the digit positions
so described.
________________________________________________________________________
|(ANS85) |
|In certain operations that reference a data item whose PICTURE |
|character-string contains the symbol "P", the algebraic value of the |
|data item is used rather than the actual character representation of |
|the data item. This algebraic value assumes the decimal point in the |
|prescribed location and zero in place of the digit position specified |
|by the symbol "P". The size of the value is the number of digit |
|positions represented by the PICTURE character-string. These |
|operations are any of the following: |
________________________________________________________________________
________________________________________________________________________
| |
| a. Any operation requiring a numeric sending operand. |
| |
| b. An elementary MOVE statement where the sending operand is |
| numeric and its PICTURE character-string contains the symbol |
| "P". |
| |
| c. A MOVE statement where the sending operand is numeric |
| edited and its PICTURE character-string contains the |
| symbol "P" and the receiving operand is numeric or numeric |
| edited. |
| |
| d. A comparison operation where both operands are numeric. |
|In all other operations the digit positions specified with the |
|symbol "P" are ignored and are not counted in the size of the |
|operand. |
________________________________________________________________________
S The letter "S" is used in a character-string to indicate the
presence, but neither the representation nor, necessarily, the
position of an operational sign; 7it must be written as the leftmost
character in the PICTURE. The "S" is not counted in determining the
size (in terms of standard data format characters) of the elementary
item unless the entry is subject to a SIGN clause which specifies
the optional SEPARATE CHARACTER phrase. (See the section "The SIGN
Clause" in this chapter.)
V The "V" is used in a character-string to indicate the location of
the assumed decimal point and can only appear once in a
character-string. The "V" does not represent a character position
and therefore is not counted in the size of the elementary item.
When the assumed decimal point is to the right of the rightmost
symbol in the string the "V" is redundant.
X Each "X" in the character-string is used to represent a character
position which contains any allowable character from the computer's
character set.
Z Each "Z" in a character-string can only be used to represent the
leftmost numeric character positions which will be replaced by a
space character when the contents of that character position is
zero. Each "Z" is counted in the size of the item.
9 Each "9" in the character-string represents a character position
which contains a numeral and is counted in the size of the item.
0 Each "0" (zero) in the character-string represents a character
position into which the numeral zero will be inserted. The "0" is
counted in the size of the item.
/ Each "/" (slash) in the character-string represents a character
position into which the slant character will be inserted. The "/"
is counted in the size of the item.
, Each "," (comma) in the character-string represents a character
position into which the character "," will be inserted. This
character position is counted in the size of the item. The
insertion character "," must not be the last character in the
PICTURE character-string.
________________________________________________________________________
|(ANS85) |
|The insertion character "," can be the last character in the PICTURE |
|character-string. |
________________________________________________________________________
. When the character "." (period) appears in the character-string it
is an editing symbol which represents the decimal point for
alignment purposes and in addition, represents a character position
into which the character "." will be inserted. The character "." is
counted in the size of the item. For a given program the functions
of the period and comma are exchanged if the clause DECIMAL-POINT IS
COMMA is stated in the SPECIAL-NAMES paragraph. In this exchange
the rules for the period apply to the comma and the rules for the
comma apply to the period wherever they appear in a PICTURE clause.
The insertion character "." must not be the last character in the
PICTURE character-string.
________________________________________________________________________
|(ANS85) |
|The insertion character "." can be the last character in the PICTURE |
|character-string. |
________________________________________________________________________
+, -, CR, DB
These symbols are used as editing sign control symbols. When used,
they represent the character position into which the editing sign
control symbol will be placed. The symbols are mutually exclusive
in any one character-string and each character used in the symbol is
counted in determining the size of the data item.
* Each "*" (asterisk) in the character-string represents a leading
numeric character position into which an asterisk will be placed
when the contents of that position is zero. Each "*" is counted in
the size of the item.
cs The currency symbol in the character-string represents a character
position into which a currency symbol is to be placed. The currency
symbol in a character-string is represented by either the currency
sign or by the single character specified in the CURRENCY SIGN
clause in the SPECIAL-NAMES paragraph. The currency symbol is
counted in the size of the item.
Editing Rules
There are two general methods of performing editing in the PICTURE
clause, either by insertion or by suppression and replacement. There are
four types of insertion editing:
* Simple insertion
* Special insertion
* Fixed insertion
* Floating insertion
There are two types of suppression and replacement editing:
* Zero suppression and replacement with spaces
* Zero suppression and replacement with asterisks
The type of editing which can be performed upon an item is dependent upon
the category to which the item belongs. Table 3-3 specifies which
type of editing can be performed upon a given category.
Table 3-3. Editing Types For Data Categories
-----------------------------------------------------------------------
| | |
| Category | Type of Editing |
| | |
-----------------------------------------------------------------------
| | |
| Alphabetic | Simple insertion "B" only 1 |
| | |
-----------------------------------------------------------------------
| | |
| Numeric | None |
| | |
-----------------------------------------------------------------------
| | |
| Alphanumeric | None |
| | |
-----------------------------------------------------------------------
| | |
| Alphanumeric Edited | Simple insertion "0", "B" and "/" |
| | |
-----------------------------------------------------------------------
| | |
| Numeric Edited | All 2 |
| | |
-----------------------------------------------------------------------
| | |
| DBCS | Simple insertion |
| | |
-----------------------------------------------------------------------
| | |
| External floating-point | Special insertion |
| | |
-----------------------------------------------------------------------
Notes:
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|1 In the ANSI'74 standard, PICTURE clauses containing both |
| "A" and "B" are treated as simple insertion in category |
| Alphabetic. As the ANSI'85 standard does not support "B" in the |
| Alphabetic category, the ANSI'85 standard considers this |
| PICTURE as simple insertion in the Alphanumeric Edited |
| category. |
| |
________________________________________________________________________
2 Floating insertion editing and editing by zero suppression and
replacement are mutually exclusive in a PICTURE clause. Only one
type of replacement can be used with zero suppression in a PICTURE
clause.
Simple Insertion Editing
The "," (comma), "B" (space), "0" (zero), and "/" (slash) are used as the
insertion characters. The insertion characters are counted in the size
of the item and represent the position in the item into which the
character will be inserted.
Special Insertion Editing
________________________________________________________________________
|(MF) (OSVS) (VSC2) |
|This type of editing is valid for either numeric-edited items or |
|external floating-point items. |
________________________________________________________________________
The "." (period) is used as the insertion character. In addition to
being an insertion character it also represents the decimal point for
alignment purposes. The insertion character used for the actual decimal
point is counted in the size of the item. The use of the assumed
decimal point, represented by the symbol "V" and the actual decimal
point, represented by the insertion character, in the same PICTURE
character-string is disallowed. The result of special insertion editing
is the appearance of the insertion character in the item in the same
position as shown in the character-string.
Fixed Insertion Editing
The currency symbol and the editing sign control symbols "+" , "-", "CR",
"DB" are the insertion characters. Only one currency symbol and only one
of the editing sign control symbols can be used in a given PICTURE
character-string. When the symbols "CR" or "DB" are used, they represent
two character positions in determining the size of the item and they must
represent the rightmost character positions that are counted in the size
of the item. The symbol "+" or "-", when used, must be either the
leftmost or rightmost character position to be counted in the size of the
item. The currency symbol must be the leftmost character.
Table 3-4. Editing Symbols in PICTURE Character-Strings
--------------------------------------------------------------
| | |
| Editing Symbol in Picture | Result |
| Character-string | |
| | |
--------------------------------------------------------------
| | | |
| | Data Item | Data Item |
| | Positive or | Negative |
| | Zero | |
| | | |
--------------------------------------------------------------
| | | |
| + | + | - |
| | | |
--------------------------------------------------------------
| | | |
| - | space | - |
| | | |
--------------------------------------------------------------
| | | |
| CR | 2 spaces | CR |
| | | |
--------------------------------------------------------------
| | | |
| DB | 2 spaces | DB |
| | | |
--------------------------------------------------------------
Floating Insertion Editing
The currency symbol and editing sign control symbols "+" or "-" are the
floating insertion characters and as such are mutually exclusive in a
given PICTURE character-string.
Floating insertion editing is indicated in a PICTURE character- string by
using a string of at least two of the floating insertion characters.
This string of floating insertion characters can contain any of the
simple insertion characters or have simple insertion characters
immediately to the right of this string. These simple insertion
characters are part of the floating string.
When the floating insertion character is the currency symbol this string
of floating insertion characters can have one of the editing sign control
symbols "+", "-", "CR" or "DB" immediately to the right of this string.
The leftmost character of the floating insertion string represents the
leftmost limit of the floating symbol in the data item. The rightmost
character of the floating string represents the rightmost limit of the
floating symbols in the data item.
The second floating character from the left represents the leftmost limit
of the numeric data that can be stored in the data item. Non-zero
numeric data can replace all the characters at or to the right of this
limit.
In a PICTURE character-string, there are only two ways of representing
floating insertion editing. One way is to represent any or all of the
leading numeric character positions on the left of the decimal point by
the insertion character. The other way is to represent all of the
numeric character positions in the PICTURE character-string by the
insertion character.
If the insertion characters are only to the left of the decimal point in
the PICTURE character-string, the result is that a single floating
insertion character will be placed into the character position
immediately preceding either the decimal point or the first non-zero
digit in the data represented by the insertion symbol string, whichever
is farther to the left in the PICTURE character-string. The character
positions preceding the insertion character are replaced with spaces.
If all numeric character positions in the PICTURE character-string are
represented by the insertion character, the result depends upon the value
of the data. If the value is zero, the entire data item will contain
spaces. If the value is not zero, the result is the same as when the
insertion character is only to the left of the decimal point.
________________________________________________________________________
|(ANS85) |
|If all numeric positions in the PICTURE character string are |
|represented by the insertion character, at least one numeric |
|position must be to the left of the assumed or actual decimal |
|point. |
________________________________________________________________________
To avoid truncation, the minimum size of the PICTURE character-string for
the receiving data item must be the number of characters in the sending
data item, plus the number of non-floating insertion characters being
edited into the receiving data item, plus one for the floating insertion
character.
Zero Suppression Editing
The suppression of leading zeros in numeric character positions is
indicated by the use of the alphabetic character "Z" or the character "*"
(asterisk) as suppression symbols in a PICTURE character- string. These
symbols are mutually exclusive in a given PICTURE character-string. Each
suppression symbol is counted in determining the size of the item. If
"Z" is used, the replacement character will be the space and if the
asterisk is used, the replacement character will be "*".
Zero suppression and replacement is indicated in a PICTURE
character-string by using a string of one or more of the allowable
symbols to represent leading numeric character positions which are to be
replaced when the associated character position in the data contains a
zero. Any of the simple insertion characters embedded in the string of
symbols or to the immediate right of this string are part of the string.
In a PICTURE character-string, there are only two ways of representing
zero suppression. One way is to represent any or all of the leading
numeric character positions to the left of the decimal point by
suppression symbols. The other way is to represent all of the numeric
character positions in the PICTURE character-string by suppression
symbols.
If the suppression symbols appear only to the left of the decimal point,
any leading zero in the data which corresponds to a symbol in the string
is replaced by the replacement character. Suppression terminates at the
first non-zero digit in the data represented by the suppression symbol
string or at the decimal point, whichever is encountered first.
If all numeric character positions in the PICTURE character-string are
represented by suppression symbols and the value of the data is not zero,
the result is the same as if the suppression characters were only to the
left of the decimal point. If the value is zero and the suppression
symbol is "Z", the entire data item will be spaces. If the value is zero
and the suppression symbol is "*", the data item will be all "*" except
for the actual decimal point.
The symbols "+", "-", "*", "Z" and the currency symbol, when used as
floating replacement characters, are mutually exclusive within a given
character-string.
Precedence Rules
Table 3-5 shows the order of precedence when using characters as
symbols in a character-string. An "X" at an intersection indicates that
the symbol(s) at the top of the column can precede, in a given
character-string, the symbol(s) at the left of the row. Arguments
appearing in braces indicate that the symbols are mutually exclusive.
The currency symbol is indicated by the symbol "cs". At least one of the
symbols "A " , "X", "Z", "9" or "*", or at least two of the symbols "+" ,
"-" or "cs" must be present in a PICTURE string.
In Table 3-5 , non-floating insertion symbols "+" and "-" , floating
insertion symbols "Z", "*", "+", "-", and "cs", and other symbol "P"
appear twice in the PICTURE character precedence chart. The leftmost
column and uppermost row for each symbol represents its use to the left
of the decimal point position. The second appearance of symbol in the
row and column represents its use to the right of the decimal point
position.
Table 3-5. PICTURE Character Precedence Chart
Table 3-5. PICTURE Character Precedence Chart (cont.)
MPE/iX 5.0 Documentation