I have an input file with a field of format (P11,2).
I have write this to an output file , but it is not being done correctly.
How should we convert this data so that the exact values can be displayed in the output file rather than some special characters .
If it has to be converted to numeric . Please tell me how the conversion should be done before I write it to the output file.
Thanks for the reply , but I am not working in COBOL. This is for a NATURAL program . I missed mentioning that in the previous post.
I have tried moving to a numeric field but the display in the output is still not proper.
Joined: 21 Nov 2009 Posts: 58 Location: California
When you write a packed field to a WORK file, the output record will contain the field in packed format. If you want to write the value as external decimal (unpacked), then you must explicitly convert the value with a temporary variable. WRITE WORK does not allow format specifications nor edit masks.
DEFINE DATA LOCAL
2 #ALPHA (A10)
2 #DATE (A10)
2 #PACKED (P11.2)
1 #NUMERIC (N11.2)
ASSIGN #NUMERIC = #PACKED
WRITE WORK 1 #ALPHA