The macro does not interact with SAS tables nor does it read data from external sources or SASHELP. It operates exclusively on a character string provided as an argument, performing internal text manipulations to produce a substring. The 'data' processed is therefore the textual argument of the macro itself.
1 Code Block
Logging Directives
Explanation : This block contains `%put` directives used to display informative messages in the SAS log. The first line confirms the call to the `_OPTION` macro with an execution date. The second line displays the author's copyright information. The third line (`%put;`) inserts a blank line into the log to improve readability.
Copied!
%put NOTE: You have called the macro _OPTION, 2004-03-29.;
%put NOTE: Copyright (c) 2001-2004 Rodney Sparapani;
%put;
1
%put NOTE: You have called the macro _OPTION, 2004-03-29.;
Explanation : This block defines the `_option` macro which accepts an argument `arg1` (the character string to analyze). A local macro variable `i` is declared to store the position of the first opening parenthesis `(`. The `%index` function is used to find this position. If a parenthesis is found (`%if &i %then`), the `%substr` function extracts the substring starting just after this opening parenthesis until the end of the string. This substring, supposed to contain the dataset options, is returned by the macro.
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
Copyright Info : Copyright (c) 2001-2004 Rodney Sparapani. Distributed under the terms of the GNU General Public License, version 2 or later, without any explicit or implicit warranty.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.