Date: Wed, 12 May 2004 14:05:43 -0400
Reply-To: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Subject: Re: exporting to text file without quotes
If you have semicolons etc. within a character field the export procedure
will put the entire field in double quotes. If ever, you have to read this
back as SAS data, those double quotes may be critical and I would keep
them. That said, if you want an alternate way:
data export ;
array nums (5) ;
retain nums 9 ;
array chars (5) $30 ;
retain chars "has ; a , a - and other *#" ;
run ;
options validvarname = v7 ;
data _null_ ;
set export ;
file "C:\CDID\data1.txt" ;
put (_all_) (:) ;
run ;
Additional code is needed to get the variable names in the first row if you
want to mimic the EXPORT procedure.
Venky Chakravarthy
On Wed, 12 May 2004 12:59:07 -0400, Kerri Rivers <kerrir@PRB.ORG> wrote:
>i don't think it has tabs embedded in it, but i could be wrong. i hadn't
>thought of that. perhaps i should try a different delimiter to see if that
>eliminates the problem.
>
>the format is $90. it has semicolons, parentheses, and dashes in it.
>
>-----Original Message-----
>From: Bruce Johnson
>To: Kerri Rivers; SAS-L@LISTSERV.UGA.EDU
>Sent: 5/12/2004 12:53 PM
>Subject: RE: exporting to text file without quotes
>
>Does that field have tabs embedded in it?
>
>________________________________
>Bruce A. Johnson
>bjohnson@solucient.com
>
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
>Kerri Rivers
>Sent: Wednesday, May 12, 2004 11:52 AM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: exporting to text file without quotes
>
>
>hi all,
>i'm exporting a dataset to a text file using PROC EXPORT. there is one
>text variable that is exporting with double quotation marks around it.
>is it possible to export without those quotation marks? i need to get
>rid of them and i'm not sure how to do it. i tried the help files and
>searched the SAS-L archives, but couldn't find any documentation on
>this. here's my
>code:
>
>proc export data=work.export
> outfile = 'C:\CDID\data1.txt'
> dbms=tab replace;
>run;
>
>thanks for any help!
>~kerri
>This message is a private communication. It may contain information that
>is confidential
>and legally protected from disclosure. If you are not an intended
>recipient, please do
>not read, copy or use this message or any attachments, and do not
>disclose them to others.
>Please notify the sender of the delivery error by replying to this
>message, and then
>delete it and any attachments from your system.
>Thank you,
>Solucient LLC
>(rev eXclaimer 2x)
|