In DIS, could we execution some jobs or some steps within a job conditionally?

Reply
Contributor
Posts: 21

In DIS, could we execution some jobs or some steps within a job conditionally?


For example, if the SAS data set is empty, then it skips the fast load to Teradata table.

Thanks in advance!

Respected Advisor
Posts: 4,173

Re: In DIS, could we execution some jobs or some steps within a job conditionally?

Posted in reply to ASASProgrammer

Conditional execution of jobs is normally done via scheduler. LSF for example allows for such conditional job execution.

You have always the option to wrap a job into a macro using job pre- and post-code.

In the pre-code section you have then something like "%macro MyMacro; %if <expression> %then %do;", and in the post-code you have something like "%end; %mend; %MyMacro;"

You can do the same in the pre- and post-code of any node as well. If you want several nodes wrapped into such a macro then I probably would use separate user written code nodes to define the macro for clarity. But you could also just use the pre-code of the first node and the post-code of the last node to set this up.

Not sure what happens if you feed an empty table to the teradata table loader. I would assume if the table is empty then no loading happens so may be you even don't have to care about conditional processing (but of course if it's a replace load then the target table would still get truncated).

Ask a Question
Discussion stats
  • 1 reply
  • 148 views
  • 0 likes
  • 2 in conversation