table addCaslib

Volume Test: Global Data Lake Caslib with Subdirectory Access

Scénario de test & Cas d'usage

Business Context

A data engineering team is establishing a central data lake on a Distributed Network File System (DNFS). The caslib must be global (not session-scoped), persistent, and provide access to a deep, partitioned directory structure containing sensor data from thousands of IoT devices.
About the Set : table

Loading, saving, and managing in-memory tables.

Discover all actions of table
Data Preparation

Simulate the creation of a directory structure on the server's file system that the CAS controller can access. This mimics the DNFS path that will be used.

Copied!
1/* This shell command simulates creating the required directory structure. It must be run on the server where the path is accessible. */
2/* mkdir -p /mnt/dnfs_datalake/iot_data/region_a/device_001; */
3/* mkdir -p /mnt/dnfs_datalake/iot_data/region_a/device_002; */
4/* mkdir -p /mnt/dnfs_datalake/iot_data/region_b/device_001; */

Étapes de réalisation

1
Add a global, persistent caslib pointing to the root of the data lake. Enable subdirectory access and request directory creation if it doesn't exist.
Copied!
1PROC CAS;
2 TABLE.addCaslib /
3 name="IoTDatalake"
4 description="Global DNFS Data Lake for IoT Sensor Data"
5 path="/mnt/dnfs_datalake/iot_data/"
6 dataSource={srcType="DNFS"}
7 SESSION=false
8 subDirectories=true
9 createDirectory=true;
10RUN; QUIT;
2
Verify the caslib was created and is global by checking its information. The 'Scope' should be 'Global'.
Copied!
1 
2PROC CAS;
3 
4TABLE.caslibInfo / caslib="IoTDatalake";
5RUN;
6 
7QUIT;
8 
3
Test subdirectory access by listing files from a nested directory within the caslib.
Copied!
1 
2PROC CAS;
3 
4TABLE.fileInfo / caslib="IoTDatalake" path="region_a/device_001";
5RUN;
6 
7QUIT;
8 

Expected Result


The 'IoTDatalake' caslib is created with global scope and persists across sessions. The caslibInfo action shows its scope as 'Global' and its path pointing to the DNFS mount. The fileInfo action successfully lists files within the nested subdirectories, confirming that 'subDirectories=true' is working correctly. The caslib is now a permanent fixture for all CAS users (subject to permissions).