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.
The settings used to format the code are located in the Program pull-down menu, selecting "Editor Options", and then selecting the "Indenter Tab".
These settings allow the user to modify indentation sizes, and the insertion of blank lines before particular statements.