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

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 1183 views
  • 1 like
  • 2 in conversation