Page 1 of 1

Loading Binary Data into DB2 using DataStage

Posted: Wed Nov 29, 2017 11:12 pm
by rameshtbhdsx
Hello Experts,

We have a requirement where in there is a table in DB2 or a source file that has Binary data(16bit). This needs to be loaded into another DB2 table to a binary 16 bit column. We need to get this done using DataStage.

We tried using different data types to load. Still we could not.

Can someone let us know how to get this done ?

Regards
Ramesh R

Posted: Thu Nov 30, 2017 8:03 am
by chulett
Before people start throwing suggestions, what data types have you tried and what are the issues you are seeing?

Posted: Fri Dec 01, 2017 8:04 am
by chulett
Wait, so you need to transform the data before you load it? How so, exactly?

Posted: Fri Dec 01, 2017 8:47 am
by ManjuRoji
Hi, I am working on the same requirement along with Ramesh.
The issue is we have DB2 datatype as Binary which is our source. Now we require this data to be converted to varchar data, which in turn is to be used to retrieve data from other sources.

Posted: Fri Dec 01, 2017 9:23 am
by chulett
Well, without knowing anything about your data, all I can do is suggest you investigate the "raw" conversion functions documented here.

Posted: Fri Dec 01, 2017 9:31 am
by rameshtbhdsx
Yes. The converted Varchar would be needed for fetching data from few other tables where the data is not in binary format. The binary data loaded into the DB2 Source table through a Java program. Now we face challenges to read as well as write using DataStage.

Posted: Fri Dec 01, 2017 9:33 am
by FranklinE
Ramesh's sample data prompts me to ask: where are you converting to or from EBCDIC and ASCII?

Review all your read/write attributes. I'm guessing this is a character set issue, not the format of the data stream.

See my signature line for using mainframe data FAQ link.

Posted: Fri Dec 01, 2017 9:37 am
by PaulVL
also, what character set are you using?

Posted: Sat Dec 02, 2017 12:04 am
by rameshtbhdsx
Here is what we have. We get the 16 bit binary data generated using UUID(Universal Unique Identifier) through a Java code. The Java codes generates UUID and returns a 16 bit value which is a binary. We need to consume it through DataStage. Let us know if you need more information.

Posted: Sun Dec 03, 2017 7:15 pm
by ray.wurlod
16 bit, or 16 byte?

Most of the UUIDs with which I've worked have been either 36 characters, or Long Integer data type.

Posted: Sun Dec 03, 2017 8:54 pm
by rameshtbhdsx
Yes. You are correct. We to get 36 bit out of UUID. But the requirement from client is to make it 16bit Binary inside the Database and for the first time the Java code generates the UUID , converts it into 16bit binary data and loads intot the table. When we need to read the data or write to some other table or file, we are unable to do.

Posted: Mon Dec 04, 2017 1:54 am
by ray.wurlod
Again, bit or byte? What's the exact data type in the DB2 table?

Posted: Mon Dec 04, 2017 2:13 am
by rameshtbhdsx
it is bit .. 16 bit.

Posted: Mon Dec 04, 2017 8:49 am
by PaulVL
What CHARACTER SET are you using for your job and the database table?

UTF-16 I hope.