Page 1 of 1

Comparing Binary values in Transformer

Posted: Thu Nov 29, 2012 11:40 am
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

Posted: Thu Nov 29, 2012 4:55 pm
by ray.wurlod
Convert to ASCII then do the comparison.

Posted: Thu Nov 29, 2012 5:04 pm
by dganeshm
How would I convert it from binary to ASCII

Posted: Thu Nov 29, 2012 7:57 pm
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.