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 (August 2010, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 30 Aug 2010 09:30:26 -0500
Reply-To:     Craig Johnson <cjohns38@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Craig Johnson <cjohns38@GMAIL.COM>
Subject:      Conditional Macro - Wildcard Problems
Content-Type: text/plain; charset=windows-1252

I’ve written a macro and I need to use some conditional logic. The macro pulls lists from a table and uses them in a PROC SQL statement. If the statement in question uses the term “Is null” at the beginning of the clause then I need to process it one-way. If it does not include the term “Is null” then I need to process it another way. The conditional logic I’m using is testing to see if it is starts with “IS NULL” or not and then uses some %goto statements to jump around based on the results. Below is a snippet of the macro.

%Put Where variable value for checking: %UPCASE("&wherevar");

%if %upcase("&wherevar") =: 'IS NULL' %then %Goto NullQuery;

%if %upcase("&wherevar") ^=: 'IS NULL' %then %Goto IsNotNullQuery;

The problem I am having is that the wildcard is not working the way I expected it. I expected to use ‘IS NULL’: but that throws errors. I’m sure this is something super simple I’m just completely missing it at the moment. What is the appropriate code to get this to work properly?

Thoughts?


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