z/OS TSO/E REXX Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


DBCENTER

z/OS TSO/E REXX Reference
SA32-0972-00

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>'

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014