LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 27 Mar 2009 07:52:36 -0700
Reply-To:   Richard <rdevenezia@WILDBLUE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Richard <rdevenezia@WILDBLUE.NET>
Organization:   http://groups.google.com
Subject:   Re: Exporting external files...
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

On Mar 27, 6:56 am, priyanka.priyankasi...@GMAIL.COM (Priyanka Singh) wrote: > Hi all, > > I want to read and import multiple external files (raw data) in SAS. The > folder from which I want to read and import has all files written in > structured way. How Should I proceed for it.

Use the operating system wildcard symbol to concatenate the files for reading.

Here is a windows sample: ------------------------------ %let path = %sysfunc(pathname(WORK));

data _null_; do n = 1 to 9; output_filename = cats("&path.\mydata",n,'.dat'); file dynamic filevar=output_filename; do i = 0 to 9; x = n*10+i; put x; end; end; run;

data mydata; length input_filename $200; infile "&path.\mydata*.dat" filename=input_filename; input x; source = input_filename; run; ------------------------------

Richard A. DeVenezia http://www.devenezia.com


Back to: Top of message | Previous page | Main SAS-L page