@sayanapex06 wrote:
@Patrick Its not working as expected.. I am getting errors.. Cant we place the previous example you gave and place it inside a loop?
I don't see any errors.
Do the files have the same data structure?
Assuming they do, you can use a method with the infile and FILEVAR option. The FILEVAR option allows you to specify the input file and the data set used for this contains the reference to the file to be read.
Here's an example of how this would be done from scratch, but you already have the file with the list of files to be read.
So using step 2 as a starting point in the example here.
http://www.ats.ucla.edu/stat/sas/faq/multi_file_read.htm
Please post the log with the error.
Using Infile ... Filevar= is the most straightforward way for reading multiple same structured input sources into an output table.
@Patrick do while(not done) is not reading the input dummy file..
do until(not done) is reading wrong values from input dummy file
please give me a way to do this...
@sayanapex06 post your code and log.
If you want a macro check the SAS 9.4 macro documentation first example
Replace the Import PROC with your data step
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.