Releases all objects that are checked out by the current client session. This action is particularly useful when a session does not have an active transaction and needs to release locks on metadata objects. It acts as a global check-in for the session.
To demonstrate `checkInAllObjects`, we first need an object to be in a 'checked-out' state. This code loads the `cars` table into memory and then uses the `checkOutObject` action to place a lock on it. This simulates a scenario where an object is being edited or reserved.
| 1 | PROC CAS; |
| 2 | TABLE.loadTable / caslib="casuser" path="cars.sashdat" casout={name="cars", replace=true}; |
| 3 | ACCESSCONTROL.checkOutObject / uri="cas/caslibs/casuser/tables/cars"; |
| 4 | RUN; |
This example shows the simplest way to use the `checkInAllObjects` action. It releases all locks on objects that were previously checked out by the current session.
| 1 | PROC CAS; |
| 2 | ACCESSCONTROL.checkInAllObjects; |
| 3 | RUN; |
This detailed example demonstrates a complete workflow. First, a table is checked out. The `whatCheckoutsExist` action is used to verify the checkout status. Finally, `checkInAllObjects` is called to release all locks, and the status is verified again to confirm the check-in was successful.
| 1 | PROC CAS; |
| 2 | /* Step 1: Ensure a table is loaded and checked out */ |
| 3 | TABLE.loadTable / caslib="casuser" path="cars.sashdat" casout={name="cars", replace=true}; |
| 4 | ACCESSCONTROL.checkOutObject / uri="cas/caslibs/casuser/tables/cars"; |
| 5 | |
| 6 | /* Step 2: Verify the checkout exists */ |
| 7 | ACCESSCONTROL.whatCheckoutsExist; |
| 8 | |
| 9 | /* Step 3: Check in all objects for the session */ |
| 10 | ACCESSCONTROL.checkInAllObjects; |
| 11 | |
| 12 | /* Step 4: Verify the checkout is released */ |
| 13 | ACCESSCONTROL.whatCheckoutsExist; |
| 14 | RUN; |
A Data Governance team needs to update the column labels and formats for multiple sensitive tables (Clients and Transactions) to ensure regulatory compliance. The tables must be...
A nightly ETL batch process manages temporary staging tables for different regions. If the process encounters a logic error mid-stream, it leaves multiple tables in a 'checked-o...
A junior developer attempts to use `checkInAllObjects` inside an active database transaction. According to the documentation, this is incorrect usage. The system must ignore the...