PIC supporting plus and minus symbols

Hi all,

i have a PIC S9(2) variable holding positive and negative values. I would like to display the values in a grid cell, with the plus or minus symbol:

If value = 3 then display 3, if value = -3 then display -3, if value = 0 then display nothing. Is there a PIC supporting this?

Apologies if my question is trivial.

Th.P. 

  • There are additional options depending on whether you want the symbol fixed on the left, floating right to just before the first significant digit, blank when zero.  Also you can have two digits with a leading 0 or, in the case of values 0 - 9, a single digit with a leading space.

         *> BWZ == BLANK WHEN ZERO

         *> fixed == plus sign in fixed position

         *> floating == plus sign floats to right

          01 num01  pic (3).   *> floating ; implicitly BWZ

          01 num02  pic (3) blank when zero.  *> floating ; explicitly BWZ

          01 num03  pic z9.   *> fixed ; one digit for 0 - 9

          01 num04  pic 9.   *> floating with one digit for 0 - 9

          01 num05  pic 99.   *> fixed   with two digits for 0 - 9

          01 num06  pic zz.   *> fixed   ; implicitly BWZ