View previous topic :: View next topic
|
Author |
Message |
nightbuzzz
New User
Joined: 04 May 2007 Posts: 21 Location: kuala lumpur
|
|
|
|
Hi,
I need to move a packed decimal field into a file. I tried moving it by copying it into a numeric field(so that it is readable) and then moving the numeric field into the file.
But the decimal point is not getting displayed in the file. I am using easytrieve.
Please help.
Thanks! |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Hello,
Please post the Declaration(Working storage) part of that Field so that we can help you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This has nothing to do with Easytrieve. . .
There is no decimal point in a packed-decimal number.
Packed-decimal values contain some number of digits and the sign - nothing else. |
|
Back to top |
|
|
mtaylor
Active User
Joined: 20 Feb 2009 Posts: 108 Location: Kansas City
|
|
|
|
nightbuzzz wrote: |
Hi,
I need to move a packed decimal field into a file. I tried moving it by copying it into a numeric field(so that it is readable) and then moving the numeric field into the file.
But the decimal point is not getting displayed in the file. I am using easytrieve.
Please help.
Thanks! |
Iirc, Easytrieve doesn't format files, it formats reports. So if you want to format output (with decimal points, dollar signs etc...) you have to do some funky stuff to create a report with no heading, no footer, no column headings, no summary lines etc... ymmv. |
|
Back to top |
|
|
nightbuzzz
New User
Joined: 04 May 2007 Posts: 21 Location: kuala lumpur
|
|
|
|
Yes, It looks like easytrive doesn't allow formatting of files.
I have used an array and inserted the decimal point manually.
Thanks for your time! |
|
Back to top |
|
|
nightbuzzz
New User
Joined: 04 May 2007 Posts: 21 Location: kuala lumpur
|
|
|
|
Hi,
I have to get the data from a DB2 table and put it into a PS using easytrieve.
The column in DB2 table is defined as Decimal(14,2). I moved this field into a working storage numeric field (14 N 2). Now when I am moving this field into the PS file, the decimal point is not getting copied. I tried formatting it (like 999999.99), but even then the decimal point is missing in the final output.
Eg: Value in DB2 table : 1500.00
Value in the PS after copying: 150000 (decimal point is missing)
I need 1500.00 in the output file. How do I do it?
Thanks! |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Quote: |
column in DB2 table is defined as Decimal(14,2). I moved this field into a working storage numeric field (14 N 2). Now when I am moving this field into the PS file, the decimal point is not getting copied. I tried formatting it (like 999999.99), but even then the decimal point is missing in the final output. |
Eg: Value in DB2 table : 1500.00
Packed Decimal, Decimal (DB2), Comp-3 (COBOL) fields do not include an actual decimal point.
. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Said a bit differently - you can have a packed-decimal field or you can have a decimal point.
You cannot have both in the same field.
Why do you believe there is a requirement to have a packed-decimal field with an embedded decimal point? |
|
Back to top |
|
|
nightbuzzz
New User
Joined: 04 May 2007 Posts: 21 Location: kuala lumpur
|
|
|
|
Hi,
Let's forget about packed demical for the moment.
If I have field say W-VAR with value 145673. Now, I want to move this field into a PS file but with a decimal point.
E.g: 1456.73
How can we do this using easytrieve? I tried using masking (like 9999.99) - while displaying the field its displaying with the decimal point but when I am moving this field into the file, decimal point is not getting copied.
e.g:
Display w-var Result: 1456.73
File_field = w-var
put file_name
Result in the file : 145673
I hope my question is clear.
Thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might redefine the edited field with a character (alpha) field, and move the alpha field to the output file. |
|
Back to top |
|
|
|