LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2001, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 31 Jul 2001 08:37:41 -0400
Reply-To:     "Diskin, Dennis" <Dennis.Diskin@PHARMA.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Diskin, Dennis" <Dennis.Diskin@PHARMA.COM>
Subject:      Re: Infile , column/line pointer control problem .
Comments: To: Husain <hmuhamma@ATRAXIS.COM>
Content-Type: text/plain

Husain,

Basically the trailing double at sign @@ will solve the problem. A complication comes in at the last record.

Tested code:

data test; input @1 str80 $80. / @1 next $2. @@; infile cards eof=eof; output; return; eof: output; stop; cards; aa111 bb222 cc333 ;

proc print;run;

hth, Dennis Diskin

> -----Original Message----- > From: Husain [SMTP: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 : > > > Desired Output dataset : > String80 Next_Type > aa111 bb > bb222 cc > cc333


Back to: Top of message | Previous page | Main SAS-L page