Hello, I am querying an online database which has monthly tables (with the month's date in the table's name, e.g. "MONTH_201701"). I want to query all those tables in a do loop. A friend has been able to find relevant information in the following document. Basically, by using the following macro variable containing all the table names, the loop now manages to query all those tables. What I am trying to do now is create this variable automatically by using a span of dates (assuming I want all 12 months in a year). The way the script works now is by having the following line, which I am hoping to replace by a call to a macro with the years as parameters: %LET DB = YEAR_1901 YEAR_1902 YEAR_1903; /* etc. */ What I would like is for the db variable to be created automatically by a call such as: data _null_; do y = 1901 to 1903; %let DB = cat( ' ', &DB, compress( 'YEAR_'!!y ) ); end; run; data _null_; put &DB; run; This syntax is incorrect, but my ambition is that since the names of the tables follow an algorithm to simply use that algorithm to create the list of names without having to input them manually. Thanks for your help, Sylvain.
... View more