Published on :
Macro INTERNAL_CREATION

AHGwt Macro - Writing to a file

This code is also available in: Deutsch Español Français
Awaiting validation
The 'AHGwt' macro uses a DATA _NULL_ step to redirect output to a file specified by the 'file' parameter and writes the content of the 'str' parameter to it. This is a simple method to generate log files, scripts, or control files from SAS©.
Data Analysis

Type : INTERNAL_CREATION


No external data read. The written content comes directly from the 'str' parameter provided in the macro call.

1 Code Block
DATA STEP Data
Explanation :
Definition of the macro that initializes a DATA _NULL_ step (without creating a SAS table). The 'file' statement points to the target file, and 'put' writes the string.
Copied!
1%macro AHGwt(file,str=%str());
2DATA _null_;
3 file "&file";
4 put "&str";
5RUN;
6%mend;
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.