C$JUSTIFY performs left or right justification of data and centering of data.

CALL "C$JUSTIFY" USING DATA-ITEM, JUSTIFY-TYPE

This data item contains the data to be justified.

This optional parameter contains one of three literal values:

L | indicates left justification |

R | indicates right justification |

C | indicates centering |

If this parameter is omitted, then "R" is implied.

This routine removes all leading and trailing spaces from DATA-ITEM and justifies the remaining data as indicated by JUSTIFY-TYPE. The resulting string is returned in DATA-ITEM. If centering is chosen, there will be one more space on the right than on the left if an odd number of spaces is used.