Date: Thu, 13 Mar 1997 09:57:54 PST
Reply-To: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: TWB2%Rates%FAR@GO50.COMP.PGE.COM
Subject: Re: output a csv file ?
Check out the format list option. If you give a PUT statement a list of values
and a list of formats, and there are more values than formats, it repeats the
list. The syntax looks something like:
DATA _NULL_;
FILE 'MYDATA.CSV' ;
SET MYDISK.STUFF;
PUT V1--V732 (6.3 ',') V733 ;
RUN;
I broke out V733 separately to avoid a trailing comma. You can see this uses
extra space compared to a tuned PUT statement. How much is your time worth?
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
----------------------[Reply - Original Message]----------------------
Sent by:Brad Palmquist <blp@PALM.HARVARD.EDU>
Is there an easy way to output a csv (comma separated) ASCII
data file? I can use put (e.g., put v1 ',' v2 ',' v3), but
my dataset has hundreds of variables. I'd like to just specify
a var list and then have the values separated by commas rather
than spaces.
--
__________________________________________________________________
Brad Palmquist 617-495-9564 (voice)
Department of Government 617-495-0438 (FAX)
Harvard University b_palmquist@harvard.edu
=====================================================================