Use ?? in format field of INPUT function. You may want to look a VERIFY function also.
> I'm using this statement to get back the first
> character in an address field.
> I'm having a problem finding a way to verify what it
> I tried this :
> if (input(addr, ??1.) eq .) then
> a ='numeric';
> hen I try this I get a lot of
> "NOTE: Invalid argument to function INPUT at line
> 1063 column 9." How can I get it to have a clean
> Thank You
ANYDIGIT function would probably be faster. If you are just looking at the first position. The technique you are using is better for test if a string is a number, so strings like 1e4 would be read correctly. If your numbers could include commas or dollar sign use COMMA informat.
If you are trying to see if string is a SAS name NVALID function.
input string $16.;
x = anydigit(string);
if anydigit(string) eq 1 then put 'Digit in First Position' string=;
What i'm trying to do is check if the first character in my address field is truley a number or is it a character. We are trying to clean the data up and i'm trying to find all the address that start with a letter since mostly all address start with a number.
For what i'm trying to do is mine way correct? With anydigit would I have to check every digit ex. 1,2,3,4,5 etc..?