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
Reading messages from datastage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 5
- Joined: Thu Nov 06, 2008 12:50 am
- Location: India
Re: Reading messages from datastage
Himary 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
"^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.
-
- Participant
- Posts: 5
- Joined: Thu Nov 06, 2008 12:50 am
- Location: India
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.