JupyterLab Extension for INFACore

JupyterLab Extension for INFACore

Validate SSN

Validate SSN

You can apply this function to parse a United States Social Security Number (SSN) pattern from a large string of text.
The function parses SSNs with dashes or without dashes, formats, and validates the SSN. Format options include without punctuation, with punctuation, and spaces.
To perform this operation, specify the data object variable, and then enter the column name that contains the SSNs that you want to validate.
By default, the rule writes Social Security Numbers without any punctuation.
The rule can output the following formats:
  • No Punctuation - nnnnnnnnn
  • Space - nnn nnn nnn
  • Dash - nnn-nnn-nnn
To change the standardization format, open the
dq_SSN_Format
transformation in the rule and update the expression on the
SSN_Format
port.
When you run the code to validate the SSN, the function returns values as valid or not valid.
For example, the input flat file includes a column named
SSN
that contains the United States SSN.
The following snippet is the input code when you apply the function:
import informatica.infacore as ic FF_DV = ic.get_data_source("Flat File").get_connection("DR_FlatFile").get_data_object("input.csv") dqf = ic.DataQualityFunctions() dqf.validate_ssn(FF_DV,"ssn")
The following snippet shows the output returned with the validation values for the SSN:
Input_SSN: string Out_SSN: string Out_SSN_Status: string Out_SSN_Status_Message: string Out_SSN_Score: double Out_Remaining_Text: string ---- Input_SSN: [["532459641","680-11-2943","41735abc55555"]] Out_SSN: [["532459641","680112943","41735abc5"]] Out_SSN_Status: [["Valid","Valid","Invalid"]] Out_SSN_Status_Message: [["Valid structure, valid group and area values.","Valid structure, valid group and area values.","Invalid SSN length"]] Out_SSN_Score: [[0.9,0.9,0.25]] Out_Remaining_Text: [["","","41735abc55555"]]

0 COMMENTS

We’d like to hear from you!