Italian Fiscal Code number masking

You can use the TRANS NID function to mask Italian Fiscal Codes (CF).

A CF is a 16-character alphanumeric value with the following format: FFF-NNN-YYMDD-RRRRC.
FFF
Encoded surname.
NNN
Encoded given name.
YY
Year of birth.
M
Month of birth.
DD
Date of birth.
RRRR
Region code.
C
Control character.

The TRANS NID function generates a masked CF according to the following rules:

Output formats (FMT=)

The following output formats are available for a CF.

C indicates values that are copied. X indicates values that are masked. For example, 3C4X indicates that the first three characters are copied and the next four characters are masked.

Fields to be masked Format without separator Format with dash separator Format with space separator
Date of birth, Region (MTD=mask default) IT=6C10X IT=3C-3C-5X-5X IT=3C 3C 5X 5X
Surname, Given name, Region IT=6X5C5X IT=3X-3X-5C-5X IT=3X 3X 5C 5X
Surname, Given name, Date of birth IT=11X4C1X IT=3X-3X-5X-4C1X IT=3X 3X 5X 4C1X
Surname, Given name IT=6X9C1X IT=3X-3X-5C-4C1X IT=3X 3X 5C 4C1X
Date of birth IT=6C5X4C1X IT=3C-3C-5X-4C1X IT=3C 3C 5X 4C1X
Region IT=11C5X IT=3C-3C-5C-5X IT=3C 3C 5C 5X
Surname, Given name, Date of birth, Region IT=16X IT=3X-3X-5X-5X IT=3X 3X 5X 5X

Data types

The following data types are permitted for source and destination columns. Restrictions for each data type are noted.

CHAR and NCHAR
The length of the column must be at least 16 characters.
VARCHAR and NVARCHAR
The length of the column must be at least 16 characters.

Validation (VAL=Y)

If the VAL=Y parameter is used, a source row will be skipped if it contains an invalid control character.

Special processing

The following checks will be made during processing:

Skipped rows

A source row will be skipped and not written to the destination table if the following occurs:

Null value
The source value is NULL but the destination column does not allow a NULL value.
Invalid CF
The source column has an invalid source value or the source value is too large.
The source value is less than 16 characters.


Feedback