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 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 14 Jul 2010 17:44:23 -0400
Reply-To:     Subscribe Sas-L Jkr <jayakumarreddy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Subscribe Sas-L Jkr <jayakumarreddy@GMAIL.COM>
Subject:      Re: READ from TXT - INFILE
Comments: To: Barry Schwarz <barry.a.schwarz@BOEING.COM>

On Wed, 14 Jul 2010 14:37:52 -0700, Schwarz, Barry A <barry.a.schwarz@BOEING.COM> wrote:

>Where is your input statement? Didn't the column specifications generate diagnostics? > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Subscribe Sas-L Jkr >Sent: Wednesday, July 14, 2010 2:18 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: READ from TXT - INFILE > >hi >i have to read a txt file into two columns into SAS. > >DATA ICD10.I10cm_desc2010; > INFILE "F:\projects\0057_Jul10\ICD10Diagnoses GEMs\I10cm_desc2010.txt"; > informat @1 ICD10CM $7. @9 Description $250.; >run; > >This is how the text file looks > >A000 Cholera due to Vibrio cholerae 01, biovar cholerae >A001 Cholera due to Vibrio cholerae 01, biovar eltor >A009 Cholera, unspecified >A0100 Typhoid fever, unspecified >A0101 Typhoid meningitis >A0102 Typhoid fever with heart involvement > >the second column truncates after it encounters a space in the txt file. I >want the entire string to be read into the second column > >thanks >JKR

oops...i did not even look at it. now it makes sense. the log said ERROR: LOST CARD

i should have used this

DATA ICD10.I10cm_desc2010; INFILE "F:\projects\0057_Jul10\ICD10Diagnoses GEMs\I10cm_desc2010.txt" DSD truncover lrecl=2200;; input @1 ICD10CM $CHAR7. Description $char250.; run;

It works

Thanks JKR


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