Skip to content
IRI Logo
Solutions Products
  • Solutions
  • Products
  • Blog
  • BI
  • Big Data
  • DQ
  • ETL
  • IRI
    • IRI Business
    • IRI Workbench
  • Mask
  • MDM
    • Master Data Management
    • Metadata Management
  • Migrate
    • Data Migration
    • Sort Migration
  • Test Data
  • Transform
  • VLDB
  • VLOG

Testing and Masking Singapore NRICs

  • by Nathan Dymora

Singapore NRICs are used in much the same way Social Security numbers are used in the United States. The Singapore NRIC identifies citizens, permanent residents, or any other person who has entered the country for  an extended stay on visa. It consists of nine characters, in the format:

@0000000#

The @ character represents residence status. The next seven digits represent a random serial number, except the first two are the birth year for permanent residents born after 1967. The last character is a check, or validation character.


Creating NRIC Test Values with 
RowGen

A new library function is available for IRI RowGen users who wish to generate properly formatted, computationally valid Singapore NRIC values. Call the special function within a RowGen job script like this:

/INFILE=random
 /PROCESS=RANDOM
 /INCOLLECT=1
 /FIELD=(NATID=natid_gen_singapore("PERMANENT", "1991"), TYPE=ASCII, POSITION=1, SIZE=20)
 
/REPORT
/OUTFILE=test.out
 /PROCESS=RECORD
 /FIELD=(NATID, TYPE=ASCII, POSITION=1)

The output from this routine is:

T9119134I

where the “incollect” value determined the number of test values produced.

When trying to create a valid Singapore NRIC, like the above example, use the syntax:

/FIELD=(FieldName=natid_gen_singapore("ResidenceType", "BirthYear"), TYPE=ASCII, POSITION=1, SEPERATOR="\t")

where:

  • FieldName is the desired name for the field (e.g., NRIC)
  • ResidenceType is either PERMANENT or TEMPORARY
  • BirthYear is the 4-digit year of birth year

 

Masking Real NRIC Values with FieldShield

IRI FieldShield now also facilitates standard redaction for NRICs in production data sources. The FieldShield data masking dialog available in the IRI Workbench GUI for FieldShield can mask all Singapore NRICs in one or more data sources (if applied as rule).

For example, from the ‘New Protect Job’ wizard in IRI Workbench,

  1. Specify your project folder and a file name for the FieldShield Control Lanague (.fcl) job script. Click “Next”to go to the Data Sources window.
  2. Click on “Add Data Source…” and browse to the input holding the Singapore NRICs to mask. Click “Open” to select it, and “OK” to return to the Data Sources window.
  3. Click “Discover Metadata…” and enter a name for the .DDF metadata file. Click “Next” and in the new Format window, select “DELIMITED”, and specify “,”. Click “Next” to see the table items displayed, and ‘Finish” to return to the Data Sources window. Click “Yes” in the prompt to apply the DDF fields to this job.
  4. Click “Next” to open the Data Targets window, and “Add Data Target…”. Browse to a target that will receive your (masked) data, click “Open” to select it, and click “OK” to return.
  5. Click “Target Field Layout…” and in the mapping window select your NRIC field name in the targets tab, then “Masking” from the “Field Protection” menu. Select Singapore NRIC next to the Mask label, and click “OK” twice to return to Data Targets.
  6. Once you’re done, click “Finish” to generate the job script.

SNRIC_Options

Output script / masked data

SNRIC_Script

Please submit feedback on this article below, or contact info@iri.com for more information on RowGen for generating synthetic test data or FieldShield for masking production data.

Test Phone Number Generation: Using RowGen’s Compound Data Value Wizard
Creating COBOL Test Data in RowGen
encrypt nric nric encryption nric masking singapore ID mask singapore nric

Related articles

DarkShield PII Discovery & Masking…
Masking Flat Files in the…
Directory Data Class Search Wizard
Masking PII in a Relational…
IRI Data Class Map
Schema Data Class Search
Training NER Models in IRI…
Masking NoSQL DB PII in…
Masking RDB Data in the…
IRI DarkShield-NoSQL RPC API
Find & Mask File PII…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Big Data 66
  • Business Intelligence (BI) 77
  • Data Masking/Protection 163
  • Data Quality (DQ) 41
  • Data Transformation 94
  • ETL 122
  • IRI 229
    • IRI Business 86
    • IRI Workbench 162
  • MDM 37
    • Master Data Management 12
    • Metadata Management 25
  • Migration 65
    • Data Migration 60
    • Sort Migration 6
  • Test Data 102
  • VLDB 78
  • VLOG 40

Tracking

© 2025 Innovative Routines International (IRI), Inc., All Rights Reserved | Contact