DSSetUserStatus value is not returning properly

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
smishra.ds
Premium Member
Premium Member
Posts: 9
Joined: Wed Apr 23, 2008 12:11 pm
Location: Global

DSSetUserStatus value is not returning properly

Post by smishra.ds »

We are trying to capture the status of job with the help of following routine:-
--------------------------------
$INCLUDE DSINCLUDE JOBCONTROL.H
Call DSSetUserStatus (Arg1)

Ans = Arg1

--------------------------------

If Agr1 has Value as 0 then Success or 100 then Failure.This value we are getting with the

Code: Select all

 
$dsadm/dsjob -run -mode NORMAL -warn 0 -wait -param -userstatus $PROJECTName JobName.$IterationNum
Result=`echo $?`
[/b] Output of this will be used to decide to return the success or failure of the job.

We are calling this server routine at the end of the sequencer, just before exiting it.

Now when i am running a check pointed Sequencer, which has couple of Child sequencers, then in case of failure i am not reseting the master sequencer, so that i can able to start the run from the failed job.

Now even if the Sequencer is getting finished properly incase to re-start, its retruning a value as 0 from the above routine, but user status value is not returning any value or some times it will return a value as 255 from the Command line.

Please let me know whether its going wrong.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, but why are you using UserStatus to "return the success or failure of the job"? Why not just check the job status itself directly? Is this more of a "logical" failure rather than a true abort/warnigs you are checking for? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
smishra.ds
Premium Member
Premium Member
Posts: 9
Joined: Wed Apr 23, 2008 12:11 pm
Location: Global

Reason of using the user status, to determine succ or fail

Post by smishra.ds »

Hi Chulett,

The return code will be zero only when the sequencer will have finished without warnings. We are using this return value to store in a Table, which is getting used by other Java code for further buisness logic execution.

This logic is in place from long time in my application, but for the new enhancement i have used the restartebility with the check pointed option in sequencer. And i am facing this issue in case of re-starting the job from the failed point.

In case of re-starting, even if the Datastage Sequencer finished properly, the Userstatus output from the command line is not returning the correct value.
Can you please explain how this -userstatus will work?
Means whether it will write these values in a log file?
or where it is getting stored?
As during the first run, it has already a value other than Zero, the next time it will be called can it overwrite, where it has written before?
Incase of re-starting, the log will captured with the old log itself, as i am finding the Event Number is getting incremented with every run.

Any help or input will be highly appreciated.
Thanks.
smishra.ds
Premium Member
Premium Member
Posts: 9
Joined: Wed Apr 23, 2008 12:11 pm
Location: Global

Post by smishra.ds »

The main reason of using was, it was implemented from start like this, and just want to keep the uniformity in handling all the Datastage jobs. Or in other words, i cann't force this change for one single module.

Just want to confirm what you are saying about -jobstatus, is it something related to DSGetJobInfo routine?
How it can help in me in my current scenario?

If i am setting -jobstatus, then i have define for the different options we have under this category. like, running, reset, ran with no warning etc...

Please correct me if i am going wrong according to your suggestion.

I think the point you have mentioned in the First Reply, that it seems like a logical check, i think we are doing the same.

Thanks a lot for your time Chullet.

Please let me know, from where i can learn more about the Job control, Log file creation/over write and similar details.
Post Reply