Programming Guidelines - HMS-Analytical-Software/SASUnit GitHub Wiki
As in all programming guidelines one shall use common sense.
When developing SASUnit macros and programs please stick to the programming conventions you find there.
General Guidelines:
- Comment the source code where necessary to explain why it happens here.
What happens here is often evident through the source code.
If not then add comments to clarify. - Add headers for the program documentation
- Refactoring is always beneficial, but don't over do it.
Here are some guidelines specific for the SASUnit environment
- General naming conventions for
- data sets
- Names of temporary data sets should start with '_' (e.g. work._data_set_abc)
- variables
- Variable names in data sets should be descriptive
- macro symbols
- Global macro variables start with 'g_' local ones with 'l_'
- Declare all local macro variables by %local;
- macro programs
- The name of the macro program files must be lowercase
- SAS autocall facility expects that under Linux
- Components of program names can be seperated by '_'.
No Camel Case, no Snake Case.
Macros that are not part of the SASUnit interface start with '_' to mark them as 'helper' macros
- The name of the macro program files must be lowercase
- data sets
- Structure and naming conventions of macro programs for assertions
- Macros for assertions follow this convevntion: 'assert<function>'
- Structure and naming conventions of macro programs for reporting
- Macros used for reporting follow this convention: 'report<function>'
- Because we have many reporting macros for rendering the have a separate convention: '_render_<function>'