Use the TRANS NID function to mask national ID numbers.
You can mask national ID numbers with either a repeatable
method that preserves part of the source value or a random method
that does not preserve any part of the source value.
You can
also specify the type of separators used in the output values (dashes,
periods, spaces, or no separators).
The TRANS NID function uses
the following syntax:
[TRANS] NID ('SWI=country_code, [FMT=(output_format)], [MTD={mask|random}],
[SRC=column_name], [VAL={Y|N}], [PRE=INV]')
- SWITCH or SWI
A two-character value that indicates the type of national ID
to mask. This parameter is required. Only one switch value is permitted.
The
following two-character values are valid:
- Canada: Canadian Social Insurance Number (SIN)
- CA
- France: French National Institute for Statistics and Economic
Studies Number (INSEE)
- FR
- Italy: Italian Fiscal Code Number (CF)
- IT
- Spain: Spanish Fiscal Identification Number (NIF)
- ES
- United Kingdom: United Kingdom National Insurance Number (NINO)
- UK
- United States of America: United States Social Security Number
(SSN)
- US
- FMT or FORMAT
Determines the output format and which parts of the source
value to mask. The syntax for this parameter is determined by the
national ID being masked:
If this parameter is omitted and MTD=mask, the source
format is used and the default fields will be masked.
If this
parameter is omitted and MTD=random, the output values will not include
separators.
If the destination column is not large enough to
contain an output format that uses separators, separators will not
be included.
- MTD or METHOD
- Determines which masking method to use, repeatable or random.
If this parameter is omitted, repeatable masking is performed (MTD=mask).
- mask
- The source values are masked in a repeatable manner. The output
values are based on the source values. Default.
- random
- The output values are generated by a random masking algorithm.
The output values are not based on the source values.
Note: - MTD=random is not compatible with the following parameters: VAL=Y
and PRE=INV.
- If MTD=random and the FMT parameter specifies that part of the
source value should be copied to the output value, the output value
will not include source values; however, any separators specified
in the FMT parameter will be included in the output value.
- SRC or SOURCE
- The name of the column that contains the source values. Use this
parameter only if the names of the source and destination columns
do not match.
- VAL or VALIDATE
- Determines if country-specific validation is performed on the
source values. If this parameter is omitted, validation is not performed
(VAL=N).
- Y
- Validate the source values.
Note: The option cannot be used if
MTD=random.
- N
- Do not validate the source values. Default.
- PRE or PRESERVE
- Determines if invalid source values are copied to the destination
column. If this parameter is omitted, invalid source values are not
copied to the destination column and rows that contain these values
are skipped. This parameter includes only one option, INV or INVALID.
- INV or INVALID
- Copy invalid source values to the destination column.
Note: The
option cannot be used if MTD=random.
Examples
The following syntax will mask
United States Social Security Numbers (SSN) with a repeatable method.
The function will copy the first three digits of the source SSN and
include a dash separator for the output value. Validation will be
performed on the output value.
NID('SWITCH=US, FMT=(US=3C-2X-4X), MTD=MASK, VAL=Y')
The
following syntax will mask French National Institute for Statistics
and Economic Studies numbers (INSEE) with a random method. The function
will use the default output format, which will not include separators.
NID('SWITCH=FR, MTD=RANDOM')
The
following syntax will mask Spanish Fiscal Identification Numbers (NIF)
with a repeatable method. The function will preserve invalid source
values and use the default output format.
NID('SWITCH=ES, MTD=MASK, PRE=INV')