If it does a new one should be generated and checked for its existence. Once written they serve to save the user a lot of work and time, they limit the chances option symbolgen programming errors and they promote standardization of output, whether that consists of datasets or tables, option symbolgen and the like. Testing with all variations of argument input parameters, check their effects, testing with option symbolgen but known erroneous data and argument parameters fool proof testingoption symbolgen for appropriate responses, error reports and their consistent layout and verify whether all parameters are being checked on validity legal SAS names, limited options, numbers, etc.
It may be virtually impossible to check all possible option symbolgen in the functionality of a complex macro. Just like with usual dedicated option symbolgen code a macro should take care to produce that output in at least the same quality as the dedicated program would have produced it. It is quite common to add footnotes to output with information on the date of production, the SAS version, the option symbolgen program name and its author and possible the macro name and version.
If in any subsequent version new bugs emerge it is possible to analyze option symbolgen which change the bug most likely has been caused. Next to a large amount of advice on option symbolgen aspects of macro validation many programming hints are issued with respect to improving macro code quality. Then amidst all macro code just a single SAS statement is essential:.
Verify presence of auxiliary macros separate or appended in same file It is especially recommended if it is to be expected that the validation process option symbolgen be a complex process with many tests to perform. Other default values may indicate the most option symbolgen statistics to be calculated valid number, missing number, mean, standard deviation, median, etc. This statement directly increases the ErrCount macro variable from the higher level because option symbolgen is being resolved as:.
Option symbolgen is left to the judgment of the validating person to decide whether choosen default values are option symbolgen in the context. Comments may be on separate lines before the described code if long or introductory. This on itself is no problem at all. Review of argument specifications incl.
It would even be possible to let the newer macro automatically run the older one if forced to, but that is not always necessary. CalledBy The CalledBy macro argument is especially used with auxiliary macros being called from the main macro:. From a user point of view a standard macro may be regarded to be divided into two logically different parts:. Option symbolgen example option symbolgen an alternative for a complex macro variable which value is conditionally dependent on several situations, macro CompBloc:.
Option symbolgen several tests, if a variable does not appear to exist in the dataset the ErrCount macro variable at the option symbolgen level has to be increased by A macro should extensively check all parameter values and during the validation process option symbolgen only the macro code has to be studied to see whether these checks are present, but the macro should also extensively be checked whether it can get to a state that the macro author did not foresee and which aborts the macro in a very user unfriendly way, generating many SAS errors, or a state in which the option symbolgen continues producing erroneous results. A macro may use SAS system options and set them to specific values irrespective of the values up to the macro call. Instead of or next to a macro name stored as the value of a macro variable MacName any information may be given to it, e.
Review of argument specifications incl. Such a report may contain the following paragraphs: After all the value on itself is not a valid statement in the calling SAS or option symbolgen code option symbolgen calls the concerning macro function. Read source code, verify correct programming according to functional specifications and the extent of algorithm efficiency 6.
It would even be possible to let the newer macro automatically run the older one if forced to, but that is not always necessary. It should make no difference whatsoever which method is applied. Unique, random names The following two examples both pilot macros to be developed further generate a random SAS name for use as a dataset name or, if modified, as a variable name. This number is checked against the hard coded version number inside the macro, and option symbolgen they agree or if Option symbolgen is specified empty the macro is allowed to run as usual. Via that argument option symbolgen is able to force specific actions, which are not used during normal operation.
Possibly incompatible or at least different results are thus being avoided. Results of all kinds of parameters with all macro option symbolgen, incl. It option symbolgen up to the validating person to judge whether the output quality is sufficient.