Date: Fri, 10 Jul 2009 22:40:32 -0700
Reply-To: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <jfh@STANFORDALUMNI.ORG>
Subject: Re: Import Multiple .txt Files
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
I'm not sure whether the FILENAME= option on the INFILE statement
would work in these circumstances, but that's what I would try. Make
the input statement dependent on the name of the input file.
It would be something like this (untested code):
length filename $64.;
infile moh1 truncover LRECL = 3000 filename=filename;
if filename = 'F:\test\Downloads\file3.txt' then
/* input statement for fourth file */
/* input statement for other files */
Tots units fem força!
On Jul 10, 2009, at 10:15 pm, shellp wrote:
> I have 4 text files that have the same data elements but NOT in the
> same location yet I want all to be imported into a single file.
> Prior to the 4th file I was importing the other 3 with the code below:
> filename moh1('F:\test\Downloads\file1.txt'
> infile moh1 truncover LRECL = 3000;
> input @1 Prov $1.
> @2 Inst $4.
> @6 Fyear $4.
> @10 Period $2.
> @12 Batch $2.
> @14 AbsNo $3.
> @71 ProvIss $2.
> @73 RFP $2.
> @92 Postal $6. ;
> How can I import the 4th though the location of "postal" for instance
> is at $105 instead of 92?