I have a large number of files which I need to make into SAS datasets. I have the names of all the files in a SAS dataset, for example:
doc_names
1. filename1
2. filename2
.
.
.
So I need to access each filename, concatenate it with the path to the file and tell SAS to grab that file and make a dataset out of it.
For example, if I were doing this in R, it would look something like this:
path = 'path-to-files'
filenames = readLines('file-with-filenames.txt')
for (i in 1:length(filenames)) {
current.file = filenames[i]
full.file = paste0(path, current.file)
data.set = read.csv(full.file)
}
It's basically current.file = filenames[i]
portion that I can't figure out in SAS. I need to be able to make a macro variable out of a particular entry of a dataset so that I can concatenate it with the pathway and then tell SAS that it is a filename.
P.S., I am aware that I can create a new dataset entry which has the full pathway to the file. That is all well and good, but it isn't the heart of the problem.
Thanks for the help!