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 (June 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 19 Jun 2006 08:51:08 -0600
Reply-To:     Alan Churchill <SASL001@SAVIAN.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Alan Churchill <SASL001@SAVIAN.NET>
Subject:      Re: How to read a text file with comma as the demiliter?
Comments: To: Xu Libin <Libin.Xu@IRS.GOV>
In-Reply-To:  <FA0F518F85A0CF40891CB7D09DA02DF608D14E@NCT0010CP3MB04.ds.irsnet.gov>
Content-Type: text/plain; charset="us-ascii"

Use tab delimiters when exporting: it will save you a lot of headaches.

Alan

Alan Churchill Savian "Bridging SAS and Microsoft Technologies" www.savian.net

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Xu Libin Sent: Monday, June 19, 2006 8:28 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: How to read a text file with comma as the demiliter?

Thanks for the advice. The colon modifier is what I need to read the data correctly. That saves me a lot of work to read the fixed-width file. Actually the original file is of MS Access. To export the Access file to a fixed-width file is much more cumbersome than to a delimited file.

Libin

-----Original Message----- From: T J [mailto:tjpush@YAHOO.COM] Sent: Monday, June 19, 2006 9:51 AM To: Xu Libin Subject: Re: How to read a text file with comma as the demiliter?

Changing input x $4. y $8. z ; to input x :$4. Y :$8 z ;

usually helps.

The ":" modifier tells SAS to read UP to 4 or 8 characters until it sees a comma, the delimeter.

TJ

On Mon, 19 Jun 2006 09:40:54 -0400, Xu Libin <Libin.Xu@IRS.GOV> wrote:

>Thanks for the suggestion. I tried both dsd and delimiter=','. The >results were the same. > >Libin > >-----Original Message----- >From: Eric Hoogenboom [mailto:erichoogenboom@YAHOO.COM] >Sent: Monday, June 19, 2006 9:31 AM >To: SAS-L@LISTSERV.UGA.EDU; Xu Libin >Subject: Re: How to read a text file with comma as the demiliter? > >Specify the delimiter dlm=',' in the infile statement. > >Hth, >Eric


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