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 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 19 Jul 2006 13:46:45 -0700
Reply-To:   "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Subject:   Re: IN statement with macro
In-Reply-To:   <200607191958.k6JINY7x003274@mailgw.cc.uga.edu>
Content-Type:   text/plain; charset="us-ascii"

You could try something along the lines of

%let text = "2960 2961 2962 ..."; %if %index(&text, %substr(icd_code,1,4)> 0 %then a = 1

but first you need to confirm you really want to apply the macro code to icd_code which is not a macro variable.

Barry Schwarz OS/390 System Programmer M/S 80-JE Phone: 253-773-4221 Fax: 253-773-1257

-----Original Message----- From: Kim Murray [mailto:kim@PMURRAY.COM] Sent: Wednesday, July 19, 2006 12:58 PM To: SAS-L@LISTSERV.UGA.EDU Subject: IN statement with macro

Hello, I'm new to this listserve and apologize for bring the IN statement up while inside a macro expression (AGAIN). What are alternatives to using an IN statement as shown below?

My code is

*Depression codes; %if %substr(icd_code,1,4) IN ('2960', '2961', '2962', '2963', '2964', '2965', '2966', '2967', '2968', '2 980', '3004', '3090', '3091', '6484') %then a = 1;

The error is:

RROR: Required operator not found in expression: %substr(icd_code,1,4) IN ('2960', '2961', '2962', '2963', '2964', '2965', '2966', '2967', '2968', '2980', '3004', '3090', '3091', '6484') ERROR: The macro DXFILES will stop executing.


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