Split a record into multiple basing on a condition

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
bmnaidu
Charter Member
Charter Member
Posts: 16
Joined: Wed Jun 07, 2006 5:49 am

Split a record into multiple basing on a condition

Post by bmnaidu »

I have a raw data file, which contains records. I need to process that file and export to DB.

The process involves adding a corresponding for each record and for this we have to compare a field (say F1) value. If the value of F1 is 1 insert one more record in DB with almost same values as that first record with some values varies and even these values are a part the record in the raw data. So for a record containing F1 value as 1 contains 2 corresponding records (assume A and B) in target DB with minor changes.

Also there are another fields F2 and F3. If F2 is not empty and F3 = 1 then add one record similar to A and another similar to B with only only difference in one field each.

How to solve this.
Thanks and Regards
NAIDU BUDDHA
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If it is fixed to field F1, F2 and F3 then you can use transformer to acheive this.
Add two links for each field check. Add constraints to each link.
For first link check If F1=1, Then do the required transformation in the derivation part. In the second link check for same F1=1 and do the other set of transformation in the derivation part.
Similarly proceed for F2 and F3.
Atlast FUNNEL it up.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Just to clarify, by funnel kumar means to collect it into one file that will be loaded into the DB.
Didnt want the OP to get confused 8)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There may be no need to bring the separate streams together - database servers can support multiple connections. If they are all inserts, for example, with different keys, it doesn't really matter how many "clients" are doing the inserts - up to a certain limit, of course.

This is one way to effect partition parallelism within a server job.

Code: Select all

                       +-------->  Transformer  --->  Database
                       |
SeqFile --->  Transformer  ----->  Transformer  --->  Database
                       |
                       +-------->  Transformer  --->  Database
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