SAS: concatenate different datasets while keeping the individual data table names
If you have SAS 9.2 or newer you have the INDSNAME option http://support.sas.com/kb/34/513.html So: data final; format dsname datasetname $20.; *something equal to or longer than the longest dataset name including the library and dot; set my_data_1 abc xyc indsname=dsname; datasetname=dsname; run;