Date: Tue, 23 Jan 2007 07:35:23 -0500
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nat Wooding <Nathaniel_Wooding@DOM.COM>
Subject: Re: Reading Multiple Raw Files ..
Content-Type: text/plain; charset="US-ASCII"
Here's a bit of code which reads a series of files and writes them out
appending the filename.
filename txt 'u:\PERSONAL\*.sas';
length file $ 50;
infile txt filename=file lrecl=80 truncover;
informat txt $72.;
input txt $ 1-72;;
source=scan(source,-2 );* you will need to edit this statement in
order to extract the bits that you need.
It is necessary to assign the value from the filename variable to another
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
Reading Multiple Raw Files ..
Please respond to
Assuming that I have something like this ...
filename in ('c:\Test.log', 'c:\Test2.log');
infile in length=len;
input record $varying1000. len;
Is there anyway I can get to know the source of each observation in
dataset output? In othe words, I want the dataset 'output' to have
another column (say 'sourcefile') that has either the value
'Test.log' or 'Test2.log' based on which raw file that particular
observation was read from.
Is there an easy way to do this?
Yahoo! India Answers: Share what you know. Learn something new
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.