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 (May 2009, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 14 May 2009 07:53:02 -0500
Reply-To:     "Data _null_;" <iebupdte@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Data _null_;" <iebupdte@GMAIL.COM>
Subject:      Re: Infile trouble
Comments: To: Kevin Y <kevin77711@yahoo.com>
In-Reply-To:  <798180.10001.qm@web59614.mail.ac4.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1

input var1 :$40. var2 :$3.;

See what happens if you add the COLON modifer to your INPUT statement. Example above.

On 5/14/09, Kevin Y <kevin77711@yahoo.com> wrote: > Thanks, Data _null_. > > The "^M"s were successfully removed by TERMSTR =CRLF. > > But I still could not merge the file with another file by var1 (with same length and same format). Like Gerhard pointed out that there may be other chars and I can not see. > > > > > ________________________________ > From: "Data _null_;" <iebupdte@gmail.com> > To: Kevin Y <kevin77711@yahoo.com> > Cc: SAS-L@listserv.uga.edu > Sent: Thursday, May 14, 2009 7:48:21 PM > Subject: Re: Infile trouble > > Did the file come from Windows and your program is on UNIX? > > Try the INFILE statement option TERMSTR =CRLF; > > On 5/14/09, Kevin Y <kevin77711@yahoo.com> wrote: > > All; > > > > I have trouble to read in a txt file(below). > > > > data all; > > format var1 $40. var2 $3.; > > infile hosp truncover firstobs=2 dlm=z; > > input var1 $40. var2 $3.; > > run; > > > > proc print;run; > > > > Obs VAR1 VAR2 > > 1 ATENOLOL YES ^M > > 2 BLOPRESS PLUS YES ^M > > > > Var1=drug used by a patient, Var2=used or not. > > 1. How can I efficiently remove the "^M"? > > 2. After I removed the "^M" (not efficient at all), I could not merge the file with another file by var1 (with same length and same format). There may be something behind the screen. > > Thanks. > > > > > > > > > > > > >


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