DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
This topic has been marked "Resolved."
Author Message
gsbrown



Group memberships:
Premium Members

Joined: 23 Sep 2002
Posts: 120
Location: USA
Points: 1531

Post Posted: Fri Aug 03, 2007 4:11 pm Reply with quote    Back to top    

DataStage® Release: 7x
Job Type: Server
OS: Windows
Additional info: How to create file with \n row terminators and EOF
I'm needing help producing a sequential file that will append a \n at the end of every row (except the last one) and the last row end with an EOF character that is used in Linux.

Is there a painless way to do this? Is there a setting within the sequential file stage that would do this without concatenating the '\n' to the end of my last column in the transform. How would I append the final EOF character after the last row?

Thanks,
Greg
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 38847
Location: Denver, CO
Points: 198341

Post Posted: Fri Aug 03, 2007 4:28 pm Reply with quote    Back to top    

So, build it on a Windows server for eventual consumption by Linux? You shouldn't have to do anything special, just tick the Line Termination option for 'UNIX Style' and then if you don't want one on the last line enable the 'Omit last new-line' option as well. Shouldn't be any more difficult than that, I would think.

_________________
-craig

"Do unto those downstream as you would have those upstream do unto you."
Rate this response:  
Not yet rated
ekempd
Participant



Joined: 27 Jul 2006
Posts: 8
Location: Santiago
Points: 54

Post Posted: Fri Aug 03, 2007 4:34 pm Reply with quote    Back to top    

Do a after job custom routine that open de file and change the last character..
Rate this response:  
Not yet rated
gsbrown



Group memberships:
Premium Members

Joined: 23 Sep 2002
Posts: 120
Location: USA
Points: 1531

Post Posted: Mon Aug 06, 2007 6:38 am Reply with quote    Back to top    

Sorry, I misunderstood our client.

They didn't physically want an ASCII '\n' at the end of every row. I generated the file using the Unix(CR LF) option checked, instead of DOS, and they were able to process the file just fine.

Haven't ever had to think outside the DOS box until now Embarassed

Greg
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 38847
Location: Denver, CO
Points: 198341

Post Posted: Mon Aug 06, 2007 6:46 am Reply with quote    Back to top    

Right, they didn't want the physical characters "slash n" but rather what that stands for - a 'newline'. And it means different things on different systems as you've just found: for UNIX a LF, for DOS a CR/LF pair, etc.

Perhaps a little much, but a Wiki on the subject:

http://en.wikipedia.org/wiki/Newline

_________________
-craig

"Do unto those downstream as you would have those upstream do unto you."
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours