create multiple records from a single record.

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
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

create multiple records from a single record.

Post by sylvan_rydes »

Hi All,

This is a simple question and I need to figure out the best way. I have input records. For each record I need to process it using almost 20 different kind of procedures. Then need to produce output have sequential number 1 to 20. and same for the next one. So for hundred input records I will get 2000 records having rownum 1 to 2000.

So my question is to know the best way to do it without using any stored procedure and in a single transformer.

Thanks in advance.

Sylvan
sylvan rydes
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Look into the link collector. Have twenty links coming out of the transformer and collect them with the link collector. This way you will have 20 copies of a single record.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

Hi Chuk,

I know that is possible. Even without using link collector we can directly connect it to output stage. But for 20 output links the job becomes a kinda massy. Is there anyway to do it without having 20 output links.

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

Post by ray.wurlod »

The best solution will have 20 output links. Resize the stage icons so that it doesn't look so messy. Depending on the target, you may not even need a Link Collector; there's no reason that you can't have twenty links feeding independent inserts into a database table. Or even into twenty separate text files, which can be combined subsequently more efficiently than the Link Collector can accomplish.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

yes, you can write a small routine that reads in a record, duplicates it 20 times and cats it together with a LF in between to split it up. Something like

Code: Select all

ToDup=trimB(Arg1)
For n = 1 To 20
Ans=:ToDup:char(010):char(013)
Next n
You can enhance it to fit your requirement. But the basic functionality will be the same.
Regards,
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

Hi All,

Thanks a lot and I appreciate your response.

Sylvan
sylvan rydes
Post Reply