The stored process code is generated on the fly within the script (Data Step _NULL_). The analyzed data are the execution results of these processes.
1 Code Block
DATA STEP
Explanation : Generation of two temporary files containing the SAS source code for the simulated Stored Processes (STP) for testing.
Copied!
filename stpcode1 temp;
data _null_;
file stpcode1;
put '%put hello world;';
put '%put _all_;';
put 'data _null_; file _webout1; put "triggerstp test 1";run;';
run;
filename stpcode2 temp;
/* ... creation stpcode2 ... */
1
filename stpcode1 temp;
2
DATA _null_;
3
file stpcode1;
4
put '%put hello world;';
5
put '%put _all_;';
6
put 'data _null_; file _webout1; put "triggerstp test 1";run;';
7
RUN;
8
filename stpcode2 temp;
9
/* ... creation stpcode2 ... */
2 Code Block
Macro Call
Explanation : Obtaining unique file names and physically creating the test .sas files in the `/sasjs/tests/` directory from the previously generated code.
Explanation : Execution of Stored Processes via `ms_triggerstp`. Results are consolidated in `work.mySessions`. `mp_assertscope` monitors macro/global environment pollution.
Explanation : Analysis of the content of the results table to ensure that `sessionID` is not missing, with the result stored in a macro variable for the final assertion.
Copied!
data _null_;
retain contentCheck 1;
set work.mySessions end=last;
if missing(sessionID) then contentCheck = 0;
if last then do;
call symputx("contentCheck",contentCheck,"l");
end;
run;
1
DATA _null_;
2
retain contentCheck 1;
3
SET work.mySessions END=last;
4
IF missing(sessionID) THEN contentCheck = 0;
5
IF last THENDO;
6
call symputx("contentCheck",contentCheck,"l");
7
END;
8
RUN;
6 Code Block
Macro Call
Explanation : Deletion of temporary SAS files created for the test to leave the system clean.
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.