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 (December 2002, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 11 Dec 2002 16:55:50 -0500
Reply-To:     sashole@bellsouth.net
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Paul M. Dorfman" <sashole@BELLSOUTH.NET>
Organization: Sashole of Florida
Subject:      Re: SAS au Fromage
Comments: To: Peter Crawford <peter.crawford@db.com>
In-Reply-To:  <OFF11E38B9.A92868E2-ON41256C8C.006BED6B@db.com>
Content-Type: text/plain; charset="US-ASCII"

> -----Original Message----- > From: Peter Crawford [mailto:peter.crawford@db.com] > > Hi Paul > I think when you ask this > "but does it really separate ", you may have missed > one efffect of the file statement DSD option. > >That inserts the comma delimiters > OK, not between the "constants" that might make a header

<big snip>

Peter,

What I actually forgot in the context of my reply was the DLM=',' option:

File log dlm = ',' ; Format _numeric_ 32. ; Put (_all_) (:) ;

will work the same way as the

put (_all_) (: 32. +(-1) ',') ;

As far as the DSD and the tilde are concerned, I was not even thinking of its effect (though should have been), so thanks for reminding and elucidating!

Kind regards, ------------------ Paul M. Dorfman Jacksonville, FL ------------------

> Antwort an: sashole@bellsouth.net > > Mike, > > Sure it is quick, but does it really separate the printed > values with commas? Plus, there is a potential caveat - SAS > will print numerics using the best12. format, so in the case > shown above, ACCTNO would be printed as 1.2345679E15, i.e. > result in unaffordable lost of precision. Perhaps this is a > little more robust and comma-separated: > > 146 data _null_ ; > 147 retain num1 123456 char1 'char1' > 148 acctno 1234567890123456 char2 'char22' > 149 ; > 150 put (_all_) (: 32. +(-1) ',') ; > 151 run ; > > 123456,char1,1234567890123456,char22 > > In the case the numbers are not integer, the format has to be > changed accordingly, for example, > > 156 data _null_ ; > 157 retain num1 123.456 char1 'char1' > 158 acctno 1234567890123456 char2 'char22' > 159 ; > 160 put (_all_) (: 32.3 +(-1) ',') ; > 161 run ; > > 123.456,char1,1234567890123456.000,char22 > > the side effect being the trailing zeroes when printing integers. > > Kind regards, > ------------------ > Paul M. Dorfman > Jacksonville, FL > ------------------ > > ----Original Message Follows---- > From: "Michael S. Zdeb" <msz03@HEALTH.STATE.NY.US> > > Hi...quick way to create a comma-separated value file from a > SAS data set... > > data _null_; > file 'c:\brie.csv' dsd; > set feta; > *** write only variables in data set feta; > put (_all_) (:); > run;


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