7/31/2023 0 Comments Macro auto comment facebook![]() For example there is no need for a comment that says "sort by id" before code "proc sort by id ". The comments should describe the purpose of the code and not what it is doing. For example if you have two proc sorts followed by a merge then that whole block only needs one comment. This could be a single proc or data steps, but will also frequently be a little less often. I find that it is best to put brief comments before sections of code. * # WARNING: Only works if varx is positive */ The # is something I can search for to find potential land mines is programs that are not used frequently or are one-offs where it may not be worth the time to code around likely problems.Īnd if MACROS are involved maybe comment twice as often. Of if using somewhat obscure code like newvar = (var1=3)*1 + (var2=4)*1 + (var3 = 1)*1 to create a 0 or 1 valued variable in one line instead of a bunch of if /then statements.ĭO note any code that may not work if the range of values changes!!!! I often place a comment like For example I have data sets were coding standards changed over a period of time so there may be date dependent manipulations. I suggest that any not-intuitively-obvious code in a data step have a line or two of comment about why or what it does. Then in the body describe when the outline elements begin. I often at the head of the program have a section of comments to describe in brief english an outline of the program. I think the idea of description of why a data step or block of procs is used is a good idea.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |