The `_DATA` macro is a utility function that manipulates character strings passed as arguments. It does not directly read from or write to existing SAS tables. Its inputs are strings representing SAS table references, and its output is a character string corresponding to the extracted table name.
1 Code Block
Macro definition `_DATA`
Explanation : This block defines the `_DATA` macro. It uses a conditional `%if` statement with `%index` to check for the presence of a period ('.') in the argument `&arg1`. If a period is present, the `%scan` macro function extracts the second element of the string (the table name), using the period and the opening parenthesis character `%str(()` as delimiters to handle table options. Otherwise, `%scan` extracts the first element using only the opening parenthesis character as a delimiter. The `%lowcase` function is applied to the result to ensure the table name is returned in lowercase. The `%str(%)` character is used to escape the opening parenthesis within `%scan`.
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-2007 Rodney Sparapani. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
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.