I am a beginner with SAS, and will greatly appreciate your help with creating a loop across SAS datasets (I found in the book how to make a loop within one dataset, but no information on how to loop across multiple datasets). Here is my problem: I have fifty datasets, named as data11, data12, … data60. All begin with the same letters (data) and end up with consecutive numbers starting from 11. I need to make the following steps in the loop: To open each of them consecutively; to keep just two variables (variable names are ID and VAR*, where VAR* all end with the same numbers as in the respective dataset names: VAR11, VAR12…VAR60); to create one additional variable being named as d11, d12…d60 (in line with the numbers in respective dataset names) and to make it being equal 1. Then I need to merge them all to a dataset named data0 by the variable ID. I have to do all that without changing any of the initial datasets, but by creating new datasets. Could you please kindly advise me how can I do that? Thank you very much in advance.
... View more