Reading messages from datastage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mary
Participant
Posts: 23
Joined: Fri Jun 02, 2006 1:28 am
Location: Bng

Reading messages from datastage

Post by mary »

Hi...

We have a requirement to read messages and process the file. The message we are reading is text file. Some times we are getting "^M" at the end of the line. We are using q pasa to put the message. In dev environment we were not facing this issue. But in test environment the "^M" is getting padded. Is this something related to the configuration of the Queue or this can happend when we read from the queue?

Thanks in advance
paritosh11
Participant
Posts: 5
Joined: Thu Nov 06, 2008 12:50 am
Location: India

Re: Reading messages from datastage

Post by paritosh11 »

mary wrote:Hi...

We have a requirement to read messages and process the file. The message we are reading is text file. Some times we are getting "^M" at the end of the line. We are using q pasa to put the message. In dev environment we were not facing this issue. But in test environment the "^M" is getting padded. Is this something related to the configuration of the Queue or this can happend when we read from the queue?

Thanks in advance
Hi
"^M" comes when the format of the text file is diff. Have U moved that particular text file from windows to unix env in ur test region?

If the file is in unix env than just run this unix command

dos2unix filename filename(same or new name)

and than run ur job again and see if the ^M comes or not.

I hope this will help.
mary
Participant
Posts: 23
Joined: Fri Jun 02, 2006 1:28 am
Location: Bng

Post by mary »

Thanks for the reply...

In dev and stage we are using the q pasa. In Q pasa we are typing the message. In test if we do and enter for new line, the result file is having the "^M". But this is happening only in test
paritosh11
Participant
Posts: 5
Joined: Thu Nov 06, 2008 12:50 am
Location: India

Post by paritosh11 »

mary wrote:Thanks for the reply...

In dev and stage we are using the q pasa. In Q pasa we are typing the message. In test if we do and enter for new line, the result file is having the "^M". But this is happening only in test

See I dnt know much abt Q pasa ....but all i can see here is that its not the problem with with the Q pasa. Its some diff in ur enviromental setting.

^M is nothing but the carriage return.
What happen is when u press enter in Windows.
It is taken as (CR LF) ie both carriage return and line feed.

But in unix the same 'enter' for changing line is taken as only (LF)

So when the env where you are writing this message and the enviroment when you are reading this message is diff, than this could happen.

Or if in ur Q pasa there must be some setting of Ascii and binary mods than u can change it. compare both dev and test for this settings.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you know that the DOS-style terminators will be there then you can specify DOS-style (rather than UNIX-style) on the Stage properties tab of the Sequential File stage that reads the file. Otherwise you can remove the Ctrl-M characters either before they get to DataStage or within the job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Right... you can use Convert() to strip any CHAR(10) values from the last field or leverage "dos2unix" in the Filter option when reading the file.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply