This program tests the 'mf_wordsinstr1andstr2' macro, which identifies words present in a first string that are also found in a second. The result is stored in a macro variable, then validated via the 'mp_assert' assertion macro which generates a results table in the WORK library.
Data Analysis
Type : CREATION_INTERNE
No external data is read. Inputs are static character strings defined in the code. The output table 'work.test_results' is created by the test macro.
1 Code Block
MACRO CALL
Explanation : Call to the macro function 'mf_wordsinstr1andstr2' to identify common words between the two strings provided as parameters. The result is stored in the macro variable &x.
Copied!
%let x=%mf_wordsinstr1andstr2(str1=xx DOLLAR x $CHAR xxx W MONNAME
,str2=DOLLAR $CHAR W MONNAME xxxxxx
);
1
%let x=%mf_wordsinstr1andstr2(str1=xx DOLLAR x $CHAR xxx W MONNAME
2
,str2=DOLLAR $CHAR W MONNAME xxxxxx
3
);
4
2 Code Block
MACRO CALL Data
Explanation : Use of the 'mp_assert' macro to verify that the &x variable contains the expected string ('DOLLAR $CHAR W MONNAME'). The test result is recorded in the 'work.test_results' table.
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.