LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 7 Jul 2005 10:46:43 -0700
Reply-To:   Rob_W <weyrauch_r@YAHOO.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Rob_W <weyrauch_r@YAHOO.COM>
Organization:   http://groups.google.com
Subject:   Re: Passing a dynamic variable to a macro
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset="iso-8859-1"

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 macro 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 customer support!

Rob


Back to: Top of message | Previous page | Main SAS-L page