I'm sorry I am trying my best to explain. I'll try once more. Forget what I had said before. I have an area folder which contains lots of dates folders (yes they are dates in the MMDDYYYY format), in the dates folder is a prod folder which contains that dates datasets. (As I shown in multiple screenshots). There are around 20 datasets in each folder all with the same name. The dates represent when the datasets data where captured. The dataset names in each prod folder are the same. So there is an entity.sas7bdat in every date->prod folder, as well as allocation.sas7bdat, and risk.sas7bdat, and entity_scenario.sas7bdat etc. %let folder = 12312020; /* Specifying the date I want */
libname test "home/area/&folder/prod";
create table Table1 as
select a.id, a.date, a.group
from test.allocation a
where cats(a.id, a.date, a.group) not in
(select cats(id, date, group) from test.risk)
; This is an example of one of the tests I create. Notice how I have to specify which date folder I want to use. I want to make it so I dont need to specify the date, and so this table is created for all the date folders. The project is to create tests and check data quality. So I use sql to create tables to find possible problems in the datasets from the prod folder and review them in the WORK library which is where the create tables are outputted to. Right now, I have to manually change the date (as you saw in my let statement in the original post) in order to access multiple date folders and test the datasets in them. I want a way to automate this so I dont have to manually change the date, instead running the program would give me the data for all the dates. There are a lot of dates thats why automating it would be better. I do not need to combine datasets or anything like that. Just need to test them using my create table sql and reviewing them in the excel I export them too. Im hesitant to share any of the actual code due to work privacy. All the code examples Ive shown is a mock with different names etc. but the foundation of it is the same. I hope this made it a more clear. Im still learning SAS so I'm trying to explain it in the best way I can
... View more