[Info-vax] SSN Validation (was: Re: Re: Modern software development for VMS, was: Re: source control and semantics (Re: Why so much Unix envy?))

Shark8 OneWingedShark at gmail.com
Mon Sep 15 17:45:21 EDT 2014


On 9/15/2014 2:20 PM, Norm Raphael wrote:
>   > On 09/15/14, Shark8<OneWingedShark at gmail.com> wrote:
>   >
>> On 9/14/2014 9:40 AM, David Froble wrote:
>>> What's wrong with directories containing source files, build files, and
>>> such?
>> <snip>
>> Or, a bit more on the mundane side, consider DB-applications and
>> ensuring [DB] consistency and proper-processing; you could use the
>> following to ensure that (a) all SSNs are correctly and consistently
>> formatted.
>> <snip>
>>> -- SSN format: ###-##-####
>>> Subtype Social_Security_Number is String(1..11)
>>> with Dynamic_Predicate =>
>>> (for all Index in Social_Security_Number'Range =>
>>> (case Index is
>>> when 4|7 => Social_Security_Number(Index) = '-',
>>> when others => Social_Security_Number(Index) in '0'..'9'
>>> )
>>> );
>
> (a) You forgot that no SSN can begin with 000, 666, or 900-999, and
> (b) digits 4-5 cannot be 00, not can digits 6-9 be 0000.
>
> Moreover, for SSN's issued before June 25, 2011, there is a
> published "high group list" http://www.socialsecurity.gov/employer/ssns/HGJune2411_final.txt
> which shows the highest issued digits 4-5 for any digits 1-3, if you really want to check (After
> that date SSN's were randomly issued, but with restrictions (a) and (b) retained.) From that table,
> nothing over 772 for digits 1-3 was issued.
>
> There are earlier "high group lists" available if you want to check by issue date in conjunction
> with birth date, but since SSN's were not issued at birth, this would lead to eliminating some
> errors, but not verifying all entries.
>
>
>
>
>   Norman F. Raphael
> "Everything worthwhile eventually
> degenerates into real work." -Murphy
>


I did forget that for (A) and (B)... although I'm not sure now, but I 
may've read something akin to 000-XX-XXXX being a "special value" in 
several systems dealing w/ SSNs. -- In my case in particular it was 
making sure the format ###-##-#### was adhered to*, not full-validation, 
which is exactly what the given subtype does.**

* The DB kept getting non-conforming data inserted and then the app 
would end up failing -- granted, the implementation-language we were 
using was terrible [PHP] and the DB kinda on the flaky side [MySQL].

** Plus as an example of the Ada 2012 subtyping features the additional 
[and generally unfamiliar] constraints would detract from its value as 
an example.



More information about the Info-vax mailing list