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 (July 2003, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 31 Jul 2003 17:14:56 -0400
Reply-To:   "Syed, Mahammad Asif (GEI, GEFA, Contractor)" <MahammadAsif.Syed@GE.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Syed, Mahammad Asif (GEI, GEFA, Contractor)" <MahammadAsif.Syed@GE.COM>
Subject:   Re: put _ALL_ statement
Content-Type:   text/plain; charset="iso-8859-1"

Thanks to all of you who has responded my e-mail. I found export wizard in unix very useful to create a comma-seperate file from the sas dataset directly.

Regards, Asif

-----Original Message----- From: Paul Dorfman [mailto:paul_dorfman@HOTMAIL.COM] Sent: Thursday, July 31, 2003 4:11 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: put _ALL_ statement

>From: Mike Rhoads <RHOADSM1@WESTAT.COM> > >Asif, > >Here's a cute little trick that seems to work (minimally tested) -- change >your PUT statement to: >PUT (_ALL_) (+0);

Mike,

Perhaps it would make sense to separate character and numeric variables, so that a format could be applied to the numbers. Plus, since it was requested that the values be comma-separated, why not hit both targets using the tilde (~) modifier and dlm=',' on the FILE statement:

67 data _null_ ; 68 array nn (5) (123 5.6 1023456.7891234 0.00987654 0ffab0dx) ; 69 array cc (5) $12 ('symbols' 'characters' 'bytes' 'string' 'letters') ; 70 file log dlm = ',' ; 71 put (_character_) (~) (_numeric_) (~ :best15.) ; 72 run ; ---------------------------------------------------------------------------- ------------ symbols,characters,bytes,string,letters,123,5.6,1023456.7891234,0.00987654,1 6755469

Methinks it was Peter Crawford who has invented this wheel.

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

>For an explanation of the difference between _ALL_ and (_ALL_), see >http://support.sas.com/sassamples/quicktips/printvar.html. > >Mike Rhoads >Westat >RhoadsM1@Westat.com > >-----Original Message----- >From: Syed, Mahammad Asif (GEI, GEFA, Contractor) >[mailto:MahammadAsif.Syed@GE.COM] >Sent: Wednesday, July 30, 2003 2:33 PM >To: SAS-L@LISTSERV.UGA.EDU >Subject: put _ALL_ statement > > >data ibg; >set ibg; >if ranuni(3167702)<0.1; >count+1; if count>10 then stop; >run; > >data _null_; >set ibg; >file '/export/home/asyed/ibg.txt' lrecl=1000; >put _ALL_; >run; > >Hi, > I have the following codes and all I'm trying to create a comma >delimited >flat file and the dataset ibg has 400 variables and I don't want to type >all >the fields in my put statement. But with put _ALL_ , it's also printing the >variable name which I don't want. Can anybody help me in this? > >Thanks and Regards, >Asif

_________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail


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