Page 1 of 1

Reading Packed Data from Db2 table

Posted: Fri Oct 06, 2006 12:55 am
by Inquisitive
I am trying to read DB2 table (Db2 on mainframe) which has Packed decimal data stored in CHAR field. I am using ODBC stage to read data.

When I import table definitions, te field is defined as CHAR and 'view data' shows some un-readable data in the field.
Now, how can I read that packed data from DB2 table?

Any pointer to achieve this would be helpful.

Thanks

Posted: Fri Oct 06, 2006 1:01 am
by kumar_s
Why not to use DB2 API and Decimal datatype.

Posted: Fri Oct 06, 2006 1:15 am
by Inquisitive
Will API stage automatically unpack the packed decimals stored in CHAR field?

At this point I am restricted to use ODBC, is there any way it could be done in ODBC stage?

Posted: Fri Oct 06, 2006 1:20 am
by ArndW
You can use the SDK routines to unpack these fields. I'm not at a DataStage computer right now to tell you the exact name of the routine, but if you look under the SDK category you will find them.

Posted: Fri Oct 06, 2006 1:23 am
by kumar_s
You can use the datatype conversion avaialble in Transformer (sdk function available in DS Transform). Find the exact type in mainframe and use the appropriate function.