table columnInfo

Auditing Complex Column Names and Computed Variables in Financial Reports

Scénario de test & Cas d'usage

Business Context

A financial compliance team is auditing a dataset containing special characters in column names and on-the-fly computed variables. They need to ensure that the SAS Viya environment correctly identifies these complex columns (names with spaces, percentages) and to see if 'columnInfo' can acknowledge dynamically computed variables defined in the view.
About the Set : table

Loading, saving, and managing in-memory tables.

Discover all actions of table
Data Preparation

Creation of a table with special characters in column names.

Copied!
1 
2DATA casuser.finance_report;
3LENGTH 'Account ID'n 8 'Risk % Score'n 8;
4'Account ID'n = 998877;
5'Risk % Score'n = 0.85;
6FORMAT 'Risk % Score'n percent8.1;
7 
8RUN;
9 

Étapes de réalisation

1
Run columnInfo on the table including a temporary computed variable in the table definition.
Copied!
1 
2PROC CAS;
3TABLE.columnInfo RESULT=r / TABLE={name='finance_report', caslib='casuser', computedVars={{name='Adjusted_Score', label='Score * 100'}}, computedVarsProgram='Adjusted_Score = "Risk % Score"n * 100;
4'};
5PRINT r;
6 
7QUIT;
8 

Expected Result


The result table should list the physical columns ('Account ID', 'Risk % Score') with their complex names handled correctly. Depending on exact CAS behavior, it may or may not list 'Adjusted_Score' (often columnInfo reflects physical structure, but this tests the edge case of whether metadata reflects the view definition provided in the 'table' parameter).