Date: Fri, 27 Jan 2012 20:46:42 -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: extract information from File name?
Content-Type: text/plain; charset=ISO-8859-1
Hi Everyone,
I am reading lots of files in SAS, such as:
corp1.csv
corp2.csv
corp3.csv
corp4.csv
............
filename Files '/srf/*.txt';
data out.Data;
infile Files......;
I will need get the Company name from the individual file name, and insert
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
"corp1".
Is there an efficient way to extract that part of information from each
individual File name while reading the whole set?
--
Thanks so much!
Orange
help.ly2005@gmail.com
|