If these are sas datasets in a sas library, then you could use the SAS9.2 option for SET statements INDSNAME= which names a variable to hold the name of the dataset which contributes to that iteration.
Supposing all of that and your data sets are named Tcrat01 - Tcra12 and contain accounting data sorted by ac_no, then this selects only ac_no beginning 'ABC' (at the same point you can use some more relevant filter) but places their rows in account and fileDate order ;[pre] data selected ;
set yourlib.tcrat1-yourlib.tcrat12 INDSNAME= in_table ;
by ac_no filedate ;
where ac_no =: 'ABC' ;[/pre]* now convert number like date into sas date ;[pre] date = input( put( filedate, z8. ), yymmdd8.) ;
format date yymmN6. ;[/pre]* now copy the indsn= info to another variable to keep it in the output table;[pre] from_set = in_table ;
run ;[/pre]
If your "library" is not a sas library but a folder or pds (on mvs) then there is some similar functionality on the INFILE statement, for handling external files, like FILENAME= and FILEVAR=, but I hope we're talking sas datasets here.
good luck
PeterC