Return Code from Wrapped Parallel Stage

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
banactp
Participant
Posts: 52
Joined: Tue Feb 22, 2005 2:55 pm

Return Code from Wrapped Parallel Stage

Post by banactp »

Hello,

Can anyone please tell me if it is possible to get a return code back from a wrapped UNIX command?

Consider the example stage from the Parallel Job Advanced Developer's Guide. This stage is a wrapper around the sort command. Sort returns either 0, 1, or a larger positive value (indicating an error). How can I get access to this value in DataStage so that I can be aware of and handle any error that occured?

The documentation did not seem to indicate if this is possible. I suppose I could customize my code so that a return code is sent to stdout or stderr and then map the stream to an output link - but is there a better solution?

TIA,

tpb
banactp
Participant
Posts: 52
Joined: Tue Feb 22, 2005 2:55 pm

Post by banactp »

Figued this one out.

Well, sort of. There are fields on the "Environment" tab that allow you to specify how different return codes are handled. It appears that the return code must be of integer type.

However, I still can't figure out how to differentiate behavior for various error codes - i.e. if return = 1, take this action, if return = 2, take this action, etc.

Any suggestions?
Post Reply