Basic command to capture if insertion is sucessful

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
suma
Participant
Posts: 32
Joined: Fri Jun 11, 2004 8:18 am

Basic command to capture if insertion is sucessful

Post by suma »

What is the Basic command that will capture if a row is inserted sucessfully or not.
In my case whenever i find any new data i have to insert into my target at the same time i have to run three jobs simultaneously.

I have writtern a routine that is used to run the Job. But i want to run the job only if the insertion is sucessful.Do we have any commands that captures how many rows are inserted sucesssfully.

SumA
davidnemirovsky
Participant
Posts: 85
Joined: Fri Jun 04, 2004 2:30 am
Location: Melbourne, Australia
Contact:

Post by davidnemirovsky »

Datastage has the capacity to accomplish your desired result but you have to take a different approach.

Any database statement if successful will not return anything in the LOG otherwise the log would always be full of 'successful entries'. On the other hand, if a statement has not successfully completed (ie Database error) there will of course be a WARNING in the log for that job.

Your process needs to read the log of a certain job and check for any warnings. If there are INSERT warnings they will appear in the job log and you can use this to control the execution of the subsequent jobs.

You can also grab the log entry that specifies how many rows were written.

There are a few ways to retrieve JOB INFO (hint! :lol: ) and the log may not be the most effiecient way. You might want to run an After Job Subroutine ExecTCL statement that might pipe rows written into a flat file.
Cheers,
Dave Nemirovsky
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
in a transformer you can put a reject link or thest the REJECTED variable or test for the RDBMS return code in some cases.

a search will pop up all the info you need it was covered before.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply