Date: Tue, 23 Oct 2007 15:46:25 -0500
Reply-To: Mary <firstname.lastname@example.org>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mary <mlhoward@AVALON.NET>
Subject: Re: Using the Colon Modifier to Check "Doesn't Start With..."
Content-Type: text/plain; charset="iso-8859-1"
How about using the Like statement in Proc SQL instead?
informat visittype $20.;
input visittype $;
create table newset1 as
select * from set1
where visittype not like '045%';
proc print data=newset1;
----- Original Message -----
From: Jack Clark
Sent: Tuesday, October 23, 2007 3:01 PM
Subject: Using the Colon Modifier to Check "Doesn't Start With..."
I feel a little greedy lately, as I have been asking more questions here
than trying to answer, but here goes...
I have a dataset with a 6-character field called Revenue Code (REVCODE).
If REVCODE starts with '045', it is considered and Emergency Room Visit.
In the past I have had a need to pull all observations of Emergency Room
Visits and have successfully used the following syntax...
set have (where=(revcode=:'045'));
Now, I need to do the opposite, pull all observations that are not
Emergency Room Visits and I planned to use the same (but opposite)
approach. Can someone tell me why the following code does not work?
input revcode $;
set test (where=(not revcode=:'045'));
112 data test2;
113 set test (where=(not revcode=:'045'));
ERROR: Where clause operator requires compatible variables.
This is what I settled on for an alternate. Any comments or suggestions
set test (where=((revcode=:'045')=0));
Center for Health Program Development and Management
University of Maryland, Baltimore County