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.

Customising Your SAS Log

Reading through lines and lines of SAS messages in the log can be a daunting experience. But you might be able to save time and effort if you are able to navigate to the relevant areas faster and customise your messages.

Messages can be written to the Log window using different methods. Macro language has a useful %PUT statement that writes straight to the log window and it is very easy to use. The data step has a similar statement which is PUTLOG (there also exists the PUT statement but this can also write to other destinations other than the log).

Messages can be colour coded by starting them with the keywords ERROR:, WARNING: or NOTE:. It is useful to wrap some of its characters in quoting functions so searching for errors on the log will take you directly to the generated error and not the statement.

Blank lines can also be introduced through skipping or pages can also be jumped to introduce bigger breaks.

Inside the data step, characters can be repeated using the n* notation, lines jumped by using /, underlines created using the OVERPRINT option and lines split by the use of the - symbol.

Finally if a true ERROR is required in the data step (with the consequent Data Step termination and population of the _ERROR_ variable) use the ERROR statement.

Customising your SAS Log image1

 With the following results:

Customising your SAS Log image2