![]() ![]() Some commonly used Macros are - %END, %RETURN, and %PUT. These are two types of Macro variables, Global, Local, and a Macro program begins with a %MACRO and ends with a %MEND. Not only does this save time but also ensures that the code is error-free. The SAS Macros allow us to reuse code in various locations without having to repeat it all the time. Codeīecome a Better Data Professional With Simplilearn The %end statement marks the end of the DO loop, whereas the %mend statement marks the end of the macro. The macro named test in the example below accepts user input and uses it to perform the DO loop. This macro definition includes a %DO %WHILE loop that finishes with a percent END statement, as required. ![]() When the variable val’s value reaches 10, the macro quits otherwise, it continues. When this macro is run, it causes the currently running macro to terminate normally if a specified condition is found to be true. The variable today's value is recorded to the program log in the example below. The SAS log is updated by this macro statement, which writes macro variables or text information. Now, let us look at some of the examples in depth. Recording the runtime value of a variable in the program log. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |