The macro operates on a character string provided as a positional parameter during its call. No external or internal data (SASHELP) is read by the macro itself. Data is processed directly from the macro call arguments.
1 Code Block
MACRO nocommas
Explanation : This block defines the `%nocommas` macro. The `PARMBUFF` option allows the macro to access the complete character string passed as a parameter, including parentheses. The `%SYSFUNC(TRANSLATE(&SYSPBUFF, %STR( ), %STR(,)))` function is used to replace all occurrences of the comma character (`,`) with a space (` `) in the `&SYSPBUFF` string. Then, `%QSUBSTR(..., 2, %LENGTH(&SYSPBUFF)-2)` extracts a substring from the result, removing the first and last characters (generally corresponding to the `%` of the macro call and the ending `;`, or the parentheses enclosing the parameter) to obtain only the processed string.
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 : This is public domain software. No guarantee as to suitability or accuracy is given or implied. User uses this code entirely at their own risk.
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.