Populating a field in Cobol
Posted: Wed Mar 14, 2012 6:25 pm
Hi,
I have to populate an amount field which is of PIC S9(11)V9(2) USAGE COMP-3 to an output file field PIC 9(13)V9(2) . Its working fine while moving.
The issue is : As per my requirement I need to enclose the amount in brackets if it is negative.For positive, populate as it is.
eg:
if amount is 33.33 , in output it will be 33.33
if amount is -33.33, in output it will be (33.33)
I have only a single amount field in output , in which I need to process the amount whether its positive /negative..
Is there anyway to implement this using Cobol ?
I have to populate an amount field which is of PIC S9(11)V9(2) USAGE COMP-3 to an output file field PIC 9(13)V9(2) . Its working fine while moving.
The issue is : As per my requirement I need to enclose the amount in brackets if it is negative.For positive, populate as it is.
eg:
if amount is 33.33 , in output it will be 33.33
if amount is -33.33, in output it will be (33.33)
I have only a single amount field in output , in which I need to process the amount whether its positive /negative..
Is there anyway to implement this using Cobol ?