Hi there,

I have a number of files named filename1990.dta, filename1991.dta etc until 2018. I would like to write a loop doing two things:

1) append the files, and
2) create a variable 'year' corresponding to the file name (2004, 2005, 2006) to show me which year the data came from.

thanks in advance for your help!

Liza