[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: put _ALL_ statement
From:       "Syed, Mahammad Asif (GEI, GEFA, Contractor)"
Date:       2003-07-31 21:14:56
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic