Newsgroups: comp.databases
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!osiris.cso.uiuc.edu!aindiana
From: aindiana@osiris.cso.uiuc.edu (Daiv Stoner)
Subject: Re: Coping with leading zeros in inputing SSN#'s
Message-ID: <1991Jun20.175529.5250@ux1.cso.uiuc.edu>
Sender: usenet@ux1.cso.uiuc.edu (News)
Organization: University of Illinois at Urbana
References: <1991Jun19.234309.19718@oz.plymouth.edu>
Distribution: usa
Date: Thu, 20 Jun 1991 17:55:29 GMT
Lines: 36

derykm@oz.plymouth.edu (Dez) writes:

>What I would like to do is make sure a user either inputs 9 digits for a
>social security number or if there is a routine that if the user does
>enter the leading zeros, the program will trim off the zeros.
>In the program it will be used as a validation procedure.

>This way person 003-45-7899 is identical to 3-45-7899.

>thanks

>Deryk

Ahhh, yes.  Those pesky SSNs that begin with zero(s).  I ran into
that problem a while back.  Here's how I dealt with it in FoxPro:

Make the SSN field a character field of 9 characters.  Whenever
you use GET to read in the SSN, use a picture clause to put in the 
dashes, like so:
     @10,10 get SSN picture "@R 999-99-9999" valid v_ssn

Then, in the v_ssn function, check the length of the SSN string.
Also, check for blanks.  If there are blanks, you have a choice of
how you can code it.  You can either reject it as bad input, or
you can replace the blanks with zeros.

I spent a lot of time trying to work out this solution, and 
this is the best thing I've come up with.  I'd be happy to hear
feedback from others about this.

Daiv

--
Daiv Stoner
aindiana@osiris.cso.uiuc.edu
daiv@coplex.UUCP
