Sequential File Output Format

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gsbrown
Premium Member
Premium Member
Posts: 148
Joined: Mon Sep 23, 2002 1:00 pm
Location: USA

Sequential File Output Format

Post by gsbrown »

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
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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

"You can never have too many knives" -- Logan Nine Fingers
ekempd
Participant
Posts: 8
Joined: Thu Jul 27, 2006 7:49 am
Location: Santiago

Post by ekempd »

Do a after job custom routine that open de file and change the last character..
gsbrown
Premium Member
Premium Member
Posts: 148
Joined: Mon Sep 23, 2002 1:00 pm
Location: USA

Post by gsbrown »

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 :oops:

Greg
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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

"You can never have too many knives" -- Logan Nine Fingers
Post Reply