This program starts by provoking an explicit error by attempting to lock the system table 'sashelp.class' via the LOCK statement (which is forbidden in read-only mode). It then calls the %mp_reseterror macro to clean up the error environment. Finally, the %mp_assert macro is used to verify that the previous macro worked correctly by testing if the automatic variable &syscc has returned to 0.
Data Analysis
Type : SASHELP
Uses 'sashelp.class' as the target to generate a lock error. Produces a results table 'work.test_results'.
1 Code Block
LOCK
Explanation : Attempts to exclusively lock the sashelp.class table. This operation is intended to fail and raise an error, as SASHELP is generally read-only or used by the system.
Copied!
lock sashelp.class;
1
lock sashelp.class;
2 Code Block
MACRO
Explanation : Call to the %mp_reseterror macro to reset the session's error indicators (like &syscc) following the previously provoked error.
Copied!
%mp_reseterror()
1
%mp_reseterror()
3 Code Block
MACRO Data
Explanation : Asserts that the system return code (&syscc) is equal to 0, confirming that the error has been cleared. Test results are stored in the 'work.test_results' table.
Copied!
%mp_assert(
iftrue=(&syscc=0),
desc=Checking error condition was fixed,
outds=work.test_results
)
1
%mp_assert(
2
iftrue=(&syscc=0),
3
desc=Checking error condition was fixed,
4
outds=work.test_results
5
)
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.