IBM SC34-5764-01 Server User Manual


 
DBCENTER
 DBCENTER(string,length
,
pad ,option
) 
returns a string of length length with string centered in it, with pad characters added as necessary to make
up length. The default pad character is a blank. If string is longer than length, it is truncated at both ends
to fit. If an odd number of characters are truncated or added, the right-hand end loses or gains one more
character than the left-hand end.
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:
DBCENTER('<.A.B.C>',4) -> ' <.B> '
DBCENTER('<.A.B.C>',3) -> ' <.B>'
DBCENTER('<.A.B.C>',10,'x') -> 'xx<.A.B.C>xx'
DBCENTER('<.A.B.C>',10,'x','Y') -> 'x<.A.B.C>x'
DBCENTER('<.A.B.C>',4,'x','Y') -> '<.B>'
DBCENTER('<.A.B.C>',5,'x','Y') -> 'x<.B>'
DBCENTER('<.A.B.C>',8,'<.P>') -> ' <.A.B.C> '
DBCENTER('<.A.B.C>',9,'<.P>') -> ' <.A.B.C.P>'
DBCENTER('<.A.B.C>',10,'<.P>') -> '<.P.A.B.C.P>'
DBCENTER('<.A.B.C>',12,'<.P>','Y') -> '<.P.A.B.C.P>'
DBCJUSTIFY
 DBCJUSTIFY(string,length
,
pad ,option
) 
formats string by adding pad characters between nonblank characters to justify to both margins and length
of bytes length (length must be nonnegative). Rules for adjustments are the same as for the JUSTIFY
function. The default pad character is a blank.
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 examples:
DBCJUSTIFY('<><AA BB><CC>',20,,'Y')
-> '<AA> <BB> <CC>'
DBCJUSTIFY('<>< AA BB>< CC>',20,'<XX>','Y')
-> '<AAXXXXXXBBXXXXXXCC>'
DBCJUSTIFY('<>< AA BB>< CC>',21,'<XX>','Y')
-> '<AAXXXXXXBBXXXXXXCC> '
DBCJUSTIFY('<>< AA BB>< CC>',11,'<XX>','Y')
-> '<AAXXXXBB> '
DBCJUSTIFY('<>< AA BB>< CC>',11,'<XX>','N')
-> '<AAXXBBXXCC> '
DBLEFT
 DBLEFT(string,length
,
pad ,option
) 
returns a string of length length containing the leftmost length characters of string. The string returned is
Appendix C. Double-Byte Character Set (DBCS) Support 405