Published on :
Administration CREATION_INTERNE

Checking system options and macro variables

This code is also available in: Deutsch Español Français
Attention : This code requires administrator privileges.
The script initializes an analysis of the SAS© environment by inspecting the `SASAUTOS` system option using `PROC OPTIONS`. This confirms the paths where SAS© searches for autocall macros. Next, it uses the `%sysget` macro function to print the values of the `advtech` and `sasautos` system or environment variables, providing information about technical configuration and macro libraries. Finally, the script illustrates string manipulation with `%let`, `%left`, and `%trim` to process and display a macro variable, demonstrating basic macro programming functionalities.
Data Analysis

Type : CREATION_INTERNE


The script does not use external data or SAS tables for its processing. It focuses on querying and manipulating system parameters and internal SAS macro variables.

1 Code Block
PROC OPTIONS
Explanation :
This block uses the `PROC OPTIONS` procedure to display the current value of the `SASAUTOS` system option. This option is crucial because it defines the directories in which SAS searches for autocall macros, thus influencing the availability of macro utilities in the session.
Copied!
1PROC OPTIONS option=sasautos;
2RUN;
2 Code Block
Macro
Explanation :
These lines employ the `%sysget` macro function to retrieve and display the values associated with the `advtech` and `sasautos` environment or macro variables. `advtech` may contain information about advanced technologies or specific configurations, while `sasautos` confirms the paths to autocall macros.
Copied!
1%put %sysget(advtech);
2%put %sysget(sasautos);
3 Code Block
Macro
Explanation :
This block demonstrates the creation and manipulation of a macro variable. The `%trim` macro function removes leading and trailing spaces from a string, and `%left` left-aligns the result. The cleaned value is then assigned to the macro variable `a`, whose content is displayed to verify the result of the string manipulation.
Copied!
1%let a = %left(%trim( aaaaaaaaaa));
2%put |&a|;
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.
Copyright Info : * E14_3_1.sas * Checking system options after a config file modification.


Banner
Expert Advice
Expert
Simon
Expert SAS et fondateur.
« Mastering the interaction between the SAS macro facility and the underlying operating system is a core skill for any senior developer. This script demonstrates a two-pronged approach: validating the autocall search paths and ensuring data integrity through string normalization. »