
Rick A. answered 03/26/19
Experienced SAS Professional
Here's a simple solution for your 3-dataset example that can be expanded, not necessarily painlessly, to many more datasets:
data final;
set
my_data_1(in=in1 )
abc (in=in2 )
xyz (in=in3 )
;
format var_3 $15.;
if in1 then var_3='my_file';
else if in2 then var_3='abc';
else if in3 then var_3='xyz';
run;