How to insert unix new line in between the single records?

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
say2prabhu1
Participant
Posts: 27
Joined: Mon Jul 09, 2007 1:06 am

How to insert unix new line in between the single records?

Post by say2prabhu1 »

Each record having length of 1800.. While I am loading into the file ,I need to split these records into three.. Basically I need to insert unix new line after 600 length.. the second and third records 600 column defintion(column length) is different..

How can i load the single record into three rows in the final file?

Advanced Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Run the UNIX command split over the file. Or, instead of outputting one 1800-character string, output an 1802-character string with two Char(10) characters inserted.

Code: Select all

Left(InLink.TheString,600) : Char(10) : InLink.TheString[601,600] : Char(10) : Right(InLink.TheString,600)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply