Sequencer Parameter Looping

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
n.parameswara.reddy@accen
Participant
Posts: 40
Joined: Mon May 18, 2009 5:22 am

Sequencer Parameter Looping

Post by n.parameswara.reddy@accen »

Below is the scenario which i want to achieve by means of the Sequencer.
Sequencer calls the job that basically extracts the data from the table from certain period of time. For example, when the job is run for the first time given a parameter of start date (eg., 2005/01/01) till current date.(ie.,2009/11/16).
Today when am running the sequence,it should be
i.e,
Parameter Values :
#pStart# : '2005/01/01' ; #pEnd# : Current Date (2009/11/16)
select * from TblA where Date>=#pStart# and Date<=#pEnd#

When am running a month later (i.e. 2009/12/16), it should take the start date as the previous run's Current date and End date as the day's CurrentDate automatically.
i.e,
#pStart# : '2009/11/16'; #pEnd# : Current Date (2009/12/16)
select * from TblA where Date>=#pStart# and Date<=#pEnd#

and goes like that for subsequent runs.
Can anyone suggest a solution for this which can continue the load with just the beginning start Date.('2005/01/01' in this case)

I can do this my writing the value(CurrentDate) to sequencial file for each run and take the value from the file for the correspoding run.

Appreciate other options for achieving the same.
Thank you. :D
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It might be best to store this last-run-date in your database as opposed to a sequential file, that depends on whether or not other processes need to know the last run date.
n.parameswara.reddy@accen
Participant
Posts: 40
Joined: Mon May 18, 2009 5:22 am

Post by n.parameswara.reddy@accen »

ArndW wrote:It might be best to store this last-run-date in your database as opposed to a sequential file, that depends on whether or not other processes need to know the last run date. ...
Thank ArndW.
Even i felt the same for it would be better if the Last Run date was stored in a table.The Problem is the Last Run date is no where captured in the Table :roll: , also not other processes need to know this last run date.

The workaround that i have done, used sequential file for fetching the last run date. I am just thinking there could be some option that would help in achieving this avoiding the creation of the file in some temp location which is just not used for any other purpose as such.

Any other suggestions would be helpful.
thank you. :)
Post Reply