Use the age privacy provider to mask date values.
The aging process can increment or decrement a date value.
Aging can be specific to the number of years, months, weeks, or days. Optionally, aging can be a combination of these units.
Aging can also be based upon a specific 4-digit year value.
Starting with release 11.3.0.8, the incrementing values can be randomized.
The provider masks only dates with years from 1 A.D. to 9999 A.D.
Examples
- Source format
- The following example ages dates one month and uses the YYYY/MM/DD format for the source value.
trans pro=age, mon=1, srcdf="%YYYY/%MM/%DD", flddef1=(name=agevarchar, dt=datetime_szdt=date)
This example uses the following parameters:
- MON=1
- This parameter ages the date by adding one month.
- SRCDF="%YYYY/%MM/%DD"
-
This parameter specifies the date-time format by specifying the YYYY/MM/DD format for the source value. The same format
will be used for the destination.
- Random date
- The following example (available starting in release 11.3.0.8) ages the month by up to two months in either direction (earlier or later). The number
of months is determined randomly within this range. The day is changed to a random day in the resulting month.
trans provider=age, method=random, month=2, day=any, srcdf="%YYYY-%MM-%DD", FLDDEF1=(NAME=xyzdate, dt=datetime_sz)
This example uses the following parameters:
- method=random
- This parameter indicates the aging is to be done randomly.
- month=2
- This parameter indicates the maximum number of months by which the date will be aged (up or down). If, for example, the input
date in in April, the masked date will be in February, March, May, or June.
- day=any
- This parameter indicates the day should be changed to a random day in the month. If, for example, the masked date is in
February in a non-leap year, the day will be set between 1 and 28 (inclusive).
- srcdf="%YYYY-%MM-%DD"
- This parameter specifies the date-time format by specifying the YYYY/MM/DD format for the source value. The same format will be
used for the destination.
Syntax
The age privacy provider uses the following syntax:
- Masking parameters
-
TRANS PROVIDER = AGE ,
[ METHOD = { REPEATABLE | RANDOM } ] ,
- Formatting parameters
-
SRC_DATE_FORMAT = “src-date-format-expression“ ,
[ DST_DATE_FORMAT = “dest-date-format-expression“ ] ,
- Aging parameters
-
[ YEAR = n-years | “specific-year“ } ] ,
[ MONTH = n-months ] ,
[ WEEK = n-weeks ] ,
[ DAY = n-days | ANY ] ,
[ PIVOT = century-pivot-value ] ,
- Data definition parameters
-
FLDDEFn = ( NAME = field-name,
DATATYPE = datatype-value,
[ PRECISION = field-precision-value ],
[ SCALE = field-scale-value ],
[ LENGTH = field-length-value ],
[ CODEPAGE = codepage-value ],
[ CPTYPE = { DB2ZOS |DB2LUW | ORACLE |SYBASE |ODBC | INFORMIX |NETEZZA |SQLSERVER |TERADATA |ANY |NONE } ] ) ,
[ DISCARDLIMIT = discard-limit-value ] ,
[ CODEPAGE = codepage-value ] ,
[ CPTYPE = { DB2ZOS | DB2LUW | ORACLE | SYBASE | ODBC | INFORMIX |
NETEZZA | SQLSERVER | TERADATA | ANY | NONE } ]
Masking parameters
Parameters that determine how to mask data.
-
- METHOD (or MTD)
- The masking method type. Enter one of the following options:
- REPEATABLE (or REP)
- Default. Generates a date based on the old date in a repeatable manner using the
supplied aging parameters. This duplicates the
behavior of the pre-release 11.3.0.8 AGE
provider.
- RANDOM (or RAN)
- Generates a date by using a random masking
algorithm, controlled by the combination of the
YEAR, MONTH, WEEK and DAY parameters. The generated
date will never be the same as the source date.
-
- PROVIDER (or PRO)
- Required. Enter the provider name, AGE.
Note: The PRO parameter must be first in the masking string. All other parameters can appear in any order.
Formatting parameters
Parameters that determine how to format dates.
-
- SRC_DATE_FORMAT (or SRCDF)
- Required. Specifies, within enclosing double quotation marks,the format of the date string values in the source field.
Use any of the following format specifiers for formatting the date-time strings. All specifiers start with a percent (%) sign.
- Year
-
- Month
-
- Day
-
- Time
-
- Fraction of a second
-
- %FFFFFF
- %FFFFF
- %FFFF
- %FFF
- %FF
- %F
- AM/PM
-
For example, to format a date string as four-digit year, three-character month, two-digit date with
dash-type (-) separators, the format string would be “%YYYY-%MMM-%DD”.
- DST_DATE_FORMAT (or DSTDF)
- Specifies, within enclosing double quotation marks, the format of the output date string values in the destination field.
Use any of the following format specifiers for formatting the date-time strings. All specifiers start with a percent (%)
sign. By default, the source date format is used as the destination date format if the source data type is CHAR.
- Year
-
- Month
-
- Day
-
- Time
-
- Fraction of a second
-
- %FFFFFF
- %FFFFF
- %FFFF
- %FFF
- %FF
- %F
- AM/PM
-
For example, to format a date string as a four-digit year, three-character month, two-digit date with dash-type (-) separators, the format string would be “%YYYY-%MMM-%DD”.
Aging parameters
Parameters that determine how to age dates.
-
- YEAR (or YR)
- For METHOD=REPEATABLE and pre-release 11.3.0.8 default behavior:
- Specifies either the number of years to increment or decrement a source date value or a specific year to use for a date value.
Enter one of the following options:
- n-years
- Increments or decrements the source date value by a specific number of years. A positive value increments the year, and a negative value decrements the year. Enter an integer value within the range -2500 to +1581. The plus sign is optional.
- "specific-year"
- Specifies, within enclosing double quotation marks, a four-digit year value to replace the source year value. The other parts of the date value and format remain the same. The valid values are “1582” to “3999”.
YR=specific-year
is not compatible with the parameters MONTH, WEEK, and DAY.
- For METHOD=RANDOM (only allowed in release 11.3.0.8 or higher):
- Specifies the maximum number by which to vary the year. For example, YEAR=5 would randomly either subtract or add a value
between 1 and 5 (inclusive).
- MONTH (or MON)
- For METHOD=REPEATABLE and pre-release 11.3.0.8 default behavior:
- Increments or decrements the source date value by a specific number of months. A positive value increments the month, and a
negative value decrements the month. Enter an integer value within the range -30000 to +30000. The plus sign is
optional.
MON is not compatible with the parameter YR=specific-year.
- For METHOD=RANDOM (only allowed in release 11.3.0.8 or higher):
- Specifies the maximum number by which to vary the month. For example, MONTH=5 would randomly either subtract or add a value
between 1 and 5 (inclusive).
- WEEK (or WK)
- For METHOD=REPEATABLE and pre-release 11.3.0.8 default behavior:
- Increments or decrements the source date value by a specific number of weeks. A positive value increments the weeks, and a
negative value decrements the weeks. Enter an integer value within the range -30000 to +30000. The plus sign is
optional.
WK is not compatible with the parameter YR=specific-year.
- For METHOD=RANDOM (only allowed in release 11.3.0.8 or higher):
- Specifies the maximum number by which to vary the week. For example, WEEK=5 would randomly either subtract or add a value
between 1 and 5 (inclusive).
- DAY
- For METHOD=REPEATABLE and pre-release 11.3.0.8 default behavior:
- Increments or decrements the source date value by a specific number of days. A positive value increments the number of days,
and a negative value decrements the number of days. Enter an integer value within the range -30000 to +30000. The plus sign
is optional.
DAY is not compatible with the parameter YR=specific-year.
- For METHOD=RANDOM (only allowed in release 11.3.0.8 or higher):
- Enter one of the following:
- An integer that specifies the maximum number by which to vary the day. For example, DAY=5 would randomly either
subtract or add a value between 1 and 5(inclusive).
- ANY: DAY=ANY will result in a randomly selected day of the month.
- PIVOT (or PIV)
- Specifies the appropriate century for source dates with two-digit years. Enter a value within the range 0 to 99. The
default value is 65. The following rules apply to PIV:
- All two-digit years equal to or greater than the PIV value are placed in the 20th century (19xx).
- All two-digit years less than the PIV value are placed in the 21st century (20xx).
Data definition parameters
Parameters for defining source and target data. For further information see, supported data types.
-
- FLDDEFn
- Required. Specifies the attributes of input values to use for processing.
- DISCARDLIMIT (or DLIM)
- Specifies the number of failed rows to discard before the provider stops processing.
- CODEPAGE (or CP)
- An integer value that specifies the codepage or character-set identifier of the source fields. The default is UTF-8. The CP parameter within the
FLDDEFn parameter overrides this value.
- CPTYPE (or CPT)
- The codepage type of the source fields. The CPT parameter within the FLDDEFn
parameter overrides this value.
When the origin of the data is DBMS-specific but not tied to any one DBMS, specify the value as ANY. When the origin of the data is from a non-DBMS source, specify the value as NONE. As there are no DBMS-specific code pages for Netezza®, a specification of NONE is implied when Netezza is specified.
Enter one of the following values:
|
|
| DBZ (or DB2zOS) |
DB2® for z/OS® |
| DB2 (or DB2LUW) |
DB2 for Linux™, UNIX™, and Windows |
| IFX (or INFORMIX) |
Informix® |
| MSS (or SQLSERVER) |
Microsoft™ SQL Server |
| NZ or NETEZZA |
Netezza |
| ODBC |
ODBC |
| ORA (or ORACLE) |
Oracle |
| SYB (or SYBASE) |
Sybase |
| TD or TERADATA |
Teradata |
| ANY |
Any DBMS |
| NONE |
No DBMS |
Supported data types
The age privacy provider supports the following data types for source and destination fields:
|
|
| DATETIME_CHAR |
A fixed size character data value that is left justified
with space padded and contains date-time values. |
| DATETIME_VARCHAR |
Character data starting with a short integer value that indicates
the length, in bytes, of the character data to follow. |
| DATETIME_WCHAR |
A fixed size wide character data value that is left-justified with space
padded and contains date-time values. |
| DATETIME_WVARCHAR |
Wide Character data starting with a short integer value that indicates the
length, in bytes, of the character data to follow. |
| DATETIME_SZ |
Character data string which is terminated by a NULL character. |
| DATETIME_WSZ |
Wide character data string which is terminated by a NULL
character. |
| DATE |
A data type that is used when the source value is a ODPP_ODBC_DATE
structure of the Optim™ data
masking API. |
| TIMESTAMP |
A data type that is used when the source value is a ODPP_ODBC_TIMESTAMP
structure of the Optim™ data masking API. |
Starting with release 11.3.0.8, several datatypes that are used in other privacy providers are automatically mapped to the appropriate DATETIME_xxxx datatype, as shown in the table below. For example, DATATYPE=CHAR and DATATYPE=DATETIME_CHAR are equivalent.
|
|
| CHAR |
DATETIME_CHAR |
| VARCHAR |
DATETIME_VARCHAR |
| WCHAR |
DATETIME_WCHAR |
| WVARCHAR |
DATETIME_WVARCHAR |
| VARCHAR_SZ |
DATETIME_SZ |
| WVARCHAR_SZ |
DATETIME_WSZ |