Sequential file

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Ush
Participant
Posts: 55
Joined: Tue Dec 04, 2007 3:15 am

Sequential file

Post by Ush »

Hi,

I have a file with following data:

Col1 col2
132Asha,12
133Nimi,13


in the above 132 is empno of width 3.Rest are Empname.
in the destination file it should go as
col1 col2 col3
132 Asha 12
133 Nimi 13
Please let me know if we have options to get the above requirement.
In other tools we have options like first column fixed width.Rest variable length with comma delimiter.

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

Post by chulett »

If your Empno is a fixed width, why not read your file with comma delimiters and then split your first field? Substring out the first three characters, the rest goes to Empname.
-craig

"You can never have too many knives" -- Logan Nine Fingers
MOHAMMAD.ISSAQ
Participant
Posts: 78
Joined: Fri Mar 02, 2007 4:54 am
Location: CHENNAI

Post by MOHAMMAD.ISSAQ »

You can do like this:-

Output.Col1=Input.Col1[1,3]
Output.Col2=Input.Col1[4,len(Col1)]
Output.Col3=Input.Col2[/quote][/list]
MOHAMMAD.ISSAQ
Participant
Posts: 78
Joined: Fri Mar 02, 2007 4:54 am
Location: CHENNAI

Post by MOHAMMAD.ISSAQ »

Sorry the previous reply had some junk characters.

You can do like this:-

Output.Col1=Input.Col1[1,3]
Output.Col2=Input.Col1[4,len(Col1)]
Output.Col3=Input.Col2
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So just edit it, no need to post again.
-craig

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