How can I display the minus sign on the left of a number with VISION:Report?

Document ID : KB000030998
Last Modified Date : 14/02/2018
Show Technical Document Details

VISION:Report does not have an edit pattern to insert a sign byte preceding the first significant digit of an edited field.
However, this can be accomplished by using an edit pattern that generates the sign byte following the last digit of the edited output and logic in the sample code below:

     EQU FLDA (2)-B X'FEDC'               /* -292 in binary
     MOVE FLDA TO PRT20 C                 /* convert to edited format 
     IF PRT26 = C'-'                      /* negative number ?
       MOVE BLANK TO PRT26                /* remove trailing negative sign
       IF PRT19-25 INCLUDES BLANK REVERSE /* scan for a leading blank 
         MOVE C'-' TO PTR1                /* insert leading negative sign 
9999 END

The sample code generates an edited number in PRT20-26 using edit mask "C" (C'bbb292-').
If a minus sign is present in the last byte of the output, PRT26, it is blanked out.
Then the output field and a preceding blank in front of the output field are scanned from right to left for the first blank byte (C'bbbb292-').
The sign byte is inserted their, yielding the desired format of C'bbb-292b'.