Date: Sat, 28 Jan 2012 23:33:55 -0500
Reply-To: help ly <help.ly2005@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: help ly <help.ly2005@GMAIL.COM>
Subject: Re: extract information from File name?
Content-Type: text/plain; charset=ISO-8859-1
Thank you all for the great solutions and information!
On Sat, Jan 28, 2012 at 1:06 PM, Gabriel Farkas <firstname.lastname@example.org> wrote:
> SAS has some macros on their support site that basically do the bulk of
> you're looking for: http://support.sas.com/kb/8/710.html
> They provide a good starting point. In the past, I've taken the macro
> MULTIFILEIMPORTERWIN9 and customized it a bit to do things I want that are
> along the same lines as what you're looking for. You probably can do
> something similar.
> On Fri, 27 Jan 2012 20:46:42 -0500, help ly <help.ly2005@GMAIL.COM> wrote:
> >Hi Everyone,
> >I am reading lots of files in SAS, such as:
> >filename Files '/srf/*.txt';
> >data out.Data;
> > infile Files......;
> >I will need get the Company name from the individual file name, and
> >a column in each data set after reading the txt file. For example, after
> >Data from corp1.csv is read, I would like to add a variable CompanyName as
> >Is there an efficient way to extract that part of information from each
> >individual File name while reading the whole set?
> >Thanks so much!
Thanks so much!