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 (February 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 5 Feb 2003 15:39:43 -0600
Reply-To:     Kevin Myers <KevinMyers@AUSTIN.RR.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Kevin Myers <KevinMyers@AUSTIN.RR.COM>
Subject:      Re: comma delimited field parsing
Content-Type: text/plain; charset="iso-8859-1"

If you can insure that your original strings won't include quoted values with imbedded commas, then you can go with Michael's approach of using tranwrd to pre-process the string before passing it into scan(). However, in the more general case that won't work because it will alter any values within quotes that include embedded commas.

s/KAM

----- Original Message ----- From: "Charles Patridge" <Charles_S_Patridge@PRODIGY.NET> Newsgroups: bit.listserv.sas-l To: <SAS-L@LISTSERV.UGA.EDU> Sent: Wednesday, February 05, 2003 2:47 PM Subject: Re: comma delimited field parsing

> Michelle, > > In the documentation of SAS, here is what I found: > > /*** SCAN FUNCTION: > SAS Language - Version 6 - Chapter 11 - Page 595 > Leading Delimiters before the first word have no effect. If there are > two or more contiguous delimiters, SCAN treats them as one. > ***/ > > > I'll see what I can do to get what you would like. > Regards, > Charles Patridge > > If you were reading in VAR1 = "a,b,c,d,e,f" from an external file, then > I would have suggested using the DSD option of the INFILE statement which > should have worked even if you had such strings as ",,c,,e,f". > > but dealing with a SAS variable already in that form requires a different > solution.


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