Without a good set of coding standards, it will be difficult to incorporate the various subroutines into one program. Consistent naming standards and coding techniques must be considered; specific suggestions include the following:
- Names for variables to be defined in the program should have unique prefixes. The standard could be that variables needed for editing LINE_NUMBER be N01 through N10; those needed for editing AGE would be N11 through N20, and so forth.
- Names for hot-deck arrays should also be standardized. For example, an array for hot decking age by marital status, relationship, and sex would be defined as HD_AGE_MAR_REL_SEX. The variable whose values are in the array (in this case, age) should be named immediately after the prefix (in this case, HD).
- It may be necessary for a procedure to call a function, and standards should be defined for naming them.
- Standards for coding impute statements should be set. If it is desirable to relate an imputation to the original edit specifications (and this is usually helpful), then case numbers should be assigned to every imputation case in the edit specifications document.
- Standards for code indentation should be established so the program is easily readable. CSPro provides an option to format your logic (either for the selected PROC or the entire program). With the cursor in the desired section of your logic, select Edit > Format Logic. (If you don't like the changes, simply undo.)
- Folder and file naming conventions also should be established.