This program uses the SASUnit framework to initialize a test scenario. The objective is to validate that a specific autoexec file has been loaded during execution. This is verified by the presence of an expected macro variable (&HUGO) and a specific message in the log. It also executes PROC OPTIONS for indicative purposes or environment verification.
Data Analysis
Type : CREATION_INTERNE
The script does not consume data tables. It relies on the session state (macro variables) and execution logs generated by the test framework.
1 Code Block
SASUNIT MACROS
Explanation : Initialization of the SASUnit test scenario and definition of the first test case targeting '_dummy_macro.sas' to verify autoexec behavior.
Copied!
%initScenario(i_desc =Tests for use of autoexec file);
/* test case 1 ------------------------------------*/
%initTestcase(i_object=_dummy_macro.sas, i_desc=special autoexec should be used);
1
%initScenario(i_desc =Tests for use of autoexec file);
2
3
/* test case 1 ------------------------------------*/
4
%initTestcase(i_object=_dummy_macro.sas, i_desc=special autoexec should be used);
2 Code Block
PROC OPTIONS
Explanation : Execution of the OPTIONS procedure to list current SAS system options in the log, useful for debugging the execution context.
Copied!
proc options;
run;
1
PROC OPTIONS;
2
RUN;
3 Code Block
SASUNIT ASSERTIONS
Explanation : Closing the test call and executing assertions: verification of the macro variable &HUGO's value (which must be defined by autoexec), verification of the autoexec file name's presence in the log, and validation of the absence of errors or warnings.
Copied!
%endTestcall()
%assertEquals (i_expected=Test for i_autoexec, i_actual=&HUGO, i_desc=must be equal);
%assertLogMsg (i_logMsg =autoexec_for_autoexec_test.sas);
%assertLog (i_errors=0, i_warnings=0)
%endTestcase()
%endScenario();
1
%endTestcall()
2
3
%assertEquals (i_expected=Test for i_autoexec, i_actual=&HUGO, i_desc=must be equal);
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
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.