Sample 34593: Retrieving an error message generated by a SAS/AF® FRAME entry and displaying in a Message Box
Overview
Using the _getMsg method of the Frame class, you can retrieve messages generated by a SAS/AF FRAME entry. This example illustrates how to query the message generated by the FRAME entry, and, if the message includes the word "ERROR", display the message in the Message Box window instead of on the SAS message line.
SCL Code
Using the following SCL code, you can capture messages generated by the FRAME entry. If the message contains the string ERROR
, then display the message in an SCL Message Box.
INIT:
control always;
dcl char(200) msgval;
dcl list msglist={};
return;
MAIN:
_frame_._getMsg(msgval);
if index(msgval,'ERROR') then do;
rc=clearlist(msglist);
rc=insertc(msglist,msgval,-1);
command=messagebox(msglist,'S','O');
_frame_._setMsg(' ');
end;
return;
TERM:
msglist=dellist(msglist);
return;
|
Results
When an error is generated by the Frame, a message box like the following is displayed. This sample error message was the result of a character value entered into a numeric Text Entry field.
Additional Documentation
For more information about SAS/AF, see the SAS/AF documentation page.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample illustrates how to retrieve the SAS error message generated by your FRAME entry using SCL code. The error message will then be displayed in a message box to present to the user.
Date Modified: | 2011-01-05 14:38:02 |
Date Created: | 2009-01-26 10:43:03 |
Operating System and Release Information
SAS System | SAS/AF | z/OS | | |
OpenVMS VAX | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Microsoft Windows XP 64-bit Edition | | |
Microsoft® Windows® for x64 | | |
OS/2 | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows XP Professional | | |
Windows Millennium Edition (Me) | | |
Windows Vista | | |
64-bit Enabled AIX | | |
64-bit Enabled HP-UX | | |
64-bit Enabled Solaris | | |
ABI+ for Intel Architecture | | |
AIX | | |
HP-UX | | |
HP-UX IPF | | |
IRIX | | |
Linux | | |
Linux for x64 | | |
Linux on Itanium | | |
OpenVMS Alpha | | |
OpenVMS on HP Integrity | | |
Solaris | | |
Solaris for x64 | | |
Tru64 UNIX | | |