Source extraction returns 0 rows

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
Shamitha_Shetty
Participant
Posts: 4
Joined: Sun Jul 15, 2007 11:59 pm

Source extraction returns 0 rows

Post by Shamitha_Shetty »

When source data is extracted using Teradata Enterprise stage,source volume being more than 400 million records,if the extraction returns 0 rows then processing should stop reporting a critical error .how do we check if the source extraction is empty?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

In a seperate job, perform a count on the table. If you get a zero, do not do anything or send out an email. If its greater than zero then you can run your current job that processes the table. You can couple these jobs and implement the process in a sequence job.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Shamitha_Shetty
Participant
Posts: 4
Joined: Sun Jul 15, 2007 11:59 pm

Post by Shamitha_Shetty »

Taking a count would not be a very efficient way, looking at the volume of the data.Since this kind of scenario is very rare-where the table extraction would be empty-it would happen once in a while.Is there any alternative way to do this?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Add an after-job routine call that gets the row count from the TeraData selection using DSGetLinkInfo(DSJ.ME,{LinkName},DSJ.LINKROWCOUNT) and if it is 0 issue a call to DSLogFatal().
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Select the first row from the table. If it's not there, there are 0 rows.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply