passing a value in parameter

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
pukars4u
Participant
Posts: 24
Joined: Tue Dec 27, 2005 6:27 pm

passing a value in parameter

Post by pukars4u »

hai I would like to pass a value in JOblevel how can i do that

Let me explain

I have a parameter in joblevel as SEQ_NO i put this as a default value of 1

When i run a job it inserted 20 records with the seq_no as 20

Now when I run the job again my seq_no in parameter is still 1 .It should become(default value) 21 in the next run How should i send this value into the parameter in joblevel

This will help me
Thanks
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

You need to store your sequence number somewhere when the job finishes and then the next time the job runs it knows where to get the sequence value. Consider using job control to feed it to the job, or use a stage variable and in the initialize cell do a routine call to go fetch the starting value.
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
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

1)If you are running the jobs from a sequencer, you can set a job parameter at the sequencer level. At the end of a run, you can update
the job parameter right before the job finishes. Kenneth, is this true?

2)Create a data set file on your disk. Every time, your job runs, it'll read it from that file right after starting. Right before the job ends, it'll write the final value to that file.

Kenneth, are there other ways?
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

You can't really update a job parameter at the end of a job.

As Kenneth said you can store the value somewhere - a file (probably not a dataset) or in the database.

At the start of the job sequence you obtain this value and pass it in the job parameter.

At the end of the job you store the new value ready to be used next time the job runs. You can derive the new value in a few ways - 1) old value plus number of rows processed, but be sure the numbers used are contiguous as spreading across partitions may have left gaps and therefore the total may be wrong, or b) get the maximum value actually used.
Post Reply