BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Reeza
Super User

@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. 

sayanapex06
Obsidian | Level 7

@Reeza @Patrick in the solution I accepted for this post which is using a call function.... Cant we loop the data statement for each iteration until EOF?? Please help me with that code only

Reeza
Super User

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

 

 

Patrick
Opal | Level 21

@sayanapex06

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. 

sayanapex06
Obsidian | Level 7

@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...

Reeza
Super User

@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

 

http://support.sas.com/documentation/cdl/en/mcrolref/69726/HTML/default/viewer.htm#n0ctmldxf23ixtn1k...

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 20 replies
  • 2519 views
  • 3 likes
  • 4 in conversation