dsxdev wrote:When ever you run the dsjob command it only echos the job status not job return code.
Not really, the behaviour depends on the command line options you choose. Assuming you are wanting to wait for the job to actually finish before moving on to the next step in your script, it works one of two ways:
Code: Select all
-wait Returns a 0 or non-zero code
-jobstatus Returns the DataStage Job Status code (1,2,3,etc)
So, there's no need to poll the job after it finishes to check the 'job status'.
I also seem to recall that the
-wait option always returns a zero if the job was started (i.e. 'run')
regardless of the outcome of that run. In other words, an aborted job would report back a zero code as it was able to start. Non-zero codes would be returned when a job name cannot be found or the job cannot otherwise be started.
We use
-jobstatus exclusively. I'd need to run some tests to validate the operation of the -wait option.