Page 1 of 1

convert S9(5)V9(2) Comp 3 to alphanumeric

Posted: Tue Apr 16, 2024 2:31 pm
by Arun Rajput
Hi,

How can we convert S9(5)V9(2) Comp 3 to alphanumeric so that i can display the amount??

Thanks for the help.

Re: convert S9(5)V9(2) Comp 3 to alphanumeric

Posted: Tue Apr 16, 2024 4:28 pm
by Robert Sample
COBOL MOVE statement.

Re: convert S9(5)V9(2) Comp 3 to alphanumeric

Posted: Fri Apr 19, 2024 4:46 am
by zum13
Hello.

It's just a matter of moving your non-displayable value to a field that is displayable. So, for S9(5)V9(2), a field defined as -9(5).9(2) would give you a result which would be an minus sign (or blank if the number is positive) and your number with leading zeros. Changing the minus to a plus means the sign is shown whether positive or negative. A definition of -Z9(4)9.9(2) would give you a result without the leading zeros.