table attribute

Data Lineage and PII Tagging for Regulatory Compliance

Scénario de test & Cas d'usage

Business Context

A financial institution needs to track data lineage for its customer analytics table. They must tag the table with its source system, refresh date, and data steward. Additionally, specific columns containing Personally Identifiable Information (PII) must be flagged for security and auditing purposes.
About the Set : table

Loading, saving, and managing in-memory tables.

Discover all actions of table
Data Preparation

Create a sample customer accounts table with sensitive and non-sensitive columns.

Copied!
1DATA casuser.customer_accounts;
2 LENGTH AccountID $ 10 CustomerName $ 50 SSN $ 11;
3 INPUT AccountID $ CustomerName $ Balance SSN $;
4 DATALINES;
5ACC1001 'John Smith' 15000 123-456-7890
6ACC1002 'Jane Doe' 250000 987-654-3210
7ACC1003 'Peter Jones' 5200 555-444-3333
8;
9RUN;

Étapes de réalisation

1
Load the customer data into an in-memory CAS table.
Copied!
1PROC CAS;
2 TABLE.loadTable /
3 caslib='CASUSER'
4 path='customer_accounts.sashdat'
5 casOut={name='CUSTOMER_ACCOUNTS', replace=true};
6RUN;
2
Add table-level attributes for data lineage (Data Owner, Source System).
Copied!
1PROC CAS;
2 TABLE.attribute /
3 task='ADD'
4 name='CUSTOMER_ACCOUNTS'
5 caslib='CASUSER'
6 SET='DataLineage'
7 attributes={{key='DataOwner', value='Analytics Dept'}, {key='SourceSystem', value='CRM_PROD'}};
8RUN;
3
Add column-level attributes to flag PII data.
Copied!
1PROC CAS;
2 TABLE.attribute /
3 task='ADD'
4 name='CUSTOMER_ACCOUNTS'
5 caslib='CASUSER'
6 SET='Security'
7 attributes={{key='PII_Classification', value='Confidential', column='CustomerName'}, {key='PII_Classification', value='Highly Confidential', column='SSN'}};
8RUN;
4
Update a table-level attribute to reflect a data refresh.
Copied!
1PROC CAS;
2 TABLE.attribute /
3 task='UPDATE'
4 name='CUSTOMER_ACCOUNTS'
5 caslib='CASUSER'
6 SET='DataLineage'
7 attributes={{key='LastRefreshDate', value='2025-11-26T10:00:00Z'}};
8RUN;
5
Export all attributes to a new CAS table for auditing purposes and fetch the results.
Copied!
1PROC CAS;
2 TABLE.attribute /
3 task='EXPORT'
4 name='CUSTOMER_ACCOUNTS'
5 caslib='CASUSER'
6 TABLE='AUDIT_ATTRIBUTES';
7 
8 TABLE.fetch / TABLE='AUDIT_ATTRIBUTES';
9RUN;
10QUIT;

Expected Result


A new CAS table 'AUDIT_ATTRIBUTES' is created. It should contain four rows: two for the table-level attributes ('DataOwner', 'LastRefreshDate') and two for the column-level PII attributes ('PII_Classification' for 'CustomerName' and 'SSN'). The value for 'LastRefreshDate' should be the updated one.