@Yavuz wrote: Is there a "period" column in your each dataset ? If there is no, then you must create one from the dataset name, before joining all datasets. If you dont do this you cannot compare data each other. Because all of them mixes.
There's the INDSNAME option that can be used in this situation, assuming SAS 9.3+. It will capture the name of the source file and then you can parse it to get the date from the file name. Here's a useless example of how that works:
data example;
set sashelp.class sashelp.cars indsname=source;
file_input = source;
run;
@maryam1 you can use the methods I've illustrated in the link below, or Tom's code above which is a bit cleaner than mine for sure.
https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type
1. Call the macro with
%list_files(C:\_localdata\temp, sas7bdat);
This will create a data set called LIST that has the list of file names.
Then you can either proceed with the option from Tom's earlier post, use CALL EXECUTE to generate your Data Step combine statement or use those to assign a single libname to all folders.
... View more