Base64 Encoding

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

Base64 Encoding

Post by MrBlack »

Does anyone know how to take text and encode to base 64?

My data is xml text stored as a blob in the database. Then I'm pushing this into a web service.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Depending on the database, there should be a function called something like RAWTOHEX. Use that in a user-defined SELECT statement.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

Post by MrBlack »

I tried going that route to have my database do the conversion but there were issues of data length limitations plus I felt as if there should be a pure datastage solution because I may not always be reading from a database. So I did some research and wrote a routine that I can us in my transformer. This gives me the flexibility changing out my data source and always being able to do base64 encoding.

If anyone else is wondering how to write a routine I used this link for the conversion methodology: http://en.wikipedia.org/wiki/Base64
Post Reply