DBCS-only LIKE, NLIKE (not like) pattern in Query for iSeries:
This pattern, which contains only
double-byte characters, can be used for any bracketed-DBCS field, but not for a DBCS-graphic field. Start
the pattern with a shift-out character and end it with a shift-in character. Use the DBCS percent sign (%%)
to skip any number of characters or none at all. Use the DBCS underscore (__) to indicate that any
double-byte character is accepted for that position. Although the LIKE pattern contains only double-byte
characters, it can test DBCS-open fields that contain both double-byte character data and alphanumeric
data because a %% sign can skip over both kinds of data.
DBCS-open LIKE, NLIKE (not like) pattern in Query for iSeries:
This pattern, which contains both
DBCS and SBCS character data, can be used only for DBCS-open fields.
v
The percent sign (%) skips any number of SBCS characters or double-byte characters, or none at all. It
ignores shift-out and shift-in characters.
v
The DBCS percent sign (%%) works the same way as the standard percent sign (%).
v
The underscore (_) represents one SBCS character. It does not represent a double-byte, shift-out, or
shift-in character.
v
The DBCS underscore (__) represents one double-byte character. It cannot be used to represent an
alphanumeric, shift-out, or shift-in character.
DBCS-Graphic LIKE, NLIKE (not like) pattern in Query for iSeries:
This pattern, which contains only
double-byte characters, can be used only for a DBCS-graphic field. A DBCS-graphic test pattern must
have an uppercase or lowercase G before the apostrophe. Within the apostrophes, the pattern must start
with a shift-out character and end with a shift-in character. Use the DBCS percent sign (%%) to skip any
number of characters or none at all. Use the DBCS underscore (__) to indicate that any double-byte
character is accepted for that position.
Examples
: In the following examples,
%%
represents the DBCS percent sign,
__
represents the DBCS
underscore,
s/o
represents the shift-out character,
s/i
represents the shift-in character, and a pair of the
same SBCS characters, such as
DD
, represent a single DBCS character.
Example 1:
DBCSFLD1
LIKE
’s/o__DD__%%HH%%s/i’
Example 1 selects only records in which the second character in field
DBCSFLD1
is
DD
, the first and third
characters are any double-byte characters, and at least one of the fourth through last characters is
HH
.
This test could be used for any bracketed-DBCS field that is at least ten characters long. This test could
also be used for a DBCS-graphic field by putting a G in front of the test pattern:
G’s/o__DD__%%HH%%s/i’
If
DBCSFLD1
is a DBCS-open field, this test could select data that has alphanumeric characters, such as
‘s/oXXDDMMs/iAnns/oGGHHs/i’
, for which the DBCS percent sign would skip over both double-byte
characters and alphanumeric characters before reaching
HH
.
Example 2:
DBCSFLD2
LIKE
’s/o%%__%%s/i’
Example 2 selects only records in which field
DBCSFLD2
contains at least one double-byte character. The
DBCS underscore (__) can stand for a double-byte character, but not for an alphanumeric character. A
different value,
‘%_%’
, selects records that have at least one alphanumeric character. A value of
‘s/o__________s/i’
selects those that have all double-byte characters for a field that is ten characters
long.
Example 3:
DBCSFLD3
LIKE
’s/oYY%%s/i A_o’
Example 3 selects all records in which the field
DBCSFLD3
begins with the double-byte character
YY
and
ends with alphanumeric characters, the first of which is blank, the second of which is
A
, and the fourth of
which is
o
. This test selects fields such as
‘s/oYYs/i Amo’
;
‘s/oYYZZXXs/iMary Abo’
; or
‘s/oYYs/iABCs/oTTWWs/iM Aro’
. It is not important that the percent between the double-byte character and
alphanumeric parts of the value is a DBCS percent; the following two values are equivalent to the one
used:
‘s/oYY%s/i A_o’
and
‘s/oYY%%s/i% A_o’
.
100
Query for iSeries Use V5R2
Summary of Contents for ISERIES SC41-5210-04
Page 1: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 2: ......
Page 3: ...iSeries Query for iSeries Use Version 5 SC41 5210 04 ERserver ...
Page 12: ...x Query for iSeries Use V5R2 ...
Page 14: ...2 Query for iSeries Use V5R2 ...
Page 32: ...20 Query for iSeries Use V5R2 ...
Page 38: ...26 Query for iSeries Use V5R2 ...
Page 44: ...32 Query for iSeries Use V5R2 ...
Page 116: ...104 Query for iSeries Use V5R2 ...
Page 122: ...110 Query for iSeries Use V5R2 ...
Page 146: ...134 Query for iSeries Use V5R2 ...
Page 150: ...138 Query for iSeries Use V5R2 ...
Page 174: ...162 Query for iSeries Use V5R2 ...
Page 178: ...166 Query for iSeries Use V5R2 ...
Page 196: ...184 Query for iSeries Use V5R2 ...
Page 198: ...186 Query for iSeries Use V5R2 ...
Page 204: ...192 Query for iSeries Use V5R2 ...
Page 205: ...Part 4 Appendixes Copyright IBM Corp 2000 2002 193 ...
Page 206: ...194 Query for iSeries Use V5R2 ...
Page 210: ...198 Query for iSeries Use V5R2 ...
Page 242: ...230 Query for iSeries Use V5R2 ...
Page 256: ...244 Query for iSeries Use V5R2 ...
Page 270: ...258 Query for iSeries Use V5R2 ...
Page 272: ...260 Query for iSeries Use V5R2 ...
Page 292: ...280 Query for iSeries Use V5R2 ...
Page 293: ......
Page 294: ... Printed in U S A SC41 5210 04 ...