View previous topic :: View next topic
|
Author |
Message |
paandians
New User
Joined: 25 Feb 2009 Posts: 2 Location: chennai
|
|
|
|
Hi ,
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. |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
If you are using a COBOL program, just move the packed decimal variable into a numeric field and then try to write to output file.
or you can use a SORT card to convert the packed value to numeric. |
|
Back to top |
|
|
paandians
New User
Joined: 25 Feb 2009 Posts: 2 Location: chennai
|
|
|
|
Hi Arvind ,
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. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Have you tried to display it with the Edit-Mask (EM=) option?
O. |
|
Back to top |
|
|
Ralph Zbrog
New User
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.
Code: |
DEFINE DATA LOCAL
1 REC
2 #ALPHA (A10)
2 #DATE (A10)
2 #PACKED (P11.2)
1 #NUMERIC (N11.2)
END-DEFINE
ASSIGN #NUMERIC = #PACKED
WRITE WORK 1 #ALPHA
#DATE
#NUMERIC
END |
|
|
Back to top |
|
|
|