Loading Binary Data into DB2 using DataStage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
rameshtbhdsx
Participant
Posts: 7
Joined: Thu Sep 14, 2017 2:26 am

Loading Binary Data into DB2 using DataStage

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Before people start throwing suggestions, what data types have you tried and what are the issues you are seeing?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Wait, so you need to transform the data before you load it? How so, exactly?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ManjuRoji
Participant
Posts: 1
Joined: Fri Dec 01, 2017 8:29 am

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, without knowing anything about your data, all I can do is suggest you investigate the "raw" conversion functions documented here.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rameshtbhdsx
Participant
Posts: 7
Joined: Thu Sep 14, 2017 2:26 am

Post 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.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

also, what character set are you using?
rameshtbhdsx
Participant
Posts: 7
Joined: Thu Sep 14, 2017 2:26 am

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rameshtbhdsx
Participant
Posts: 7
Joined: Thu Sep 14, 2017 2:26 am

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Again, bit or byte? What's the exact data type in the DB2 table?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rameshtbhdsx
Participant
Posts: 7
Joined: Thu Sep 14, 2017 2:26 am

Post by rameshtbhdsx »

it is bit .. 16 bit.
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

What CHARACTER SET are you using for your job and the database table?

UTF-16 I hope.
Post Reply