I could be wrong, but both of these solutions seem to give only a character representation of the desired result, at least when written to a Sequential File stage. For example:
oconv("9","MB") = "1001", not a true binary field, but rather an ASCII character field. (In hex it would be x31303031, I believe).
Is it possible to achieve a true binary field? So that the result would be x09? I have tried several combinations of oconv and iconv with no success.
lebos wrote:I could be wrong, but both of these solutions seem to give only a character representation of the desired result, at least when written to a Sequential File stage. For example:
oconv("9","MB") = "1001", not a true binary field, but rather an ASCII character field. (In hex it would be x31303031, I believe).
Is it possible to achieve a true binary field? So that the result would be x09? I have tried several combinations of oconv and iconv with no success.
Larry
You are correct; as far as I know DataStage cannot convert a numeric string to binary. We had to write our own utility.
John
lebos wrote:I could be wrong, but both of these solutions seem to give only a character representation of the desired result, at least when written to a Sequential File stage. For example:
oconv("9","MB") = "1001", not a true binary field, but rather an ASCII character field. (In hex it would be x31303031, I believe).
Is it possible to achieve a true binary field? So that the result would be x09? I have tried several combinations of oconv and iconv with no success.
Larry
Didja try the "MX" conversion specification?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Yes, it tends to be one-way traffic. You can convert from binary data into equivalent string representation (which is DataStage's internal representation) but not, it seems, the other way.
I'm certain there is a way, but can't remember right now (10:30pm in a Bangkok hotel, without DataStage) how to go about it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.