BookmarkSubscribeRSS Feed
kjarvis
Fluorite | Level 6

Hello - we want to develop code that would force the job to exit based on a certain value in a table.

 

Basically this is for a validation check - if the count in a table is zero, the job should finish successfully. If the count is > zero - then the job should error out and stop processing. 

 

If there a way to force a job to stop based on this logic? Thank you!

1 REPLY 1
LinusH
Tourmaline | Level 20

In Status Handling for jobs and transformations there are some default conditions and actions where you could do such things.

Unfortenately there is no default condtion of a certain table has zero rows,

So depending on what leads up to you having zero rows, you might be able to use a condition of Data Modified?

 

Otherwise you could code this fairly easy, perhaps write a macro that check no of obs given your table of interest, and then force the SAS job to quit using ABORT ABEND. Insert the macro either as a post processing for the transformation or the job. Or you could bundle it into a User Writter Transformation to make it visible in the job canvas. 

Data never sleeps

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1290 views
  • 1 like
  • 2 in conversation