First yes that code will combine data sets if the FY17 through Fy21 are in the work library since you didn't provide a library name.
I am not familiar with whatever a MEPS may be. If it is data from a complex data collection sampling scheme then you would use the Survey procedures providing the information related to the sample design. What that might be I have no idea since I know nothing of MEPS. You would use a WEIGHT statement in the procedure pointing to the variable holding the sample weight. But you are likely needing additional bits that depend on the sample design such as strata and cluster variables.
A very likely complication is that it is very likely that each of those yearly data files have weight variables that if used as is will result it attempting to use a population that is roughly 5 times to large. The sum of the sample weights generally should be to population total sampled from. If the collection and use is normally done on an annual basis then a combined data set should have the weights adjusted to reflect the total population of a single year.
https://www.cdc.gov/brfss/annual_data/2021/pdf/Complex-Sampling-Weights-and-Preparing-Module-Data-fo... has a section on how to combine multiple years of data from a complex sample survey for analysis. Look for the Combining Multiple Years of BRFSS Data section. It only shows use for two years you just extend it to the 5 sets you are using. Typically multiyear combinations tend us a "middle" year as the target population to use assuming not large changes of population from year to year.