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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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