Date: Fri, 31 Mar 2006 14:32:29 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Print variable names to external file
In-Reply-To: <200603311416.k2VBkKHM002958@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed
Thomas ,
proc sql noprint ;
select '@'||strip(put(npos+2,8.))||' '||quote(strip(Name)) ,
'@'||strip(put(npos+2,8.))||' '||Name
into : FirstPut separated by ' ' ,
: SecondPut separated by ' '
from dictionary.columns
where Libname = 'SASHELP'
and Memname = 'CLASS' ;
quit ;
data _null_ ;
file print ;
set sashelp.class ;
if _n_ = 1 then put &FirstPut ;
put &SecondPut ;
run ;
Toby Dunn
From: Thomas <tythong@YAHOO.COM>
Reply-To: Thomas <tythong@YAHOO.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Print variable names to external file
Date: Fri, 31 Mar 2006 09:16:30 -0500
Hi,
I am using the data step to export the data to external text file
by "FILE" & "PUT" statements, but may I know how do I print the variable
names (header) on the first row of the output file and the data start from
the second row of the file? In other words, I will have the names of the
variables corresponding to each column.
Thanks and regards,
Thomas
|