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-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!

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.

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