SAS Component Language Dictionary |
Category: | Control or Field |
Syntax | |
Details | |
Examples | |
Example 1: Using ERROR to Report Invalid Values | |
Example 2: Generating a Compile Error with ERROR | |
See Also |
Syntax |
rc=ERROR(wvar-name); |
indicates whether the FRAME entry control or field in the window is in error:
1 | |
0 |
is the name of a FRAME entry control or field in the window. This argument cannot be an expression.
Details |
Use ERRORON and ERROROFF to set and reset error conditions for the FRAME entry control or field.
The FRAME entry control or field cannot be an element of an array. To report this information for an array element, use FIELD instead.
FRAME entry controls can also use the _inError method.
Examples |
Specify the CONTROL statement with the ERROR option in the INIT section of the program. The statements in the MAIN section are submitted only if the FRAME entry control OBJ1 is not in error.
INIT: control error; return; MAIN: if (error(obj1)=0) and obj1 NE _blank_ then submit continue; proc print data=&obj1; run; endsubmit; else _msg_='Nothing submitted. Please correct error.'; return;
The following sequence generates a compile error because the variable DS is not a window variable but contains the name of a window variable. ERROR expects to be passed the window variable itself.
ds='tablename'; if (error(ds)) then do; ...SCL statements to handle the error condition... end;
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.