Date: Sat, 18 Sep 2004 16:03:49 -0400
Reply-To: Nathaniel_Wooding@DOM.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nat Wooding <Nathaniel_Wooding@DOM.COM>
Subject: Re: Text File!
Content-type: text/plain; charset=US-ASCII
Aj
If all of the files are in a single directory and there are no unwanted
files there, you could use a wildcard reference in you filename statement.
Here, I created a folder, TEST, with two files T1.txt and T2.txt. Each
contained a single line with 4 numbers on each line.
data a;
filename indd 'c:\test\*.txt';
infile indd;
input a b c d;
proc print;run;
Here is the log:
NOTE: The infile INDD is:
File Name=c:\test\t1.txt,
File List=c:\test\*.txt,RECFM=V,LRECL=256
NOTE: The infile INDD is:
File Name=c:\test\t2.txt,
File List=c:\test\*.txt,RECFM=V,LRECL=256
NOTE: 1 record was read from the infile INDD.
The minimum record length was 7.
The maximum record length was 7.
NOTE: 1 record was read from the infile INDD.
The minimum record length was 7.
The maximum record length was 7.
NOTE: The data set WORK.A has 2 observations and 4 variables
Nat Wooding
|---------+---------------------------->
| | Aj U |
| | <apupdh3@YAHOO.CO|
| | M> |
| | Sent by: "SAS(r) |
| | Discussion" |
| | <SAS-L@LISTSERV.U|
| | GA.EDU> |
| | |
| | |
| | 09/18/2004 02:44 |
| | PM |
| | Please respond to|
| | Aj U |
| | |
|---------+---------------------------->
>--------------------------------------------------------------------------------------------------------------------------------|
| |
| To: SAS-L@LISTSERV.UGA.EDU |
| cc: |
| Subject: Text File! |
>--------------------------------------------------------------------------------------------------------------------------------|
Hi All!
I need to insert 100 text files to make one SAS data set. Each file has
same no of variables.
Say, Files name are (note: these are NOT variable names)
A001 to A020
B001 to B020
C001 to C060 (total 100 text (eg: A001.txt) files)
Could you please tell me how to make a single SAS data set from these text
file. I appriciate your help.
Thanks,
Aj