SAS help document says "A WHERE expression tests the condition before an observation is read into the PDV". But there are 14 observations in B. What happens in PDV?
Add dataset option IN= to your SET statement and enlighten us all. Somewhat like
[pre]
data b;
set a(in=a1 where=(i<8)) a(in=a2);
where i>3;
put (_n_ i a1 a2) (=);
run;
[/pre]
clearly when you use a where clause in data set options, it doesn't use the conditions of the where statement . This causes a WARNING if A is read on the SET statement only with WHERE clauses[pre]25 data B;
26 set A(where=(i<8)) ;
27 where i>3;
WARNING: The WHERE statement cannot be applied to a data set on
the last SET/MERGE/UPDATE/MODIFY statement. Either
the data sets listed failed with open errors or they
already specify a WHERE data set option.
28 run;
NOTE: There were 7 observations read from the data set WORK.A.
WHERE i<8;
NOTE: The data set WORK.B has 7 [/pre] This is tested on SAS9.2
It may be different on your release.
"If you use both the WHERE= data set option and the WHERE statement in the same DATA step, SAS ignores the WHERE statement for data sets with the WHERE= data set option."
"If you use both the WHERE= data set option and the WHERE statement in the same DATA step, SAS ignores the WHERE statement for data sets with the WHERE= data set option."