In reply to Barry DeCicco.

Remember that the IN= data set option creates a temporary variable that is not written to the data set. You need to copy it to a permanent variable if you want to output it, like this:
set A B(in=XXX);
inB = XXX; /* create variable in output data set */