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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1044 views
  • 0 likes
  • 2 in conversation