DATA Step, Macro, Functions and more

abort behaviour vs. include

Posts: 51

abort behaviour vs. include

Dear forum,

I am facing an issue with DI Studio I cant find any documentation on.

There is 1 job which has a Lookup (missing table->abort) and a post-processing defined, which inserts a row into a "jobstatus" table containing the JOB_RC.

When running the job normally, it aborts when in case the lookup table is missing and executes the post-processing code.

When I run the job via an %include from another job, the lookup table is missing, the job aborts but does NOT run the post-processing code, thus not inserting the JOB_RC into my jobstatus table.

Why is the behaviour different?

Thanks a lot,
Super Contributor
Super Contributor
Posts: 3,176

Re: abort behaviour vs. include

Possibly the ERRORABEND / NOERRORABEND condition may be the cause for different behavior? It would be best to share SAS log output with source code revealed for a proper diagnosis, after you have determined that the SAS behavior is different based on the two instances - check your PROC OPTIONS; settings for differences, possibly.

Scott Barry
SBBWorks, Inc.
Respected Advisor
Posts: 4,736

Re: abort behaviour vs. include

Hi Thomas

"When I run the job via an %include from another job...' Does that mean you deploy the job and then in another job you're having a %include on the deployed job? If so: this wouldn't be the way you should do it in DI. Better use a loop control and embed the first job as inner object.

You have to look at the code/log to see what's going wrong. One reason could be that you use the %include statement within a macro and so all macro vars created by the pre-processing step of the included job outside of a macro are "suddenly" defined inside of a macro - they would become local instead of global (and that's one of many reasons why you should do things the DI way before writing user written code).

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation