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
SAS Super FREQ
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 1 reply
  • 605 views
  • 0 likes
  • 2 in conversation