DSEXECUTE Help in after job subroutine

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
jpr196
Participant
Posts: 65
Joined: Tue Sep 26, 2006 1:49 pm
Location: Virginia

DSEXECUTE Help in after job subroutine

Post by jpr196 »

Hi,

We've created a routine that runs as an after-job subroutine in which DSExecute is utilized to launch a unix script with some sql in it.

The program works fine. However, we're trying to build in error messages, so that let's say the SQL didn't execute for whatever reason (database down, etc.) then an error message will be passed to the Ascential Log files.

At first, I thought I could use DSExecute's SysRet, but it appears to return 0 as long as the command is launched...regardless of what happens from there.

Anyone have any suggestions as to how to pass an error message to the Ascential logs?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What database? Your script needs to farm any problems from whatever logs or session capturing you might be able to do. You can then echo those to std out and set an appropriate exit status so DataStage will notice.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jpr196
Participant
Posts: 65
Joined: Tue Sep 26, 2006 1:49 pm
Location: Virginia

Post by jpr196 »

Thanks for the response. We're on DB2. I think I have something that will work using Exit 0 and 1 based on conditions for logging an error.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I've had success redirecting sqlplus output to a temp file and grepping the file afterwards for ORA errors. If found they can be echo'd and the exit status set appropriately.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply