Macro Variable Management

This code is also available in: Deutsch Español Français
Difficulty Level
Beginner
Published on :
The script defines two distinct macro variables, 'First' and 'Second', with character strings. Then, it creates a third macro variable, 'both', by concatenating the values of the first two. Finally, it uses the %PUT macro to display the content of these variables in the SAS© log, demonstrating the expansion of macro variables.
Data Analysis

Type : CREATION_INTERNE


The data manipulated are character strings assigned to macro variables directly within the script. No external data source or SAS dataset is used.

1 Code Block
MACRO STATEMENT Data
Explanation :
This block uses the %LET statement to define the macro variables 'First', 'Second', and 'both'. The 'both' variable combines the values of 'First' and 'Second'. The %PUT statement is then used to write literal text and the values of the macro variables ('First', 'Second', 'both') to the SAS log, allowing their content and expansion to be verified.
Copied!
1/* This is a comment */
2* And this is another comment ;
3%LET First=SAS; %LET Second = Program;
4%LET both
5= &first &SECOND;
6%PUT The results are: &First, &Second, --- &Both.ming;
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.

Related Documentation

Aucune documentation spécifique pour cette catégorie.