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 (October 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 23 Oct 2007 15:46:25 -0500
Reply-To:     Mary <mlhoward@avalon.net>
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..."
Comments: To: Jack Clark <JClark@CHPDM.UMBC.EDU>
Content-Type: text/plain; charset="iso-8859-1"

Hi, Jack,

How about using the Like statement in Proc SQL instead?

-Mary

data set1;

informat visittype $20.;

input visittype $;

cards;

045000

020000

045111

;

proc sql;

create table newset1 as

select * from set1

where visittype not like '045%';

quit;

run;

proc print data=newset1;

run;

----- Original Message ----- From: Jack Clark To: SAS-L@LISTSERV.UGA.EDU Sent: Tuesday, October 23, 2007 3:01 PM Subject: Using the Colon Modifier to Check "Doesn't Start With..."

Hello everyone,

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

data need;

set have (where=(revcode=:'045'));

run;

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?

data test;

input revcode $;

cards;

045887

045888

044987

123455

;

run;

data test2;

set test (where=(not revcode=:'045'));

run;

LOG MESSAGE:

112 data test2;

113 set test (where=(not revcode=:'045'));

ERROR: Where clause operator requires compatible variables.

114 run;

This is what I settled on for an alternate. Any comments or suggestions are appreciated...

data test2;

set test (where=((revcode=:'045')=0));

run;

Thank you.

Jack Clark

Research Analyst

Center for Health Program Development and Management

University of Maryland, Baltimore County


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