Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

Outputting Macro Generated Code to a File Using MPRINT

A useful technique when debugging complicated macros, is to route all macro generated code to a file by using the MPRINT and MFILE options. The advantage of this over just using MPRINT and looking at the log window, is that the file only contains the code written by the macro and is free of clutter such as messages, printed values, logic flows etc.

Syntax:

filename mprint 'macro.txt';
options mprint mfile;
%macro test_it;
%* Your SAS Code;
%mend test_it;