In reply to Alex.

You can either use
set A(keep=y z) B(keep=y z) indsname = source;

or you can use
set A B indsname = source;
keep y z libref dsname;