COGNOiSe.com - The IBM Cognos Community

ETL, App Development and other tools => COGNOS DecisionStream/Data Manager => Topic started by: terry_stjean on 21 Apr 2013 06:36:52 AM

Title: Packed Decimal in text field
Post by: terry_stjean on 21 Apr 2013 06:36:52 AM
I have a file which has a Packed Decimal Date (YYYYMMDD) in a char field.
When I import this data in using Data Manager, how do I convert the Packd Decimal to an Integer value so I can get the date value.
Title: Packed Decimal in text field
Post by: MFGF on 22 Apr 2013 02:22:15 PM
Hi. Just use a toInteger() function in your derivation if you want to convert it to an integer value.

Cheers!

MF.

Sent from my iPad using Tapatalk HD
Title: Re: Packed Decimal in text field
Post by: terry_stjean on 22 Apr 2013 02:47:37 PM
Hi,
It's returning a 0 value.
Could the issue be due to the packed decimal being in a char field?
Title: Re: Packed Decimal in text field
Post by: siyad on 23 Apr 2013 11:12:28 AM
my 2 cents...
I am just thinking if you have configured your definition file to take the type of this field as integer and it woould flow through as an integer. Also check the data
type of this column at the data stream too
Title: Re: Packed Decimal in text field
Post by: terry_stjean on 23 Apr 2013 01:10:59 PM
It's not from a flat text file.
It's from a table on an iSeries server
Title: Re: Packed Decimal in text field
Post by: siyad on 24 Apr 2013 03:53:12 AM
ok...it looks a bit strange and cant think any more, other than checking for the spaces before or after the yyyymmdd
Title: Re: Packed Decimal in text field
Post by: MFGF on 24 Apr 2013 11:44:37 AM
What results do you get if you use a toChar() function on the item before you use toInteger()? Does this parse and work ok?

MF.
Title: Re: Packed Decimal in text field
Post by: terry_stjean on 27 Apr 2013 07:08:19 PM
When I use ToChar(), I get 0 instead of the actual number.
Title: Re: Packed Decimal in text field
Post by: MFGF on 29 Apr 2013 05:43:43 AM
Bizarre! I have not seen that before. If you create a new datastream item with a Type of Integer, then map your date field to this, do you see the expected value in the datastream item, or still zero?

MF.