BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,
Im new to sas and I need to append multiple files in a single directory into one file. Ive seen ways to append one file to another but Im curious what is needed to append multiple files that are in one directory together? Message was edited by: TDS
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
When you mention append files, one could infer that you are appending sequential files, not SAS files. You can use the SAS DATA step process combined with a FILENAME statement, in order to treat the entire set of files as one concatenated stream. With the FILENAME statement enclose the list of files in parantheses. And using the DATA step, use the INFILE and FILE statements, combined with an INPUT and PUT _INFILE_; set of statements to process your data. No SAS file is created, only your output file specified in the (output) FILE statement.

Have a look at the SAS "companion" document for your operating environment, with focus on the topics "Using External Files" and also "Concatenating Filenames". Here is a link to one reference for the UNIX environment - there are similar discussions for other environments:

http://support.sas.com/documentation/cdl/en/hostunx/59542/HTML/default/a000386629.htm

Also, you will find the SAS support website http://support.sas.com/ has SAS product documentation and also supplemental technical (SAS staff and user community contributed) papers on this type of topic -- have a look at using the SEARCH facility or use Google (example below) to search the site for relevant material:

concatenate sequential files filename site:sas.com

Scott Barry
SBBWorks, Inc.

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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