The builtins.history action shows the actions that were run in the current session. This action provides a record of executed commands, which can be useful for debugging, auditing, or recreating workflows. You can specify the range of actions to report, the language for the returned commands, and whether to print the information to the client log.
| Parameter | Description |
|---|---|
| casOut | Specifies the settings for saving the action history to an output table. This parameter includes subparameters like 'caslib' (string for caslib name), 'compress' (TRUE | FALSE), 'indexVars' (list of variable names to index), 'label' (string for table label), 'lifetime' (64-bit-integer for table lifetime), 'maxMemSize' (64-bit-integer for maximum memory size), 'memoryFormat' ('DVR', 'INHERIT', or 'STANDARD'), 'name' (string for table name), 'promote' (TRUE | FALSE), 'replace' (TRUE | FALSE), 'replication' (integer for replication factor), 'tableRedistUpPolicy' ('DEFER', 'NOREDIST', or 'REBALANCE'), 'threadBlockSize' (64-bit-integer), 'timeStamp' (string), and 'where' (list of strings for WHERE clause). For more information about specifying the casOut parameter, see the common casouttable parameter. |
| first | Specifies the ordinal position for the first action to report on. Negative values are subtracted from the current action's ordinal position. Default is 1. |
| last | Specifies the ordinal position of the last action to report on. Negative values are subtracted from the current action's ordinal position. Default is -1. |
| syntax | Specifies the language in which to return the action commands invoked in a session. Options are 'CASL', 'LUA', or 'ASLOGGED'. Default is 'ASLOGGED'. |
| verbose | Prints action information to the client log as well as returns the action information in the results. Default is TRUE. |
This example shows how to use the history action to retrieve information about actions executed in the current CAS session. This can be useful for reviewing past operations or for debugging purposes.
| 1 | PROC CAS; |
| 2 | ACTION BUILTINS.history; |
| 3 | RUN; |
| 4 | QUIT; |