SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

How to add a SAS DI Condition that checks number of records in source table (if 0 then stop)

Reply
User
Posts: 1

How to add a SAS DI Condition that checks number of records in source table (if 0 then stop)

Hi there,

 

Since I'm a newbie not sure if I selected the right location, but let's give it a try.

I am desperately looking for some help regarding the use of conditions in a DIS job.

The DIS job is simple:   source table --> extract --> table loader --> target table

 

What I would like to achieve is to run the job only when the source table has record (hence record count > 0).

Else stop the process.

 

What steps to take?

Where do I put the start and end condition in the control flow?

 

Thanks for your help!

Highlighted
Super User
Posts: 5,829

Re: How to add a SAS DI Condition that checks number of records in source table (if 0 then stop)

If the source have no records, I can't really see the benefit of aborting the job prematurely since the following steps shouldn't require any resource with no observations.

Nevertheless, I don't think that there's an out of the box functionality. One of many ways to handle would be to either write user written code to analyse the source table, or insert code to the post process of the extract transformation to check the result set (remember to create table - not view). Check the result and and issue the appropriate abort/abend/endsas statement.

 

There is a Condition Start/End transformations, but I think they are a bit over the top to use here, I think they make sense if wish to avoid part of the job, not if you wish to terminate immediately.

Data never sleeps
Ask a Question
Discussion stats
  • 1 reply
  • 183 views
  • 0 likes
  • 2 in conversation