Page 1 of 2

Sequencer Questions

Posted: Fri Dec 15, 2006 9:04 pm
by Ahimsa
My Sequencer is having 4 jobs and each job is having parameter with Value = $UserStatus of earlier job. Now, e.g sequencer is aborted while procesing job# 3,

1. on restart of the sequencer, from which job# it will start?

2. Will it have value of $UserStatus from earlier job. I mean to say will job Parameters have Proper values of $UserStatus if the sequencer restarts in between.

3. Is it possible to set $UserStatus of job#2 inside job#4 or in sequencer.
I know how to set the user status of a job by using simple one line routine but not sure if there is way to set a other job's user status by sending job name or something like that.

Thanks in advance for all the answers. Your answers makes a difference !

Thanks.

Re: Sequencer Questions

Posted: Fri Dec 15, 2006 9:51 pm
by DSguru2B
My Sequencer is having 4 jobs and each job is having parameter with Value = $UserStatus of earlier job. Now, e.g sequencer is aborted while procesing job# 3,

1. on restart of the sequencer, from which job# it will start?
From the failed job if you made your sequence job restartable, otherwise from the first job.

2. Will it have value of $UserStatus from earlier job. I mean to say will job Parameters have Proper values of $UserStatus if the sequencer restarts in between.
You will have the UserStatus from the earlier job.

3. Is it possible to set $UserStatus of job#2 inside job#4 or in sequencer.
I know how to set the user status of a job by using simple one line routine but not sure if there is way to set a other job's user status by sending job name or something like that.
UserStatus is not jobspecific. You can set a UserStatus in one job and then retrieve that in any job.

Thanks in advance for all the answers. Your answers makes a difference !

Thanks.

Re: Sequencer Questions

Posted: Fri Dec 15, 2006 10:34 pm
by thebird
Ahimsa wrote:My Sequencer is having 4 jobs ....
Sequence, my friend... Its a job Sequence.

Dont confuse it with a Sequencer. Sequencer is an activity available within a DataStage Job Sequence, just like the Job activity and Routine activity.

Aneesh

Re: Sequencer Questions

Posted: Sat Dec 16, 2006 1:51 am
by chulett
DSguru2B wrote:3. Is it possible to set $UserStatus of job#2 inside job#4 or in sequencer.
I know how to set the user status of a job by using simple one line routine but not sure if there is way to set a other job's user status by sending job name or something like that.
UserStatus is not jobspecific. You can set a UserStatus in one job and then retrieve that in any job.
UserStatus is very much so job specific as each job has their own discrete area for this. And no, you cannot set a job's UserStatus externally, i.e. from another job.

Posted: Sat Dec 16, 2006 2:11 am
by DSguru2B
Really. I was under the impression that you have four variables (UserStatus) which you can set and were job independent. I never used User Status and hence my in-experience. Thanks for the clarification Craig. Sorry Ahimsa for the wrong info. :oops:

Posted: Sat Dec 16, 2006 4:51 pm
by ray.wurlod
You're both right. User status IS job-specific. What you retrieve is qualified with the job activity name (e.g. JobActivityName.$UserStatus) so that there is no ambiguity.

If you always want the user status of job #1 even on a restart, that's OK. The user status is persistent, and can be retrieved after the job has completed. (It's actually stored in the RT_STATUSnnn table for that job.)

Posted: Sat Dec 16, 2006 5:49 pm
by DSguru2B
So user status is job specific but still user status set by job x can be retrieved in job y. Great, thanks Ray.

Posted: Sat Dec 16, 2006 8:20 pm
by chulett
Of course... I didn't mention any issue with the statements about any job being able to retrieve it, just the 'not job specific' part. :P

Also understand that UserStatus isn't always available. If a job aborts and is reset, the User Status that may have been there is no longer accessable until it runs to completion again. Same for a newly promoted job or any other just-been-recompiled job. They must run again and end normally for their User Status area to be accessable. FYI.

Posted: Sun Dec 17, 2006 5:11 am
by kumar_s
Is it possible to set $UserStatus of job#2 inside job#4 or in sequencer.
Its not possible. But you can set Userstatus of Job 2 in Job2 and access it in Job4. Unless you have a Sequencer in between Job2 and Job4.

Posted: Sun Dec 17, 2006 8:33 am
by chulett
kumar_s wrote:Its not possible. But you can set Userstatus of Job 2 in Job2 and access it in Job4.
Already been answered, twice before this I think. :wink:
kumar_s also wrote:Unless you have a Sequencer in between Job2 and Job4.
Hmm.. not true. Well, except in one particular version from what I recall, and that was a bug that was since corrected.

Posted: Sun Dec 17, 2006 9:52 am
by Ahimsa
Thanks a lot everyone for sharing your valuable experience.

So as there is NO way to set JobName.$UserStatus of jobA from jobB, what would be the way to do following -
I have job sequence like this

1. JobA whouse UserStatus is set to 1
2 then numeric Loop whose start value is a JobA.$UserStatus
Now, when the job sequence is failed in loop interation = 4, on restart of the job sequence I would like to start the loop from 4 instead of 1.

Would aprreciate your inputs. thanks!

Posted: Sun Dec 17, 2006 11:15 am
by chulett
Curious if you've tested what happens when a checkpointed Sequence job with Loop stages fails and you restart it? I have, but only in a situation where the loop count wasn't really relevant - it did skip around and restart from the correct stage inside the loop. However, since my loop was controlled by a counter starting from 1 each time, that's where it restarted... but then it also failed during Interation 1. :P

In other words, someone would need to build specific test scenarios for all this to really exercise things. And I wouldn't do it with your 'real' job but would build something simple specifically for these tests.

For your case, though, I'd suggest something other than UserStatus to control things. Perhaps something simple like a value in a flat file? Outside the loop in JobA write a value (like "1") to a flat file. Pick up that value (a 'cat' could do that) perhaps in a User Variables stage and use that to control your loop. Inside each loop, a routine call could write the current loop number back to that same file so it stays current. Then on failure, a checkpointed run would skip running JobA and pick up the 'current' value of the loop to start from when it rereads that file.

Something like that, anyway... that's all off the top of my head.

Posted: Sun Dec 17, 2006 1:06 pm
by DSguru2B
I agree. Thats why i never use UserStatus. I like things being physically written to the disk. Especially if its controlling the process.

Posted: Sun Dec 17, 2006 2:36 pm
by Ahimsa
Chulett, thanks for your response.
Actually, I am exactly doing the same logic i.e. updating the counter value in a file. But I a am not sure how to send this file value as loop start value because in the loop start parameter when you click on on those ...only options I saw is to use JobName.$UserStatus that's why I was thinking of storing these in UserStatus. Any ideas how to send this File value as start for loop?
Thank you very much!

Posted: Sun Dec 17, 2006 2:39 pm
by ray.wurlod
DSguru2B wrote:I agree. Thats why i never use UserStatus. I like things being physically written to the disk. Especially if its controlling the process.
As noted, user status IS written to disk. That's why it's accessible long after the job finishes. It's stored in the RT_STATUSnnn table for the job.