I think you got an extra For-Next in there for starters...Not sure if the extra parameters are needed in your AScan either since you are already SubStr the SSN...Try replacing this...

Code:

For Each $line In $filea
$ssn = substr($line,1,9)

For Each $line In $filea
If AScan($fileb,$ssn,1,9)+1
? "A SSN In file b was found In file a, writting the line To file c"
$ = WriteLine(1,$line+@CRLF)
EndIf



With this...

Code:

For Each $line In $filea
$ssn = substr($line,1,9)
If AScan($fileb,$ssn)+1
? "A SSN In file a was found In file b, writting the line To file c"
$ = WriteLine(1,$line+@CRLF)
EndIf