Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
prolinkdata_gr Trusted Contributor.
Trusted Contributor.
1101 views

PIC supporting plus and minus symbols

Jump to solution

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. 

0 Likes
1 Solution

Accepted Solutions
DMiller1 Absent Member.
Absent Member.

RE: PIC supporting plus and minus symbols

Jump to solution

Try PIC +9(2)  or PIC 9(2)+

View solution in original post

0 Likes
2 Replies
DMiller1 Absent Member.
Absent Member.

RE: PIC supporting plus and minus symbols

Jump to solution

Try PIC +9(2)  or PIC 9(2)+

View solution in original post

0 Likes
Bruce_Sinclair Absent Member.
Absent Member.

RE: PIC supporting plus and minus symbols

Jump to solution

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.