BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All,
After one days of SAS tutorails
I have been assigned a task to read all the files in a driectory and append them to one. Can i get a short SAS code on this. I could manage to read a directory but after that I am clueless
Thanks
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
It really depends on whether your directory contains SAS datasets that you want to append into 1 bigger SAS dataset or whether your directory contains a set of disparate files (like .TXT or .CSV files) that you want to append together.

The code would be different depending on what/how you want to do the appending. For SAS datasets, you might want to look at the syntax for PROC APPEND (for a procedure method to append SAS datasets) or the SET statement within a DATA step program (for a program language method to append). In addition, you could use PROC SQL for appending SAS datasets together.

If you look in the documentation that's on-line and/or search for previous forum postings, I believe you'll find some code examples to help you.

cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1031 views
  • 0 likes
  • 2 in conversation