Dbvalidate, Dbwidth – IBM SC34-5764-01 User Manual

Page 430

Advertising
background image

DBVALIDATE

DBVALIDATE(string

,'C'

)

returns 1 if the string is a valid mixed string or SBCS string. Otherwise, returns 0. Mixed string validation
rules are:

1. Only valid DBCS character codes

2. DBCS string is an even number of bytes in length

3. EBCDIC only — Proper SO and SI pairing.

In EBCDIC, if C is omitted, only the leftmost byte of each DBCS character is checked to see that it falls in
the valid range for the implementation it is being run on (that is, in EBCDIC, the leftmost byte range is
from X'41' to X'FE').

Here are some EBCDIC examples:

z='abc<de'

DBVALIDATE('ab<.A.B>')

->

1

DBVALIDATE(z)

->

0

y='C1C20E111213140F'X

DBVALIDATE(y)

->

1

DBVALIDATE(y,'C')

->

0

DBWIDTH

DBWIDTH(string

,option

)

returns the length of string in bytes.

The option controls the counting rule. Y counts SO and SI within mixed strings as one each. N does not
count the SO and SI and is the default.

Here are some EBCDIC examples:

DBWIDTH('ab<.A.B>','Y')

->

8

DBWIDTH('ab<.A.B>','N')

->

6

408

CICS TS for VSE/ESA: REXX Guide

Advertising