builtins addUserActionSetPath

Boundary Case: Handling Invalid and Duplicate Path Definitions

Scénario de test & Cas d'usage

Business Context

A junior analyst is writing a setup script to configure their environment but makes some errors, such as referencing a non-existent caslib and adding the same valid path twice. The test ensures the CAS server handles these errors gracefully without crashing the session.
About the Set : builtins

Fundamental CAS server system commands.

Discover all actions of builtins
Data Preparation

Create a single valid caslib. No action set is needed as the focus is on the path management itself.

Copied!
1/* Create a single valid directory and caslib */
2%sysexec mkdir -p /cas/
3DATA/casuser/valid_path;
4LIBNAME my_valid_caslib cas caslib='/cas/
5data/casuser/valid_path';
6 

Étapes de réalisation

1
Attempt to add a caslib that does not exist ('nonexistent_caslib').
Copied!
1PROC CAS;
2 /* This should produce a clear error in the log */
3 BUILTINS.addUserActionSetPath / caslib='nonexistent_caslib';
4RUN;
2
Add the legitimate caslib ('my_valid_caslib'). This should succeed.
Copied!
1 
2PROC CAS;
3BUILTINS.addUserActionSetPath / caslib='my_valid_caslib';
4RUN;
5 
3
Attempt to add the same valid caslib ('my_valid_caslib') a second time.
Copied!
1PROC CAS;
2 /* This should be handled gracefully, likely with a note or warning, but not an error */
3 BUILTINS.addUserActionSetPath / caslib='my_valid_caslib';
4RUN;

Expected Result


The first step fails with a specific error message indicating the caslib 'nonexistent_caslib' could not be found. The second step succeeds, adding the valid path. The third step, which adds a duplicate path, completes without raising an error, demonstrating idempotent behavior. The session remains active and stable throughout.