|
Vertically joining data in two (or more) data sets using proc sql. If each data set represents data gathered in different years data_2000, data_2001, data_2002, ... If one wants to take a column from each file, but add a column populated with the year each row was taken from, creating the column is easy enough, but I don't know how to populate the values for each row. I'd like to use a macro, give a list of files and years, let the macro generate the proc sql code to join given columns, et cetera |
|
The basic approach I'd suggest is to assign a constant representing the year in each of the select queries ...
You can then turn this into a macro as follows:
|
|
Thanks Will. (And sorry it's taken me so long to comment back. It seems it's been so long that RunSubmit doesn't even want me to sign in anymore, so I had to start new.) Weirdly, even though SAS seems to acknowledge the filename statement because I get the filename I specify in it, the LRECL statement appears to be wow gold skipped. |