Tab delimated file pattern read

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
smohd1338
Premium Member
Premium Member
Posts: 28
Joined: Fri Aug 03, 2012 1:09 pm

Tab delimated file pattern read

Post by smohd1338 »

I have 3 differetn files with same format, they have , FH,BH,DL,SA,CC,BT,FT records, i have to pass them to seven different files which have only taht record along with their filenames, in transformer what condition should i put in order to make the records go into only those respective link, if it were fixed width i would give link.recordtype[1,2]=FH then go this link, but this is tab delimated, in this case how do i do that, any ideas
sameer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Really, you'd do basically the exact same thing. However, I would guess you'd just need to check the first field rather than substring anything but that will depend on how you have defined the file metadata.

Also... periods are your friend. Don't be afraid to use them. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chillblue
Premium Member
Premium Member
Posts: 13
Joined: Mon Sep 19, 2011 11:58 pm
Location: Michigan

Post by chillblue »

Hi ,


In Transformer Stage ... use INDEX() function as constraint for the link.

Look for the specific values in the stream and divert the data to corresponding output.


Hope this helps.
Thanks
Chillblue
smohd1338
Premium Member
Premium Member
Posts: 28
Joined: Fri Aug 03, 2012 1:09 pm

Post by smohd1338 »

what are periods and how can i use them, ?
sameer
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

smohd1338 wrote:what are periods and how can i use them, ?
Image
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, just meant as in 'at the end of a sentence'. Was just trying to point out that your first post is one long run-on statement.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chillblue
Premium Member
Premium Member
Posts: 13
Joined: Mon Sep 19, 2011 11:58 pm
Location: Michigan

Post by chillblue »

The Syntax is Index (string, substring, instance)



Make n number of links out to transformer.

In each link add a constraint which you need to check.

link 1:- INDEX(COLUMN,'FH',1) <> 0
link 2:- INDEX(COLUMN,'BH',1) <> 0
link 3:- INDEX(COLUMN,'DL',1) <> 0
same way for all the data......

Hope this solves your problem.
Thanks
Chillblue
smohd1338
Premium Member
Premium Member
Posts: 28
Joined: Fri Aug 03, 2012 1:09 pm

Post by smohd1338 »

tahnks all, i used Field instead
sameer
Post Reply