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 (January 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 27 Jan 1999 20:09:16 -0600
Reply-To:   shiling@math.wayne.edu
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Shiling Zhang <shiling@MATH.WAYNE.EDU>
Organization:   Wayne State University
Subject:   Re: Delimited text file fields longer than 8 characters
Comments:   To: "Boylan, Dave" <dboylan@UTILICORP.COM>
Content-Type:   text/plain; charset=us-ascii

Dave,

Since your raw text file has varying length fields, you may use LENGTH(or ATTRIB) statement specifying fields first, then you could DSD option in INFILE statement. The DSD option is specially for comma delimiter file(see below).

Hope this helps.

Data Junk; length num1 num2 8 name comment $20 num3 8; infile raw dsd pad; input num1 num2 name comment num3; run;

Boylan, Dave wrote:

> I'm having trouble reading a delimited text file with varying length fields > longer than 8 characters. It seems that SAS truncates the character field > after the 8th character. For example, a text file record like: > > 100,9999,bill,hello world,755 > > read with the following SAS program: > > Data Junk; > infile raw dlm=','; > input num1 num2 name $ comment $ num3; > run; > > Gives the following results: > > num1 num2 name comment num3; > 100 9999 bill hello w orld755 > > I'm sure that I am missing something simple here. > > Thanks > -------------------------------------- > David Boylan > Corporate Forecasting > UtiliCorp United, Inc. > 816.467.3062 > --------------------------------------


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