Scénario de test & Cas d'usage
Creation of a loan dataset containing PII (SSN) and some missing Status values to test filtering.
| 1 | |
| 2 | DATA casuser.loans_pii; |
| 3 | LENGTH STATUS $10; |
| 4 | DO i = 1 to 50; |
| 5 | Loan_ID = i; |
| 6 | SSN = '999-00-' || put(i, z4.); |
| 7 | IF mod(i, 10) = 0 THEN STATUS = ''; |
| 8 | ELSE STATUS = 'Active'; |
| 9 | OUTPUT; |
| 10 | END; |
| 11 | |
| 12 | RUN; |
| 13 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.copyTable / TABLE={name='loans_pii', caslib='casuser', vars={'Loan_ID', 'Status'}, where='Status is not null'}, casout={name='audit_clean_loans', caslib='casuser', replace=true}; |
| 4 | |
| 5 | RUN; |
| 6 |
| 1 | |
| 2 | PROC CAS; |
| 3 | TABLE.columnInfo / TABLE={name='audit_clean_loans', caslib='casuser'}; |
| 4 | |
| 5 | RUN; |
| 6 |
The 'audit_clean_loans' table is created without the 'SSN' column. Rows with missing 'Status' are excluded (count should be 45 instead of 50). The table successfully replaced any previous version.