How to check if a DataSet is null

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
sconner
Participant
Posts: 1
Joined: Wed Jul 14, 2004 11:49 am
Location: dallas, texas

How to check if a DataSet is null

Post by sconner »

Hi,

Is there a way in DataStage wherein we can check if the dataset is null or not?

cheers,
sconner
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not sure what you mean by null here. Remember that a data set is something constructed by DataStage. Therefore, if it's been loaded with zero rows; you can get at best zero rows out of it. This is not an error condition (for a silly example your data set may have been populated with the records of all employees whose date of birth is in the future). Your job will process zero rows; this condition can be detected in a number of ways, such as inspecting the log entries or using the job interrogation functions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
lcduddridge
Participant
Posts: 8
Joined: Tue Nov 16, 2004 12:34 pm

Re: How to check if a DataSet is null

Post by lcduddridge »

You can use DSJob routine that can check the total records from the file using "dsrecords" command from the unix prompt. You should write general routine which calls unix commands.


sconner wrote:Hi,

Is there a way in DataStage wherein we can check if the dataset is null or not?

cheers,
sconner
Post Reply