Datatype, Find, Index, pos, and lastpos – IBM SC34-5764-01 User Manual

Page 423: Insert and overlay, Justify, Left, right, and center

Advertising
background image

DATATYPE

DATATYPE('<.A.B>')

->

'CHAR'

DATATYPE('<.A.B>','D')

->

1

DATATYPE('<.A.B>','C')

->

1

DATATYPE('a<.A.B>b','D') ->

0

DATATYPE('a<.A.B>b','C') ->

1

DATATYPE('abcde','C')

->

0

DATATYPE('<.A.B','C')

->

0

DATATYPE('<.A.B>','S')

->

1

/* if ETMODE is on */

Note: If string is not a valid mixed string and C or D is specified as type, 0 is returned.

FIND

FIND('<.A. .B.C> abc','<.B.C> abc')

->

2

FIND('<.A. .B><.C> abc','<.B.C> abc')

->

2

FIND('<.A. . .B> abc','<.A> <.B>')

->

1

Applying the word extraction from a string and character comparison rules.

INDEX, POS, and LASTPOS

INDEX('<.A><.B><><.C.D.E>','<.D.E>')

->

4

POS('<.A>','<.A><.B><><.A.D.E>')

->

1

LASTPOS('<.A>','<.A><.B><><.A.D.E>')

->

3

Applying the character extraction from a string and character comparison rules.

INSERT and OVERLAY

In EBCDIC:

INSERT('a','b<><.A.B>',1)

-> 'ba<><.A.B>'

INSERT('<.A.B>','<.C.D><>',2)

-> '<.C.D.A.B><>'

INSERT('<.A.B>','<.C.D><><.E>',2)

-> '<.C.D.A.B><><.E>'

INSERT('<.A.B>','<.C.D><>',3,,'<.E>') -> '<.C.D><.E.A.B>'

OVERLAY('<.A.B>','<.C.D><>',2)

-> '<.C.A.B>'

OVERLAY('<.A.B>','<.C.D><><.E>',2)

-> '<.C.A.B>'

OVERLAY('<.A.B>','<.C.D><><.E>',3)

-> '<.C.D><><.A.B>'

OVERLAY('<.A.B>','<.C.D><>',4,,'<.E>')

-> '<.C.D><.E.A.B>'

OVERLAY('<.A>','<.C.D><.E>',2)

-> '<.C.A><.E>'

Applying the character extraction from a string and character comparison rules.

JUSTIFY

JUSTIFY('<><. .A. . .B><.C. .D>',10,'p')

->

'<.A>ppp<.B><.C>ppp<.D>'

JUSTIFY('<><. .A. . .B><.C. .D>',11,'p')

->

'<.A>pppp<.B><.C>ppp<.D>'

JUSTIFY('<><. .A. . .B><.C. .D>',10,'<.P>')

->

'<.A.P.P.P.B><.C.P.P.P.D>'

JUSTIFY('<><.X. .A. . .B><.C. .D>',11,'<.P>')

->

'<.X.P.P.A.P.P.B><.C.P.P.D>'

Applying the character concatenation for padding and character extraction from a string rules.

LEFT, RIGHT, and CENTER

In EBCDIC:

LEFT('<.A.B.C.D.E>',4)

->

'<.A.B.C.D>'

LEFT('a<>',2)

->

'a<> '

LEFT('<.A>',2,'*')

->

'<.A>*'

RIGHT('<.A.B.C.D.E>',4)

->

'<.B.C.D.E>'

Appendix C. Double-Byte Character Set (DBCS) Support

401

Advertising