Wildcards are stored in the data stage

Can wildcards be used in keepdata steps? I want to do the following (left union of A to B containing the variables x and y and all the variables starting with a):

data C;
    merge A(in=a)
          B(keep= x y var* in=b);
    by x y;
    if a;
run;
+5
source share
1 answer

Yes, use :.

data C;
    merge A(in=a)
          B(keep=x y a: in=b);
    by x y;
    if a;
run;

(This cannot be said in=aif you have a variable named a.)

, a1, a2,..., aN, a1-aN. (, varX, varY varZ ), varX--varZ. , .

+8