Comparing Binary values in Transformer

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
dganeshm
Premium Member
Premium Member
Posts: 91
Joined: Tue Aug 11, 2009 3:26 pm

Comparing Binary values in Transformer

Post by dganeshm »

I am reading an EBCDIC file in which there is a binary field, based on the value of the binary field I will have to read different segments of the record.

I can read this field as binary from the file but in the transformer I want to write a constraint against this field to determine the segment.

eg. COL_138 has the binary value 01, how can I equate this in a constraint..

I cant do COL_138 = '01'


Please advise
Regards,
Ganesh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Convert to ASCII then do the comparison.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dganeshm
Premium Member
Premium Member
Posts: 91
Joined: Tue Aug 11, 2009 3:26 pm

Post by dganeshm »

How would I convert it from binary to ASCII
Regards,
Ganesh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If it's truly binary then you could compare it against the value of Char(01).
Tip: evaluate the Char() function once in a stage variable and compare against that value. In ASCII, Char(01) is Ctrl-A. If this doesn't work, then it's not actually a binary value that you're looking at.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply