View previous topic :: View next topic
|
Author |
Message |
krishnakumarramaraj
New User
Joined: 15 Nov 2005 Posts: 15 Location: chennai
|
|
|
|
Hi ,
I have a field S9(7)V99 COMP-3 in a file.when i browse that file the value of thet field is like +64.00 ,-64.00,-2395.00.
I have to write it in output file in the same format taht is like
+64.00 ,-64.00,-2395.00.
Please suggest me a solution. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
krishnakumarramaraj wrote: |
Hi ,
I have a field S9(7)V99 COMP-3 in a file.when i browse that file the value of thet field is like +64.00 ,-64.00,-2395.00.
I have to write it in output file in the same format taht is like
+64.00 ,-64.00,-2395.00.
Please suggest me a solution. |
Those values are you softwares interpretation of the values not the way they are in the file. if you want COMP-3 values in your file then just define the field as pic s9(7)v99 comp-3 and move the data from the input to the output. If you want like +64.00 ,-64.00,-2395.00 then define it as numeric edited in your output file PIC +,+++,++0.99 and move the data from the input to the output. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
a PIC S9(7)V99 COMP-3 field containing +64.00 will be a 5 byte field containing X'000006400C'.
if you want the field in the file to look like +64.00 you need to define 2 edit masks: PIC ++++++9.99 and PIC ------9.99.
based on the positive or negative value of the comp-3 field you need to move to one or the other edit mask. an edit mask will only show - or +. not both (used to be). maybe the new cobols provide a multifunction editmask.
I would suggest defining your editmask in the output file definition.
if you want the file to contain a COMP-3 field, then define the output file definition with a comp-3 field. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
when i browse that file the value of thet field is like +64.00 ,-64.00,-2395.00. |
How are you browsing the file that shows the sign and the decimal point? "Inside" a file a comp-3 (packed decimal) field would have neither. . .
Are you using a "smart" browse that matches the data to a copybook or something similar? |
|
Back to top |
|
|
krishnakumarramaraj
New User
Joined: 15 Nov 2005 Posts: 15 Location: chennai
|
|
|
|
Thanks for ur reply and its working. |
|
Back to top |
|
|
|