My code looks like this
data set1 set2;
input A $1 B 2.2 C 3.2;/*A can only take a or b*/
if A = 'a' then do;
keep a x;
if A = 'b' then do;
keep a y;
I simply want to keep only TWO variables in the resulting subsets. But the
result is set1 also retains y flooded with missing values, while set2 has
variable included full of missing values as well.
I know the solution is to use Keep= in the Data statement when 'declaring'
the two data sets. Could somebody explain why my original code does not