I have 24 datasets that are structured in the same way. By that I mean the same column headers (time, date, price, stock symbol), data set structure etc. I don't wish to append all 24 files since one data set is to big to handle. I named all my data sets with the name "file1 file2 file3 file4....up to file24".
What I want to do is the following:
For example change the date format in all of my 24 files at once;
Be able to extract from each file# a specific stock symbol like 'Dell' and append all the extracted 'Dell' data;
and finally, how can I create a loop that that allows me to change the stock symbol from 'Dell' to another stock symbol in my list like 'Goog'? I would like that loop to do (2) for all of my stock symbols.
To change the date format in a dataset, it might be a bad idea to loop through all the observations. The standard syntax is -
proc datasets library = your_libname nolist; modify dataset_name; format variable_name format_name; quit;
Given that the modify statement does not take multiple SAS files, you will have to wrap it in a macro for all 24 files
For example, you first define a view (note that there is no physical dataset called 'all_files' created here) -
and you can then write -
This is a prototype of solution. I don't know whether you need to do many symbol changes. Will modify the code upon request. Haven't tested, it should work though.