DBCENTER

Read syntax diagramSkip visual syntax diagram
>>-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>'


Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/dfhrxce.html