Published on :
Utility CREATION_INTERNE

Log and Output Cleaning

This code is also available in: Deutsch Español Français English
Attention : This code requires administrator privileges.
The `clean` macro is designed to clear the content of various windows in the SAS© Studio or Display Manager environment. It uses the `dm` (Display Manager) command to specifically target the 'output' window, the 'log' window, and the 'odsresult' (ODS results) window, clearing them and allowing the continuation of execution thanks to the 'continue' option. This is useful for preparing the environment before a new execution, for debugging, or to ensure a clean display of results.
Data Analysis

Type : CREATION_INTERNE


This script neither processes nor creates data. It interacts directly with the SAS environment to manage the display of logs and outputs.

1 Code Block
MACRO DEFINITION
Explanation :
This block defines a SAS macro named `clean`. When called, this macro executes a series of `dm` (Display Manager) commands to interact with the SAS user interface windows. Specifically:
- `dm output 'clear' continue;`: Clears the content of the output window.
- `dm log 'clear' continue;`: Clears the content of the SAS log window.
- `dm odsresult 'clear' continue;`: Clears the content of the ODS (Output Delivery System) results window.
The 'continue' option after each command ensures that the SAS program continues its execution even if the specified window is not open or does not exist in the current environment.
Copied!
1%macro clean();
2 dm OUTPUT 'clear' continue;
3 dm log 'clear' continue;
4 dm odsresult 'clear' continue;
5%mend clean();
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.