?>Array ( [id] => 61 ) Standard Use Case: Marketing Campaign Folder Organization - WeAreCAS
table addCaslibSubdir

Standard Use Case: Marketing Campaign Folder Organization

Scénario de test & Cas d'usage

Contexte Métier

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.
Préparation des Données

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.

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

É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.
Copié !
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.
Copié !
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.
Copié !
1PROC CAS;
2 TABLE.fileInfo / caslib='mktgData' path='Winter_Promo_2025/';
3RUN;

Résultat Attendu


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.