Hi all,
I am facing an issue with the line termination. I have some Jobs which I first tested them on windows environment where I used the line termination as "DOS style". Here all Jobs executed successfully.
But when I executed the same jobs on UNIX DS server it gave me warning saying "read_fixedwidth() - row 1, too many columns in record". Here when I changed it to UNIX style, it worked and the Job finished without warnings.
Now what is happening is that on UNIX DS Server, some of my jobs are executing successfully with Line termination as UNIX style and some are getiing executed with Line termination as DOS Style.
I do not want this to happen. I want all the source files(used in diffeent jobs) to use the same kind of Line termination and get successfully executed because the O/P files generated by these jobs are used by a common job and I cannot keep changing the Line Termination according to the different source files used in that common job.
I went through the search but couldnt find the solution.
Please can anyone explain as to why is this happening? and what should be done to successfully handle this issue?
Thanks in Advance.
Unix- Dos Style Issue
Moderators: chulett, rschirm, roy
DOS-Line-Termination is CR and LF (CR=Cursor Return CHAR(13), LF=Line Feed CHAR(10).
UNIX-Line-Termination is only LF
Important is to write and read with the same kind of termination. If you mix them up you get an error. (to much colums).
You can use both kinds of termination in both worlds without problems (if staying in DataStage) but you should use the adequate termination in each world for to use the other local tools to read and write without problems.
UNIX-Line-Termination is only LF
Important is to write and read with the same kind of termination. If you mix them up you get an error. (to much colums).
You can use both kinds of termination in both worlds without problems (if staying in DataStage) but you should use the adequate termination in each world for to use the other local tools to read and write without problems.
Wolfgang Hürter
Amsterdam
Amsterdam
Change all the files to OS your sitting on. If it is UNIX then make sure all the files are UNIX format. You can find a bunch of commands to do this. tr, dos2unix, sed etc to name a few. You can search for exact syntax on google.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
CR is carriage return or Cursor Return
WoMaWil wrote:DOS-Line-Termination is CR and LF (CR=Cursor Return CHAR(13), LF=Line Feed CHAR(10).
UNIX-Line-Termination is only LF
Important is to write and read with the same kind of termination. If you mix them up you get an error. (to much colums).
You can use both kinds of termination in both worlds without problems (if staying in DataStage) but you should use the adequate termination in each world for to use the other local tools to read and write without problems.
Just use the type that is appropriate for the file. I don't seen the need to convert everything one way or the other, per se. And it's easy to check.
Open the file in vi. Look at the end of each record. Does it have a "^M" at the end? Yes = DOS file, no = UNIX file. Easy Peasy.
Open the file in vi. Look at the end of each record. Does it have a "^M" at the end? Yes = DOS file, no = UNIX file. Easy Peasy.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use dos2unix from a before-stage or before-job subroutine (ExecSH). If the file was DOS-style it's now UNIX-style. If it was already UNIX-style, it remains so.
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.