Date: Thu, 28 Oct 2010 19:13:42 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: problems in importing .txt file
In case anyone was following (or does look at) this thread, the problem
was simply that there were really 41 rather than 40 variables. Olive sent
me a sample of her data, offline, and the discrepancy was easy to identify
once one looked at what was happening.
On Fri, 22 Oct 2010 15:17:39 -0700, Arthur Tabachneck
>I'm not sure if I follow as, when I try to replicate what you did, I
>get all 40 columns in the expected order (i.e., 1 thru 40,
>Could it be that columns' 19 and 40 are character variables rather
>than numeric ones?
>And, since you already know which columns are on which records, why
>don't you use something like?:
> infile "&path\B.txt" truncover ;
> input x1-x19/x20-x40;
>On Oct 22, 9:44 am, olivesecret <olivesec...@gmail.com> wrote:
>> I have a huge dataset in txt file which should contain 40 columns. But
>> each record was divided to two rows due to the length of easy record.
>> To import this dataset to SAS, I used following command:
>> data A;
>> infile "&path\B.txt" ;
>> input x1-x40 @@;
>> The error message says,
>> RECFM=V,LRECL=256,File Size (bytes)=42453,
>> Last Modified=11Oct2010:05:08:28,
>> Create Time=13Oct2010:10:01:45
>> NOTE: Invalid data for x19 in line 1 234-246.
>> NOTE: Invalid data for x40 in line 2 145-146.
>> x19 and x40 are the variable at the end of each row, or in other
>> words, 1st (3rd, 5th, ...) contains information for x1-x19, and 2nd
>> (4th, 6th, ...) contains information for x20-x40. From the work
>> library I can still open data A with all variables correctly imported
>> except x19 and x40.
>> BTW, the lengths of each variable may be different for different
>> records. And the delimiter is space.
>> Thanks a lot for any suggestion!