| Valid in: | Configuration file, SAS invocation, OPTIONS statement, SAS System Options window |
| Category: | Environment control: Error handling |
| PROC OPTIONS GROUP= | ERRORHANDLING |
| Note: | This option can be restricted by a site administrator. For more information, see Restricted Options. |
/* treat variable not found on _NULL_ SAS data set as an error */
/* turn option off - should not get an error */
options novnferr; run;
data a;
x = 1;
y = 2;
run;
data b;
x = 2;
y = 3;
run;
data _null;
y = 2;
run;
/* option is off - should not get an error */
data result;
merge a b _null_;
by x;
run;
/* turn option on - should get an error */
options vnferr; run;
data result2;
merge a b _null_;
by x;
run;66 /* treat variable not found on _NULL_ SAS data set as an error */ 67 68 /* turn option off - should not get an error */ 69 options novnferr; run; 70 71 data a; 72 x = 1; 73 y = 2; 74 run; NOTE: The data set WORK.A has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.00 seconds 75 76 data b; 77 x = 2; 78 y = 3; 79 run; NOTE: The data set WORK.B has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 80 81 data _null; 82 y = 2; 83 run; NOTE: The data set WORK._NULL has 1 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 84 85 /* option is off - should not get an error */ 86 data result; 87 merge a b _null_; 88 by x; 89 run; WARNING: BY variable x is not on input data set WORK._null_. NOTE: There were 1 observations read from the data set WORK.A. NOTE: There were 1 observations read from the data set WORK.B. NOTE: The data set WORK.RESULT has 2 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 90 91 /* turn option on - should get an error */ 92 options vnferr; run; 93 94 data result2; 95 merge a b _null_; 96 by x; 97 run; ERROR: BY variable x is not on input data set WORK._null_. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.RESULT2 may be incomplete. When this step was stopped there were 0 observations and 2 variables.
options novnferr; data a; x = 1; y = 2; run; data b; x = 2; y = 3; run; %let dataset1=a; %let dataset2=b; %let dataset3=_null_; data result; set &dataset1 &dataset2 &dataset3; by x; run;
15 options novnferr; 16 17 data a; 18 x = 1; 19 y = 2; 20 run; NOTE: The data set WORK.A has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 21 data b; 22 x = 2; 23 y = 3; 24 run; NOTE: The data set WORK.B has 1 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 25 26 %let dataset1=a; 27 %let dataset2=b; 28 %let dataset3=_null_; 29 30 data result; 31 set &dataset1 &dataset2 &dataset3; 32 by x; 33 run; WARNING: BY variable x is not on input data set WORK._null_. NOTE: There were 1 observations read from the data set WORK.A. NOTE: There were 1 observations read from the data set WORK.B.