builtins

history

Description

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.

builtins.history <result=results> <status=rc> / <casOut={caslib="string", compress=TRUE | FALSE, indexVars={"variable-name-1" <, "variable-name-2", ...>}, label="string", lifetime=64-bit-integer, maxMemSize=64-bit-integer, memoryFormat="DVR" | "INHERIT" | "STANDARD", name="table-name", promote=TRUE | FALSE, replace=TRUE | FALSE, replication=integer, tableRedistUpPolicy="DEFER" | "NOREDIST" | "REBALANCE", threadBlockSize=64-bit-integer, timeStamp="string", where={"string-1" <, "string-2", ...>}}, first=integer, last=integer, syntax="CASL" | "LUA" | "ASLOGGED", verbose=TRUE | FALSE ;
Settings
ParameterDescription
casOutSpecifies 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.
firstSpecifies the ordinal position for the first action to report on. Negative values are subtracted from the current action's ordinal position. Default is 1.
lastSpecifies the ordinal position of the last action to report on. Negative values are subtracted from the current action's ordinal position. Default is -1.
syntaxSpecifies the language in which to return the action commands invoked in a session. Options are 'CASL', 'LUA', or 'ASLOGGED'. Default is 'ASLOGGED'.
verbosePrints action information to the client log as well as returns the action information in the results. Default is TRUE.

Examples

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.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 ACTION BUILTINS.history;
3RUN;
4QUIT;
Result :
The action returns a list of actions that have been run in the current session. The output typically includes the action name, parameters, and execution status for each historical action.

FAQ

What is the purpose of the builtins.history action?
How can I save the action history to an output table?
How do I specify the starting action for the history report?
How do I specify the ending action for the history report?
Which languages can the action commands be returned in?
What is the 'verbose' parameter used for?