Record duplicate

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
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Record duplicate

Post by mouthou »

Hello everyone,

Is there an option in a job to duplicate the records from the source file. I need to create 3 duplicated records from a single record. Any help would be appreciated.

Version: Server
Os: Windows

Thanks,
asitagrawal
Premium Member
Premium Member
Posts: 273
Joined: Wed Oct 18, 2006 12:20 pm
Location: Porto

Re: Record duplicate

Post by asitagrawal »

How many fields are there in the input ?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

3 output links from a Transformer going into a Link Collector/Hashed file/3 separate Sequential files/etc.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Post by mouthou »

[quote="kcbland"]3 output links from a Transformer going into a Link Collector/Hashed file/3 separate Sequential files/etc. ...[/quote]

Is there a better option than having 3 sequential files. I need to have all those 3 records in a single sequential file.
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Re: Record duplicate

Post by mouthou »

[quote="asitagrawal"]How many fields are there in the input ?[/quote]

I have 18 fields. Are you talking about @VM?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Code: Select all

                    ---->
your source --->xfm ----> LinkCollector ---->Single Target.
                    ---->
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
mouthou
Participant
Posts: 208
Joined: Sun Jul 04, 2004 11:57 pm

Post by mouthou »

Thanks. It worked. I didnt realise that there is a link collector in Server edition. It is same as what kcbland suggested.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I just gave a visual view of Ken's suggestion :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
urshit_1983
Participant
Posts: 73
Joined: Wed Jun 28, 2006 3:27 pm
Location: NJ

Post by urshit_1983 »

Another soln
you can write a before job subroutine script :

{ rm -f infile && awk '{ for (i=0;i<3; i++) { print $0 } }' > infile; } < infile
"Nobody is expert in Everything,
But Everybody is expert in Something."
Post Reply