I want to check if a dataset exists before I run a datastep that will try to use that dataset. If the dataset does not exist then, I don't want to run my data step as it will cause errors and therefore I may not be able to run my code in an automated environment.
Oh yes, call execute will do the trick (and a lot of other tricks actually, a powerful statement indeed) , but I prefer to avoid it, has the coding gets "messier" and more difficult to maintain.
I understand the use of %INCLUDE, but I'm curious on how would you conditionally execute it without the use of macro coding.
The only way that I think of, would be to always produce a temp file (and include it), with one of the two possible codes, being one empty (if the dataset does not exist) and the other with the desired code to manipulate the existing dataset.
Again, I find the latest a little bit more complex than the macro coding, but then again, all valid solutions.