Reading Packed Data from Db2 table

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Inquisitive
Charter Member
Charter Member
Posts: 88
Joined: Tue Jan 13, 2004 3:07 pm

Reading Packed Data from Db2 table

Post 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
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Why not to use DB2 API and Decimal datatype.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Inquisitive
Charter Member
Charter Member
Posts: 88
Joined: Tue Jan 13, 2004 3:07 pm

Post 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?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply