The script does not manipulate persistent external data. It interacts with the SAS environment via system options (`MPRINT`, `MLOGIC`) and macro variables (`g_cre_result`, `l_mprint`, `l_mlogic`) created and managed dynamically during test execution. The primary goal is not data transformation but the validation of a system macro's behavior.
1 Code Block
Test scenario initialization
Explanation : This block initializes the test scenario with a clear description of its objective. It also declares the global macro variable `g_cre_result` and initializes it to -1. This variable will be used to capture the return code of the `_checkRunEnvironment.sas` macro being tested.
Copied!
%initScenario(i_desc=Test of _checkRunEnvironment.sas);
%global g_cre_result;
%let g_cre_result=-1;
1
%initScenario(i_desc=Test of _checkRunEnvironment.sas);
2
3
%global g_cre_result;
4
%let g_cre_result=-1;
2 Code Block
Test case execution and validation
Explanation : This block defines a test case for a successful call to `_checkRunEnvironment.sas`. It first saves the current states of the `MPRINT` and `MLOGIC` system options, then activates them for diagnosis. The `_checkRunEnvironment` macro is then called, and its result is stored in `g_cre_result`. The `MPRINT` and `MLOGIC` options are restored to their initial state. Finally, assertions are used: `%assertEquals` verifies that the macro's result is 0 (indicating success), and `%assertLogMsg` confirms the absence of specific messages in the log, ensuring that the environment is correctly evaluated.
Explanation : This block marks the formal end of the test scenario, closing all ongoing test operations and consolidating the results.
Copied!
%endScenario();
1
%endScenario();
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 2010-2023 HMS Analytical Software GmbH, http://www.analytical-software.de This file is part of SASUnit, the Unit testing framework for SAS(R) programs. For copyright information and terms of usage under the GNU Lesser General Public License see included file README.md or https://github.com/HMS-Analytical-Software/SASUnit/wiki/readme/.
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.