I changed &start_date. to "&start_date"d and the same for &end_date and that seems to have worked. However it looks like the date offset I described isn't being covered - 202001 is April, 202002 is May etc: I have tables up to April 2020, which is 202001, but if I put the end date as 01 April 2020, I get errors: name_20202 does not exist, name_202003 does not exist. From the April 2020 date, nothing past 202001 should be requested. I've offset my dates by a couple of months to get the right period while that problem gets sorted and it looks like I'm getting the right data, certainly the volume looks correct anyway. So thanks so much for getting me this far, it's a huge help as I was using a legacy system to run some old SQL to create a .csv file and then importing it into SAS, this will let me automate the process and strip a load of time out.
... View more