IDENTIFICATION DIVISION. PROGRAM-ID. EXAMPLE. DATA DIVISION. WORKING-STORAGE SECTION. 01 Y PIC X(15). 01 T REDEFINES Y PIC -(5)9(7).99.01 U REDEFINES Y PIC -9(7).99B(4).01 X PIC S9(7)V9(2). PROCEDURE DIVISION. MOVE -1234567.89 TO X MOVE X TO T DISPLAY 'X: >' X '< Y: >' Y '<' MOVE X TO U DISPLAY 'X: >' X '< Y: >' Y '<' GOBACK .
T gives right-alignment, U gives left-alignment. As both REDEFINES occupy the full 15 bytes, there is no need to take account of any value in Y prior to the MOVEs to T or U.
Output is:
X: >12345678R< Y: > -1234567.89<X: >12345678R< Y: >-1234567.89 <