Date: Tue, 31 Jul 2001 08:29:48 -0400
Reply-To: "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Subject: Re: Infile , column/line pointer control problem .
Content-Type: text/plain; charset="iso-8859-1"
Husain:
The double trailing @ will hold the input pointer for you across data step
iterations:
data test;
length string80 $80
next_type $2
;
infile cards eof=eof;
input @1 string80 ;
input @1 next_type @@;
eof:
cards;
aa111
bb222
cc333
run;
options nocenter;
proc print;run;
The SAS System
next_
Obs string80 type
1 aa111 bb
2 bb222 cc
3 cc333
-----Original Message-----
From: Husain [mailto:hmuhamma@ATRAXIS.COM]
Sent: Tuesday, July 31, 2001 8:09 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Infile , column/line pointer control problem
.
I am trying to read in 2 vars , first variable is in line 1
named
String80 and the second variable is
Next_type=substr(String80 ,1,2) of
line 2 .
The problem is after the first observation is outputted the
line
pointer is in line 3 but I still have to input data from
line 2 for
String80.
Question , how can I get the desired output with only ONE
pass of the
data ?
Sample Input data set :
aa111
bb222
cc333
Desired Output dataset :
String80 Next_Type
aa111 bb
bb222 cc
cc333