SUPPORT / SAMPLES & SAS NOTES
 

Support

Sample 26152: Retrieving the number of words in a macro variable

DetailsCodeOutputAboutRate It

This sample uses a macro to count the number of words contained in a macro variable. The macro is using a space as the delimiter.

Note: If you are counting the number of words in a non-macro variable, the COUNT, COUNTC or COUNTW functions can be used in a DATA step for SAS® 9 and later releases.




These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.