Page 1 of 1

Signed Numeric

PostPosted: Fri Nov 15, 2013 2:16 pm
by mohbaig
Declared one variable @ 01 level
01 WS-NUM1 PIC S9(9) VALUE +100.
DISPLAY WS-NUM1.
showing the Result as 00000010{
How to resolve this to show the exact number in display.

Please advice.

Re: Signed Numeric

PostPosted: Fri Nov 15, 2013 2:53 pm
by BillyBoyo
MOVE WS-NUM1 to a numeric-edited field with a sign. Like PIC -(8)9 or PIC Z(8)9-- or something of your choice. The manual describes editing well.

Then DISPLAY your new field.

Re: Signed Numeric

PostPosted: Fri Nov 15, 2013 11:35 pm
by mohbaig
WORKING-STORAGE SECTION.
01 WS-NUM1 PIC S9(9) VALUE +100.
01 WS-NUM2 PIC -9(9) VALUE ZERO.
PROCEDURE DIVISION.
DISPLAY WS-NUM1. ---->00000010{
MOVE WS-NUM1 TO WS-NUM2.
DISPLAY WS-NUM1. ------->00000010{
STOP RUN.

Still facing the issue.. :(

Re: Signed Numeric

PostPosted: Sat Nov 16, 2013 12:05 am
by Akatsukami
mohbaig wrote:WORKING-STORAGE SECTION.
01 WS-NUM1 PIC S9(9) VALUE +100.
01 WS-NUM2 PIC -9(9) VALUE ZERO.
PROCEDURE DIVISION.
DISPLAY WS-NUM1. ---->00000010{
MOVE WS-NUM1 TO WS-NUM2.
DISPLAY WS-NUM1. ------->00000010{
STOP RUN.

Still facing the issue.. :(