|
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.
|