Getting datastage to add a decimal point
Posted: Tue Nov 30, 2004 5:35 am
My Basic problem is that I can't work out how to get datastage to interpred 80000 as 80.000 (I wan't to be able to do it just by defining the field correctly).
I'm trying to run a job to convert an EBCDIC file into ASCII.
This file has a header, many details, and a trailer record.
I've started of with a CFF stage where I defined it as 1 record format which has 1 character field which is the length of the whole record.
This goes to a transformer where I send the file to different files based on the 1st character of the record (which tells you if its a header, detail or trailer).
So, the detail records end up being written into a seq. file as one long field.
When I view the data in this file the amount field that I am interested in contains 000000000000080000 - which represents 80.000 (i.e. its total length is 18 and the last 3 digits are after the decimal point).
I then have defined an output from that file which has the correct format for the detail record (i.e. each field is defined - rather than 1 long field), but I can't get datastage to interpret 000000000000080000 as 80.000.
I've tried defining it as decimal with length 15 scale 3 but it seems to add on an extra .000 - giving me 80000.000 instead of 80.000 .
What am I doing wrong here?
Is there an easier way for me to approach this?
I'm trying to run a job to convert an EBCDIC file into ASCII.
This file has a header, many details, and a trailer record.
I've started of with a CFF stage where I defined it as 1 record format which has 1 character field which is the length of the whole record.
This goes to a transformer where I send the file to different files based on the 1st character of the record (which tells you if its a header, detail or trailer).
So, the detail records end up being written into a seq. file as one long field.
When I view the data in this file the amount field that I am interested in contains 000000000000080000 - which represents 80.000 (i.e. its total length is 18 and the last 3 digits are after the decimal point).
I then have defined an output from that file which has the correct format for the detail record (i.e. each field is defined - rather than 1 long field), but I can't get datastage to interpret 000000000000080000 as 80.000.
I've tried defining it as decimal with length 15 scale 3 but it seems to add on an extra .000 - giving me 80000.000 instead of 80.000 .
What am I doing wrong here?
Is there an easier way for me to approach this?