Date: Thu, 18 Jun 2009 13:51:55 -0400
Reply-To: Mike Rhoads <RHOADSM1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Rhoads <RHOADSM1@WESTAT.COM>
Subject: Re: ODS CSV w/o quotes
In-Reply-To: <104836c5-fb3d-41a8-a3a3-0ddb0accfe60@v4g2000vba.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"
Richard,
OK, maybe a little easier than I thought ... ;-)
Of course, you'd have to get a bit fancier to make it robust, since this could produce an unusable file if there were quotes in the original character string. Still probably wouldn't take much to test for that scenario and add and double the quotes only when necessary ...
The ambition probably refers to "getting into" tagsets in the first place, rather than the degree-of-difficulty once you have some idea what they're doing.
Mike Rhoads
RhoadsM1@Westat.com
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Richard A. DeVenezia
Sent: Thursday, June 18, 2009 1:01 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: ODS CSV w/o quotes
On Jun 18, 8:39 am, RHOAD...@WESTAT.COM (Mike Rhoads) wrote:
> Keith,
>
> Since ODS CSV, is actually a tagset, the safest option would be to
> create a modified version of the tagset. You'd have to be feeling
> relatively ambitious, though.
Mike:
Hardly any ambition at all is needed. View the source of tagsets.csv and see that quoting is controlled by the QUOTES event. All you need to do is created a new tagset based on CSV and override the QUOTES event so that it does nothing (and hence nothing gets quoted)
-----------------------------------
ods path
sasuser.templat (update)
sashelp.tmplmst (read)
;
proc template;
define tagset
tagsets.csvnoq / store=sasuser.templat;
parent=tagsets.csv;
define event quotes;
end;
end;
run;
ods tagsets.csvnoq file="%sysfunc(pathname(WORK))\myoutput.csv";
proc print noobs data=sashelp.class;
run;
ods _all_ close;
-----------------------------------
Richard A. DeVenezia
http://www.devenezia.com