Toby and Shilin:
Thank you for your input. Using Toby's modifications I was able to get
the results I needed. A couple of points to make sure I
understand...please correct me if I am wrong.
1. call execute('%FindOrCreateFile('||SasDsDir||')');
This forced the variable SasDsDir to resolve the the text string it
represented before being passed as a parameter to the macro
%FindOrCreateFile. This along with removing the quotes fixed the
problem in the log of the x command ( "md "SasDsDir ).
2. The addition of % before the keywords if, then, else, do, end in the
From your comments Toby, it sounds like the % forces the logic (if,
then, else) to be processed when the macro is called. Without the %,
the statements (if, then, else) would have been processed even before
the macro was called? If so, my misunderstanding was that no code in a
macro would execute before the macro itself was called.
3. Shilin's warning that "x command will execute anyway"
I think this may be linked to my using "if" not "%if" in my macro,
resulting in the problems described in point #2 above. Once I made the
changes listed by Toby, I ran it with both NOXWAIT and XWAIT options,
to make sure that the x command only executed as intended. The results
were correct. The x command only executed when the conditions in the
%if, %else statements were met.
Thanks again for your help. SI should have you on the payroll for