Explanation : Take a snapshot of macro variables, call the tested function `mv_getjobcode` to retrieve the job's code into the 'mycode' fileref, then verify that no unexpected macro variables have been created (scope leak).
Explanation : Read the retrieved code (fileref 'mycode') and compare it line by line with the original string stored in the 'incode' macro variable. If a match, update the success flag.
Copied!
%let diditexist=NO;
data work.test1;
infile mycode;
input;
putlog _infile_;
line=_infile_;
check=symget('incode');
if _infile_=symget('incode') then call symputx('diditexist','YES');
run;
1
%let diditexist=NO;
2
DATA work.test1;
3
INFILE mycode;
4
INPUT;
5
putlog _infile_;
6
line=_infile_;
7
check=symget('incode');
8
IF _infile_=symget('incode') THEN call symputx('diditexist','YES');
9
RUN;
5 Code Block
MACRO CALL
Explanation : Final assertion to validate that the test was successful (the code was correctly retrieved).
Copied!
%mp_assert(
iftrue=(&diditexist=NO),
desc=Check if the code that was sent was successfully retrieved
)
1
%mp_assert(
2
iftrue=(&diditexist=NO),
3
desc=Check IF the code that was sent was successfully retrieved
4
)
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.