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 (April 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 12 Apr 2009 06:26:41 -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: Importing multiple files from multiple folders
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

On Apr 12, 7:55 am, priyanka.priyankasi...@GMAIL.COM (Priyanka Singh) wrote: > Dear all, > > I am trying to import multiple from a folder. However, I have folders inside > that folder. So first I want to read the contents of main folder and using > the name of the folders inside it , enter into each folder and read the > files. This is where I have my real files. But the following code does not > seem to work :

The problem is at

filename indat pipe 'dir J:\1999\199901\Snapshot\1999\Jan\&&pext&j / b';

Macro variables do not resolve when used inside single-quoted literals. Use double quotes instead. Macro variables will be resolved when inside a double quoted string.

Additionally, you might save yourself some headaches by - using DIR /S to let the operating system recurse for you. - using CAT, CATT, CATS, or CATX function when building a string from lots of pieces, some of which are numeric variables.

call symput('fname1'||trim(left(put(j,8.))),scan(trim(fname1), 1,'.')); would become call symput(cats('fname1',j),scan(trim(fname1),1,'.'));

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


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