-
Notifications
You must be signed in to change notification settings - Fork 77
/
Anonymize and Mask Data.step
1 lines (1 loc) · 13 KB
/
Anonymize and Mask Data.step
1
{"creationTimeStamp":"2022-09-14T18:17:43.593Z","modifiedTimeStamp":"2022-09-27T13:43:05.957Z","createdBy":"sasadm","modifiedBy":"maquee","name":"Anonymize and Mask Data.step","displayName":"Anonymize and Mask Data.step","localDisplayName":"Anonymize and Mask Data.step","properties":{},"links":[{"method":"GET","rel":"self","href":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","uri":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","type":"application/vnd.sas.data.flow.step"},{"method":"GET","rel":"alternate","href":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","uri":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","type":"application/vnd.sas.data.flow.step.summary"},{"method":"GET","rel":"up","href":"/dataFlows/steps","uri":"/dataFlows/steps","type":"application/vnd.sas.collection","itemType":"application/vnd.sas.data.flow.step.summary"},{"method":"PUT","rel":"update","href":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","uri":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","type":"application/vnd.sas.data.flow.step","responseType":"application/vnd.sas.data.flow.step"},{"method":"DELETE","rel":"delete","href":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","uri":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66"},{"method":"GET","rel":"transferExport","href":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","uri":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","responseType":"application/vnd.sas.transfer.object"},{"method":"PUT","rel":"transferImportUpdate","href":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","uri":"/dataFlows/steps/204ab9d8-5dd1-4a18-a57d-290831704c66","type":"application/vnd.sas.transfer.object","responseType":"application/vnd.sas.summary"}],"metadataVersion":0.0,"version":2,"type":"code","flowMetadata":{"inputPorts":[{"name":"inTable","displayName":"inTable","localDisplayName":"inTable","minEntries":1,"maxEntries":1,"type":"table"}],"outputPorts":[{"name":"outTable","displayName":"outTable","localDisplayName":"outTable","minEntries":1,"maxEntries":1,"type":"table","columnDelta":{"updateColumnArguments":["maskedColumn"],"automaticMapping":[{"inputPort":"inTable","inputPortName":"inTable"}]},"requiresStructure":false}]},"ui":"{\n\t\"showPageContentOnly\": true,\n\t\"pages\": [\n\t\t{\n\t\t\t\"id\": \"maskData\",\n\t\t\t\"type\": \"page\",\n\t\t\t\"label\": \"Anonymize and Mask Data\",\n\t\t\t\"children\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"inTable\",\n\t\t\t\t\t\"type\": \"inputtable\",\n\t\t\t\t\t\"label\": \"Select an input table:\",\n\t\t\t\t\t\"required\": true\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"inColumn\",\n\t\t\t\t\t\"type\": \"columnselector\",\n\t\t\t\t\t\"label\": \"Select a column to mask:\",\n\t\t\t\t\t\"table\": \"inTable\",\n\t\t\t\t\t\"order\": false,\n\t\t\t\t\t\"max\": 1,\n\t\t\t\t\t\"min\": 1\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"selectedLocale\",\n\t\t\t\t\t\"type\": \"dropdown\",\n\t\t\t\t\t\"label\": \"Select a QKB locale:\",\n\t\t\t\t\t\"items\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Afrikaans - South Africa\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Arabic - Egypt\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Chinese - China\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Czech - Czech Republic\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Danish - Denmark\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Dutch - Belguim\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Dutch - Netherlands\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - Australia\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - Canada\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - Hong Kong\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - India\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - New Zealand\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - Philippines\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - Singapore\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - South Africa\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - United Kingdom\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"English - United States\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Finnish - Finland\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"French - Belguim\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"French - Canada\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"French - France\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"German - Germany\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Greek - Greece\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Hebrew - Israel\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Hungarian - Hungary\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Italian - Italy\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Japanese - Japan\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Korean - South Korea\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Malay - Malaysia\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Norwegian - Norway\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Polish - Poland\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Portuguese - Brazil\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Portuguese - Portugal\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Romanian - Romania\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Russian - Russia\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Slovak - Slovakia\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Slovenian - Slovenia\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Spanish - Argentina\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Spanish - Mexico\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Spanish - Spain\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Swedish - Sweden\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Thai - Thailand\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Turkish - Turkey\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\"placeholder\": \"(select a QKB locale)\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"selectedDefinition\",\n\t\t\t\t\t\"type\": \"dropdown\",\n\t\t\t\t\t\"label\": \"Select data masking definition:\",\n\t\t\t\t\t\"items\": [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Anonymize E-mail Domain\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask Address Except Street Type\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask All Characters\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask All Characters Except First and Last\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask Digits\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask E-mail Domain\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask E-mail Mailbox\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask E-mail Mailbox Except First and Last\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask E-mail Sub-Domain\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask Letters\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask Partial String\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\"value\": \"Mask Phone Number\"\n\t\t\t\t\t\t}\n\t\t\t\t\t],\n\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\"placeholder\": \"(Data masking definitions)\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"maskedColumn\",\n\t\t\t\t\t\"type\": \"newcolumn\",\n\t\t\t\t\t\"label\": \"Masked column name:\",\n\t\t\t\t\t\"required\": true,\n\t\t\t\t\t\"placeholder\": \"\",\n\t\t\t\t\t\"hideproperties\": false,\n\t\t\t\t\t\"readonly\": false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"outTable\",\n\t\t\t\t\t\"type\": \"outputtable\",\n\t\t\t\t\t\"label\": \"Specify the output table:\",\n\t\t\t\t\t\"required\": true\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\t\"id\": \"about\",\n\t\t\t\"type\": \"page\",\n\t\t\t\"label\": \"About\",\n\t\t\t\"children\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": \"aboutText\",\n\t\t\t\t\t\"type\": \"text\",\n\t\t\t\t\t\"text\": \"The \\\"Anonymize and Mask Data\\\" step uses standardization definitions from the SAS Quality Knowledge Base (QKB) to mask or anonymize data in a selected column.\\n\\nIt requires the SAS Quality Knowledge Base (QKB) for Contact Information version 32 (or later). \\n\\nNote: This custom step is related to the \\\"DQ - Standardize\\\" custom step. \\n \\n\\nVersion: 1.1 (27SEP2022)\",\n\t\t\t\t\t\"visible\": \"\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t],\n\t\"syntaxversion\": \"1.3.0\",\n\t\"values\": {\n\t\t\"selectedLocale\": {\n\t\t\t\"value\": \"English - United States\"\n\t\t},\n\t\t\"maskedColumn\": {\n\t\t\t\"value\": \"maskedColumn\",\n\t\t\t\"label\": \"masked Column\"\n\t\t}\n\t}\n}","templates":{"SAS":"/* Resolve selectedLocale to 5-character QKBLocale */\n%macro setLoc(selectedLocale);\n%global QKBlocale;\n%global Compressedlocale;\n\n%let Compressedlocale = %sysfunc(compress(&selectedLocale,\" -\"));\n\n\t%if &Compressedlocale = AfrikaansSouthAfrica %then %let QKBlocale = AFZAF;\n\t%else %if &Compressedlocale = ArabicEgypt %then %let QKBlocale = AREGY;\n\t%else %if &Compressedlocale = ChineseChina %then %let QKBlocale = ZHCHN;\n\t%else %if &Compressedlocale = CzechCzechRepublic %then %let QKBlocale = CSCZE;\n\t%else %if &Compressedlocale = DanishDenmark %then %let QKBlocale = DADNK;\n\t%else %if &Compressedlocale = DutchBelguim %then %let QKBlocale = NLBEL;\n\t%else %if &Compressedlocale = DutchNetherlands %then %let QKBlocale = NLNLD;\n\t%else %if &Compressedlocale = EnglishAustralia %then %let QKBlocale = ENAUS;\n\t%else %if &Compressedlocale = EnglishCanada %then %let QKBlocale = ENCAN;\n\t%else %if &Compressedlocale = EnglishHongKong %then %let QKBlocale = ENHKG;\n\t%else %if &Compressedlocale = EnglishIndia %then %let QKBlocale = ENIND;\n\t%else %if &Compressedlocale = EnglishNewZealand %then %let QKBlocale = ENNZL;\n\t%else %if &Compressedlocale = EnglishPhilippines %then %let QKBlocale = ENPHL;\n\t%else %if &Compressedlocale = EnglishSingapore %then %let QKBlocale = ENSIN;\n \t%else %if &Compressedlocale = EnglishSouthAfrica %then %let QKBlocale = ENZAF;\t\n \t%else %if &Compressedlocale = EnglishUnitedKingdom %then %let QKBlocale = ENGBR;\n \t%else %if &Compressedlocale = EnglishUnitedStates %then %let QKBlocale = ENUSA;\n\t%else %if &Compressedlocale = FinnishFinland %then %let QKBlocale = FIFIN;\n\t%else %if &Compressedlocale = FrenchBelguim %then %let QKBlocale = FRBEL;\n\t%else %if &Compressedlocale = FrenchCanada %then %let QKBlocale = FRCAN;\n\t%else %if &Compressedlocale = FrenchFrance %then %let QKBlocale = FRFRA;\n\t%else %if &Compressedlocale = GermanGermany %then %let QKBlocale = DEDEU;\n\t%else %if &Compressedlocale = GreekGreece %then %let QKBlocale = ELGRC;\n\t%else %if &Compressedlocale = HebrewIsrael %then %let QKBlocale = HEISR;\n\t%else %if &Compressedlocale = HungarianHungary %then %let QKBlocale = HUHUN;\n\t%else %if &Compressedlocale = ItalianItaly %then %let QKBlocale = ITITA;\n\t%else %if &Compressedlocale = JapaneseJapan %then %let QKBlocale = JAJPN;\n\t%else %if &Compressedlocale = KoreanSouthKorea %then %let QKBlocale = KOKOR;\n\t%else %if &Compressedlocale = MalayMalaysia %then %let QKBlocale = MSMYS;\n\t%else %if &Compressedlocale = NorwegianNorway %then %let QKBlocale = NONOR;\n \t%else %if &Compressedlocale = PolishPoland %then %let QKBlocale = PLPOL;\t\n \t%else %if &Compressedlocale = PortugueseBrazil %then %let QKBlocale = PTBRA;\n \t%else %if &Compressedlocale = PortuguesePortugal %then %let QKBlocale = PTPRT;\n\t%else %if &Compressedlocale = RomanianRomania %then %let QKBlocale = ROROU;\n\t%else %if &Compressedlocale = RussianRussia %then %let QKBlocale = RURUS;\n\t%else %if &Compressedlocale = SlovakSlovakia %then %let QKBlocale = SKSVK;\n\t%else %if &Compressedlocale = SlovenianSlovenia %then %let QKBlocale = SLSVN;\n\t%else %if &Compressedlocale = SpanishArgentina %then %let QKBlocale = ESARG;\n\t%else %if &Compressedlocale = SpanishMexico %then %let QKBlocale = ESMEX;\n\t%else %if &Compressedlocale = SpanishSpain %then %let QKBlocale = ESESP;\n \t%else %if &Compressedlocale = SwedishSweden %then %let QKBlocale = SVSWE;\t\n \t%else %if &Compressedlocale = ThaiThailand %then %let QKBlocale = THTHA;\n \t%else %if &Compressedlocale = TurkishTurkey %then %let QKBlocale = TRTUR;\n\t%else %let QKBlocale = ENUSA;\n\n%mend;\n%setLoc(&selectedLocale);\n\n%put Compressed Locale: &Compressedlocale;\n%put QKB Locale: &QKBlocale;\n\n\n\n/* Load Selected QKB Locale */\n%DQLOAD(DQLOCALE=(&QKBlocale));\n \n\n/* Apply Data Masking Standardization Definition */\ndata &outTable;\n\tset &inTable;\n\t&maskedColumn_name=dqStandardize(&inColumn_1_name,\"&selectedDefinition\", \"&QKBlocale\");\nrun;"}}