Is there a SAS function that extracts only the numerals from a straing
For example
if F is a sas function then it should give,
F(1bhy688%<2) = 16882,
F(>%$123abc77 bad guy 88)= 1237788,
F( " 1 5 abc 6 ^* +-? ")=156 and so on ?
Thanks.
yes. example:
data have;
input abc $;
cards;
ewg356
57ugh
f7h58sh5
;
data want;
set have;
new=compress(abc,,'kd');
proc print;run;
yes. example:
data have;
input abc $;
cards;
ewg356
57ugh
f7h58sh5
;
data want;
set have;
new=compress(abc,,'kd');
proc print;run;
Great help....I was doing all sort of inefficient coding to fix this!
In the spirit of sharing at Christmas, for my fellow Canadians, this is EXACTLY the function needed to get %$##$#%% gas pumps in the U.S. to accept your credit card. When they ask for a ZIP code, enter your Postal Code, digits only, followed by zeroes to fill to five digits. For example, my postal code is K2P 1S3, I use 21300, it's worked at least ten times on my recent trip. Another small aggravation eliminated, the coincidence of this appearing on the forum the day I get home is quite something.
Merry Christmas, (and even to Americans who create these U.S.-centric applications),
Tom
: They are probably only collecting the zipcodes for market research purposes and apparently not checking them for validity. There is no 23100 zipcode in the US. The closest I could find (using Google) was:
21300 ZIP Code in France - Find ZIP Code all around the world
No, this has been causing us grief for years. Before we found this, we had tried many options. They were all rejected, which meant going into the gas station, getting them to turn on the pump, usually leaving our credit card with them, and a whole bunch or rigamarole. The following DON'T work:
Using our postal code, with the numbers for the letter keys;
Using 00000;
Using the actual ZIP code of the place we were going.
Based on the last, clearly some kind of edit against our credit card information was being done.
Believe me, someday you'll thank me for this!
Tom
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.