Hi ,
I need to filter out data in the "ZIP" column of a data set. It has few values which start with a character variable (A-Z). How can I filter them in a dataset of 1000000 rows. Column "ZIP" is a categorical variable.
I did try this approach but there seems something to be wrong :
proc sql;
delete * from dataset where zip = '^[A-Z]';
quit;
The log says no rows are selected. Please advice !
Thanks ,
Minal
proc sql;
select *
from have
where anayalpha(ZIP);
quit;
Thanks for the reply. But on running the code I get the following error :
23 proc sql;
24 select *
25 from project.a1
26 where anayalpha(ZIP);
ERROR: Function ANAYALPHA could not be located.
But anyways I tried running this :
proc sql;
select * from project.a1 where prxmatch('/^[A-Z]/', zip);
quit;
and it worked.
Thanks,
Minal
Typo in word anyalpha:
where anyalpha(ZIP);
it should be
if anyalpha(zip)=1;
1 is for if zip starts with character value.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.