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


INSERT

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

Read syntax diagramSkip visual syntax diagram
>>-INSERT(new,target--+-----------------------------------+----->
                      '-,-+---+-+-----------------------+-'   
                          '-n-' '-,-+--------+-+------+-'     
                                    '-length-' '-,pad-'       

>--)-----------------------------------------------------------><

inserts the string new, padded or truncated to length length, into the string target after the nth character. The default value for n is 0, which means insert before the beginning of the string. If specified, n and length must be positive whole numbers or zero. If n is greater than the length of the target string, padding is added before the string new also. The default value for length is the length of new. If length is less than the length of the string new, then INSERT truncates new to length length. The default pad character is a blank.

Here are some examples:
INSERT(' ','abcdef',3)         ->    'abc def'
INSERT('123','abc',5,6)        ->    'abc  123   '
INSERT('123','abc',5,6,'+')    ->    'abc++123+++'
INSERT('123','abc')            ->    '123abc'
INSERT('123','abc',,5,'-')     ->    '123--abc'

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014