Unable to see the non printable characters

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
anu123
Premium Member
Premium Member
Posts: 143
Joined: Sun Feb 05, 2006 1:05 pm
Location: Columbus, OH, USA

Unable to see the non printable characters

Post by anu123 »

Our file has different record types. It is a text file with ASCII data. Delimiter is a non printable character.

I am trying to read the data in single column and then divide the records.

But when I am trying to read the data in single line, when I say view data I could not see the non printable characters (I mean they even doesn't appear as boxes).

Kindly give me your thoughts.

Using sequential file to read the data.
Thank you,
Anu
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Are you asking how to determine what character the delimiter is? From unix command line, this command will tell each character's value in hex. I suggest you run it on a small 1 or 2 line sample file.

Code: Select all

od -x file.txt
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or:

Code: Select all

head -2 file.txt | od -x
-craig

"You can never have too many knives" -- Logan Nine Fingers
anu123
Premium Member
Premium Member
Posts: 143
Joined: Sun Feb 05, 2006 1:05 pm
Location: Columbus, OH, USA

Re: Unable to see the non printable characters

Post by anu123 »

No I am not asking about how to find what is the character.

Suppose in the file the data is delimited by ASCII 26, like A(ASCII 26)B, when I define single column in seq file stage and click on view data, I ma seeing AB in place of non printable character I don't see a box or anything.

Later I want to split that record into two columns in Transformer, How should I do that ? (Apart from doing that in the sequential file stage while reading the file..)
Thank you,
Anu
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In the Transformer stage, use Field(InLink.Line, Char(26), 1, 1) and similar.

Performance tip: initialize stage variable to Char(26) and use the stage variable name as the second argument of the Field() function - that way the Char() function is evaluated only once.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ssnegi
Participant
Posts: 138
Joined: Thu Nov 15, 2007 4:17 am
Location: Sydney, Australia

Post by ssnegi »

replace the non-printable character with , or some other delimiter.
You can do this by Sed, awk utilities.
Then read the file into datastage.
anu123
Premium Member
Premium Member
Posts: 143
Joined: Sun Feb 05, 2006 1:05 pm
Location: Columbus, OH, USA

Post by anu123 »

Thanks Ray. It worked. Actually when reading the file before I was using \x1A, so in filed function I was trying with that and just 1c (I kind of know that this is wrong as the data may contain 1c) which are the hexadecimal values.

Thanks ssnegi for the alternative. But I wanted to do that in Datastage.
Thank you,
Anu
Post Reply