Date: Mon, 12 Sep 2011 14:31:45 -0500
Reply-To: Yu Zhang <zhangyu05@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Yu Zhang <zhangyu05@GMAIL.COM>
Subject: Re: Comma delimiter confusion
Content-Type: text/plain; charset=ISO-8859-1
if membername is quoted, it will be read in correctly. maybe there is an
option which can get SAS ignore the comma within the name. but can't you
just read them as two separated variable first then concatenate later?
On Mon, Sep 12, 2011 at 2:10 PM, Irin later <firstname.lastname@example.org> wrote:
> I extracted data from SQL Server to read in SAS. This is a comma delimited
> file (.csv). However, when I had read it into the SAS dataset I realized
> that it looked as a mess because some fields like membername had comma in
> their body (for ex, separating first and last name).
> It looks like SAS confused this comma with a comma delimiter ....So far
> all data was shifted to the right hand.
> Besides , other column pcpsitename also ha s comma inside....
> My understanding was that missover DSD in the below code would have resolve
> a problem but it did not.
> /*read into SAS from text file*/
> data siteidRead;
> infile 'F:\home\ProvidersSite\input\siteid.csv'
> delimiter=',' missover DSD ;
> memberid $ 10
> membername $ 20
> pcpsiteid $ 4
> pcpsitename $ 100
> serviceproviderid $ 10
> ServiceProviderName $ 80
> Serviceprovidertype $ 60
> primaryspecialty $ 80
> servicedatefrom $ 60;
> INPUT memberid membername pcpsiteid pcpsitename serviceproviderid
> ServiceProviderName Serviceprovidertype primaryspecialty servicedatefrom ;
> How can I overcome the issue?
> Thank you in advance!