Sequencer Questions

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

Ahimsa
Premium Member
Premium Member
Posts: 78
Joined: Fri Aug 18, 2006 11:05 pm

Sequencer Questions

Post 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.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Re: Sequencer Questions

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Re: Sequencer Questions

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Sequencer Questions

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Ahimsa
Premium Member
Premium Member
Posts: 78
Joined: Fri Aug 18, 2006 11:05 pm

Post 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!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Ahimsa
Premium Member
Premium Member
Posts: 78
Joined: Fri Aug 18, 2006 11:05 pm

Post 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!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
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