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.

Structuring Code in SAS Enterprise Guide

Traditionally SAS programmers were responsible for structuring their code in a logical and efficient manner. This included the proper use of indentation and spacing to improve the clarity of programs.

Across an organisation, consistency is hard to achieve within programs, especially when produced by multiple programmers. Standards can be set, but are not always adhered to.

SAS Enterprise Guide provides a facility to apply a standard formatting convention to code.

The following example shows a program which has been badly formatted. It is difficult to identify where conditional code blocks start and finish.

If we right-click within the program window and select "Format Code" from the drop down menu, we can see that a consistent structure is applied.

Image 5

Image 6

The settings used to format the code are located in the Program pull-down menu, selecting "Editor Options", and then selecting the "Indenter Tab".

Image 7

Image 8

These settings allow the user to modify indentation sizes, and the insertion of blank lines before particular statements.