Hi, Supposing that the structure of the files being imported remains constant throughout the months and years, one way to do that is the following: First, make sure that you selected the last option in the fourth step of the import object (you can "Modify task", select the option, and run to get the code): That code will make reference to the file you're importing: Now, copy all the code of the import to a new program, add a %LET statement at the top to create the macro variable that will establish the yearmonth to run (i called it YEARMONTH, name it as you like): ... and now you can replace with the new macro variable reference where needed (i don't know if the SAS table you're creating also contains the yearmonth, if it does, don't forget to replace there too), and run the program: Two very important things here: When you reference a macro variable inside a string, the string must be delimited by double quotes ("), not single quotes ('). Double quotes will allow for macro variable resolve inside them, single macro quotes won't. If you need to reference a macro variable inside a string and right before a period (.), as in this example, follow the macro variable reference with an additional period. Notice that, in the last image, i have "TABLE&YEARMONTH..csv". The first period will be interpreted as a delimiter for the macro variable name and be "consumed", while the second period will be interpreted literally as a period. Hope this helps! Best regards, José Costa
... View more