Date: Tue, 28 Apr 2009 11:58:04 -0700
Reply-To: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Schwarz, Barry A" <barry.a.schwarz@BOEING.COM>
Subject: Re: How to read Nth column in a file using Infile ????
Content-Type: text/plain; charset="us-ascii"
If, as your title suggests, N can vary from run to run, one simple
approach is to read the entire record (or use _infile_) and select the
Nth "word" using SCAN.
By the way, file "variables" don't have names that SAS knows about.
Since you mentioned infile, I assume you are not talking about variables
in observations within a SAS data set.
Sent: Tuesday, April 28, 2009 6:55 AM
Subject: How to read Nth column in a file using Infile ????
Suppose, there is a file containing data as:
id mark1 mark2 mark3 /*This line is just for reference and it
not part of a file*/
001 60 70 90
002 85 55 95
Now I want to read data only from column number 2 . Also we don't
know the column name.
Is there any way to specify column number in Infile statement. ??????
The data is of varying length, we don't know the exact starting column
number of variable mark2, So we can not use @ input pointer also.
If the above question is not clear, I would like to reframe the
If a file contains 100 variables and I want to read the data of 80th
variable and I dont know its name. How can we directly read the data
of 80th column ???????