The macro does not read any external data or from the SASHELP library. It operates exclusively on character strings passed as parameters during its call.
1 Code Block
%PUT
Explanation : Displays initial notes in the SAS log, including the call date and copyright information.
Copied!
%put NOTE: You have called the macro _COUNT, 2022-06-07.;
%put NOTE: Copyright (c) 2001-2022 Rodney Sparapani;
1
%put NOTE: You have called the macro _COUNT, 2022-06-07.;
Explanation : Definition of the '_count' macro. It initializes a local counter 'i' to 0. Then, a '%do %while' loop iterates through the input string ('text') using the '%qscan' function to extract elements one by one, based on the 'split' delimiter. The counter 'i' is incremented for each element found. After the loop, the macro checks for a specific warning and stops in case of an issue. Otherwise, it returns the final value of the counter 'i'. If the 'notes' parameter is provided, the returned value is also displayed in the log.
%put ERROR: _COUNT() cannot recover from warning: ABEND;
12
%_abend();
13
%END;
14
%ELSE &i;
15
16
%IF %LENGTH(¬es) %THEN %put NOTE: _COUNT is returning the value: &i.;
17
%mend _count;
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-2022 Rodney Sparapani. The code is distributed under the terms of the GNU General Public License (GPL) version 2 or later.
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.