Index string field for numbers only

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Index string field for numbers only

Brian Moore-3
Hi-

I'm screening US postal codes for possibly valid entries (which means
numbers only).

Can index (or similar command) be made to validate all characters as
numeric? (creating the NotvalidFlag below)


Thanks,
Brian



Czip5           NotvalidFlag
85022           .
54567           .
234re           1
Reply | Threaded
Open this post in threaded view
|

Re: Index string field for numbers only

Marks, Jim
Not sure but

COMPUTE notvalid = SYSMIS(NUMBER(czip5,f8.0)).

Should do the trick

--jim



-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Brian Moore
Sent: Friday, May 25, 2007 5:15 PM
To: [hidden email]
Subject: Index string field for numbers only

Hi-

I'm screening US postal codes for possibly valid entries (which means
numbers only).

Can index (or similar command) be made to validate all characters as
numeric? (creating the NotvalidFlag below)


Thanks,
Brian



Czip5           NotvalidFlag
85022           .
54567           .
234re           1