Removing Embedded Carriage Returns
Moderators: chulett, rschirm, roy
Removing Embedded Carriage Returns
DS Gurus,
I am having trouble formatting a sequential file that seems to be scattered with embedded Carriage Returns within the file.
I am reading from source (SQL Server) via ODBC and transferring a column (Varchar 1000) into a sequential file to be loaded into a Mainframe table.
There are some records with 'carrriage returns' that is causing the grief. I would like to REMOVE the carriage returns without affecting the structure of the file (ie - I tried to remove ^M manually - via Unix vi), but it affects the structure of the seq file.
I am creating a fixed width file with Unix delimiter.
Help is appreciated.
I am having trouble formatting a sequential file that seems to be scattered with embedded Carriage Returns within the file.
I am reading from source (SQL Server) via ODBC and transferring a column (Varchar 1000) into a sequential file to be loaded into a Mainframe table.
There are some records with 'carrriage returns' that is causing the grief. I would like to REMOVE the carriage returns without affecting the structure of the file (ie - I tried to remove ^M manually - via Unix vi), but it affects the structure of the seq file.
I am creating a fixed width file with Unix delimiter.
Help is appreciated.
In your DataStage job use "CONVERT(Char(13),'',In.StringColumn)" to remove internal Control-M characters.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
Hi All,
I have the same problem, I used to create the sequential file form the DB2 database, But some times when i create the file it is created with CR/LF, SO when i try to read the file, The datastage job is aborted.
I have to check the entire file before i read it, Is there any option to check the entire file in datastage to find the carriage reture.
Your help is highly appriciated.
Thanks and Regards
N.Magesh
I have the same problem, I used to create the sequential file form the DB2 database, But some times when i create the file it is created with CR/LF, SO when i try to read the file, The datastage job is aborted.
I have to check the entire file before i read it, Is there any option to check the entire file in datastage to find the carriage reture.
Your help is highly appriciated.
Thanks and Regards
N.Magesh
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
Hi All,
I have the same problem, I used to create the sequential file form the DB2 database, But some times when i create the file it is created with CR/LF, SO when i try to read the file, The datastage job is aborted.
I have to check the entire file before i read it, Is there any option to check the entire file in datastage to find the carriage reture.
Your help is highly appriciated.
Thanks and Regards
N.Magesh
I have the same problem, I used to create the sequential file form the DB2 database, But some times when i create the file it is created with CR/LF, SO when i try to read the file, The datastage job is aborted.
I have to check the entire file before i read it, Is there any option to check the entire file in datastage to find the carriage reture.
Your help is highly appriciated.
Thanks and Regards
N.Magesh
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 86
- Joined: Mon Nov 27, 2006 3:42 am
- Location: Wilmington
Try and google the keywords "tr command remove carriage return", that will answer your scripting questions.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That comes under the heading of "consulting" which is how I make my living. Contact me off line if you wish to engage me professionally.Magesh_bala wrote:Can you please help me in writing the script?
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.