?>Array ( [id] => 5 ) Server Health Check: Identify Large Tables Across All User Workspaces - WeAreCAS
accessControl accessPersonalCaslibs

Server Health Check: Identify Large Tables Across All User Workspaces

Scénario de test & Cas d'usage

Contexte Métier

A CAS server is experiencing memory pressure. A CAS administrator needs to quickly investigate if any users are storing excessively large tables in their personal caslibs. The goal is to get a server-wide overview of personal data storage without checking users one by one.
Préparation des Données

Simulate a multi-user environment. 'analyst_a' has small work tables. 'data_scientist_b' has loaded a very large table, which is the likely cause of the memory issue. 'user_c' has an empty caslib.

Copié !
1/* Data setup requires admin privileges */
2PROC CAS;
3 /* Analyst A's small tables */
4 DATA casuser(analyst_a).lookup_codes(promote=yes);
5 DO i=1 to 100; code=i; OUTPUT; END;
6 RUN;
7 
8 /* Data Scientist B's large table */
9 DATA casuser(data_scientist_b).large_dataset(promote=yes);
10 DO i=1 to 5000000; x=rand('NORMAL'); y=rand('UNIFORM'); OUTPUT; END;
11 RUN;
12 
13 /* User C has no tables, just an active session */
14QUIT;

Étapes de réalisation

1
Enable Server-Wide Access: Run the accessPersonalCaslibs action to see into all user caslibs.
Copié !
1PROC CAS;
2 ACCESSCONTROL.accessPersonalCaslibs;
3RUN;
2
Global Table Listing: Run the table.tableInfo action with a caslib pattern or for all known users to get a list of all tables in all personal caslibs. Here we check the three simulated users explicitly.
Copié !
1PROC CAS;
2 /* In a real script, you might loop through a list of users */
3 TABLE.tableInfo / caslib="CASUSER(analyst_a)";
4 TABLE.tableInfo / caslib="CASUSER(data_scientist_b)";
5 TABLE.tableInfo / caslib="CASUSER(user_c)";
6RUN;

Résultat Attendu


The administrator successfully executes table.tableInfo against multiple user caslibs in a single session. The results will show the small table for 'analyst_a', the very large table for 'data_scientist_b' (identifiable by its row count and size), and an empty result set for 'user_c'. This confirms the action is effective for server-wide diagnostics.