table addCaslibSubdir

Standard Use Case: Marketing Campaign Folder Organization

Scénario de test & Cas d'usage

Business Context

A marketing department needs to structure its data for a new campaign. They require a dedicated, secure subdirectory within their main caslib to store customer lists, creative assets, and performance results. Access needs to be controlled for collaboration and compliance.
About the Set : table

Loading, saving, and managing in-memory tables.

Discover all actions of table
Data Preparation

Initial setup of the primary marketing caslib. This ensures a valid target location exists before attempting to add a subdirectory. The path '/cas/data/mktg' is assumed to exist on the CAS server.

Copied!
1 
2PROC CAS;
3caslib mktgData path='/cas/
4data/mktg' dataSource={srcType='path'} description='Main caslib for marketing analytics';
5RUN;
6 

Étapes de réalisation

1
Create a new subdirectory for the 'Winter_Promo_2025' campaign with specific group permissions to allow the marketing team to read and write, while other departments can only read.
Copied!
1PROC CAS;
2 TABLE.addCaslibSubdir /
3 caslib='mktgData',
4 path='Winter_Promo_2025',
5 permission='GROUPWRITEPUBLICREAD';
6RUN;
2
Create a nested subdirectory to store campaign results. This tests the ability to create directories within a newly created subdirectory.
Copied!
1PROC CAS;
2 TABLE.addCaslibSubdir /
3 caslib='mktgData',
4 path='Winter_Promo_2025/results';
5RUN;
3
Verify the creation and permissions of the new directories using the fileInfo action. This confirms the successful execution of the previous steps.
Copied!
1 
2PROC CAS;
3TABLE.fileInfo / caslib='mktgData' path='Winter_Promo_2025/';
4RUN;
5 

Expected Result


The action successfully creates the 'Winter_Promo_2025' directory and its nested 'results' subdirectory inside the '/cas/data/mktg' path. The `fileInfo` action output will list the 'results' directory, and the 'Winter_Promo_2025' directory itself will have file system permissions equivalent to 775 (rwxrwxr-x), confirming the 'GROUPWRITEPUBLICREAD' setting was applied correctly.