Results Of Delimiting With All Asterisks; Results Of Delimiting With All Double Asterisks - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Using the STRING, UNSTRING, and INSPECT Statements
5.2 Separating Data Using the UNSTRING Statement
the delimiter item. It considers the ALL delimiter to be one, two, three, or more
adjacent repetitions of the delimiter item. Table 5–7 shows the results of the
following UNSTRING operation using an ALL delimiter:
UNSTRING FIELD1 DELIMITED BY ALL "*"
INTO FIELD2A FIELD2B.
Table 5–7 Results of Delimiting with ALL Asterisks
FIELD1
PIC X(8)
FIELD2A
VALUE IS:
PIC XXX
ABC*DEF*
ABC
ABC**DEF
ABC
A******F
A##
A*F*****
A##
A*CDEFG
A##
Legend: # = space
Table 5–8 shows the results of the following UNSTRING operation that combines
ALL with a 2-character delimiter:
UNSTRING FIELD1 DELIMITED BY ALL "**"
INTO FIELD2A FIELD2B.
Table 5–8 Results of Delimiting with ALL Double Asterisks
FIELD1
PIC X(8)
VALUE IS:
PIC XX
ABC**DEF
ABC
AB**DE**
AB#
A***D***
A##
A*******
A##
Legend: # = space
In addition to unchangeable delimiters, such as literals and figurative constants,
delimiters can be designated by identifiers. Identifiers permit variable delimiting.
Consider the following sample statement:
UNSTRING FIELD1 DELIMITED BY DEL1
INTO FIELD2A FIELD2B.
The data name DEL1 must be alphanumeric; it can be either a group or an
elementary item. If the delimiter contains a subscript, the subscript may vary as
a side effect of the UNSTRING operation.
Values After UNSTRING Operation
FIELD2B
PIC XXX
JUSTIFIED
DEF
DEF
##F
##F
EFG
Values After UNSTRING Operation
PIC XXX
JUSTIFIED
DEF
#DE
#*D
##*
Using the STRING, UNSTRING, and INSPECT Statements 5–11

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents