Inserting records based on gaps

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
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

Inserting records based on gaps

Post by vamsi_4a6 »

if there is any gap i have to create one extra record in output with price as previous one and output is mentioned as below.For understanding purpose i gave one product but we have so many products

source and target is sequential
input
Prd prc effecdate enddate
1 10 1-jan-2010 1-mar-2010
1 15 1-jun-2010 1-Jan-9999

output
Prd prc effecdate enddate
1 10 1-jan-2010 1-mar-2010
1 10 2-mar-2010 30-Jan-2010
1 15 1-jun-2010 1-Jan-9999


I am not sure how to proceed and anybody help on this
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Pretty much what you've shown us in your one record example. Use a Transformer stage that remembers the previous row and thereby detects any gap, from which it can build the gap-filling record.

It may be easiest to send this gap-filling record onto a separate output link from the Transformer stage, and use a Funnel stage to re-unite the streams subsequently.
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