The data used are literal character strings passed directly as arguments to macro calls. No external or internal data (like SASHELP) is explicitly read or generated into datasets.
1 Code Block
Macro Call
Explanation : Tests if the string 'abc' has 'abc' as a suffix. The expected result is 1 (true).
Copied!
%asserteq(1,%hassuffix(abc,abc));
1
%asserteq(1,%hassuffix(abc,abc));
2 Code Block
Macro Call
Explanation : Tests if the string 'abc' has 'c' as a suffix. The expected result is 1 (true).
Copied!
%asserteq(1,%hassuffix(abc,c));
1
%asserteq(1,%hassuffix(abc,c));
3 Code Block
Macro Call
Explanation : Tests if the string 'abc' has 'a' as a suffix. The expected result is 0 (false).
Copied!
%asserteq(0,%hassuffix(abc,a));
1
%asserteq(0,%hassuffix(abc,a));
4 Code Block
Macro Call
Explanation : Tests the %hassuffix macro with empty arguments, which is generally interpreted as (empty string, empty string). The expected result is 1 (true).
Copied!
%asserteq(1,%hassuffix());
1
%asserteq(1,%hassuffix());
5 Code Block
Macro Call
Explanation : Tests if an empty string has an empty string as a suffix. The expected result is 1 (true).
Copied!
%asserteq(1,%hassuffix(,));
1
%asserteq(1,%hassuffix(,));
6 Code Block
Macro Call
Explanation : Tests if an empty string has 'a' as a suffix. The expected result is 0 (false).
Copied!
%asserteq(0,%hassuffix(,a));
1
%asserteq(0,%hassuffix(,a));
7 Code Block
Macro Call
Explanation : Tests if the string 'a' has an empty string as a suffix. The expected result is 1 (true).
Copied!
%asserteq(1,%hassuffix(a,));
1
%asserteq(1,%hassuffix(a,));
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.
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.