Control M characters in Sequential File
Moderators: chulett, rschirm, roy
Control M characters in Sequential File
Hi,
I have written a job control to capture the job summary using DSMakeJobReport and to write this information to a sequential file in a loop (for each job).
I am able to see the expected result in the output flat file, but I also see ^M characters at the end of each line in the output.
Can anyone please suggest a way to remove these charcters in the output?
I have written a job control to capture the job summary using DSMakeJobReport and to write this information to a sequential file in a loop (for each job).
I am able to see the expected result in the output flat file, but I also see ^M characters at the end of each line in the output.
Can anyone please suggest a way to remove these charcters in the output?
Re: Control M characters in Sequential File
There are various ways of removing the ^M characters. Simplest one is to use the dos2unix utility.
This will work...Just in case if it doesnt, use the tr utility of unix. Use the following command to remove the ^M characters. You can use this commands in a before job routine and strip the unwanted character.
This will work...Just in case if it doesnt, use the tr utility of unix. Use the following command to remove the ^M characters. You can use this commands in a before job routine and strip the unwanted character.
Code: Select all
tr -d '\r' < yourfile.txt > yourfile1.txt
mv yourfile1.txt yourfile.txt
Thanks
DSDexter
DSDexter
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Hi Ray, Iam not using a Sequential File Stage. I have used OpenSeq and WriteSeq commands to write to a flat file in a Job Control.
Is there an option to avoid the occurence of ^M characters while writing to the file itself? I would not prefer to remove the characters after the file has been created, because this job is going to be run as part of the main sequencer everyday.
Is there an option to avoid the occurence of ^M characters while writing to the file itself? I would not prefer to remove the characters after the file has been created, because this job is going to be run as part of the main sequencer everyday.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In your routine simply where CtrlM = Char(13)
Code: Select all
Convert CtrlM To "" In Line
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.