Will the dataset always be having name as %sysfunc(today()),-1? Instead once the libname for in1 and in2 is set, you can use the dictionary.tables to read the dataset names from the library into macro variables and use it in your subsequent datasteps. For instance, libname in1 "/path1" proc sql; select memname into :_Dsn1-:_Dsn3 from dictionary.tables where libname = "in1"; quit; %put &_Dsn1; based on the no of datasets you are comparing you can create mv's.
... View more