Need help for one scenario

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
manojbh31
Premium Member
Premium Member
Posts: 83
Joined: Thu Jun 21, 2007 6:41 am

Need help for one scenario

Post by manojbh31 »

Hi,

I have one scenario which i need to implement.
Source is feed file which contains one coulmn EmpName and data in this field in around 300 length string. Please find the output in the below eg

Eg: consider the string as abcd2efgh3hijk4................ which is coming from feed file

and the output should be in single column as follows. It should be 1-5 as first record and 5-10 as second records and so on

EmpName

abcd5
efgh3
hijk4

Please let me know how to implement this scenario in DS server jobs
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

In a transform stage make a output column derived from In.Col[1,5]:Char(10):In.Col[6,5]:Char(10):In.Col[11,5] and so on. This adds a <LF> to the output string and when that file is read again it will read in one value per row.
manojbh31
Premium Member
Premium Member
Posts: 83
Joined: Thu Jun 21, 2007 6:41 am

Re: Need help for one scenario

Post by manojbh31 »

Hi,

I am not able to get your answer what u explained. can you please ellobarate please
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Sequential files are split into "records" by using <cr><lf> (windows) or just <lf> (UNIX). By manually adding these characters to a string, you create new records. So in your case if there are 3 columns to split, you would read one record, add char(10) three times and do one write. But when that is read again, it will contain 3 records.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

FAQ posting on this very subject. FYI.
-craig

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