Hi,
I'll need to export sas data set to excel file. The variable names need to be in a specific order. I used file, put statement to make variable names in the correct order. But once I use proc export, the variables are in alphabet order again. Please help. Thanks,
Hi,
I was able to output the data to csv file. Variable names are not in the file but they are in order I want. Anyone has idea to include variable names? Thanks,
%let dataout2=myfile.csv;
data _NULL_;
set mydata;
file "&dataout" DLM=',' LRECL=2000 ;
put firstvar secvar ........... lastvar;
run;
Just use PROC SQL to order your variables in the order you want, before your PROC EXPORT.
[pre]proc sql;
create view EXPORT as
select variale1 as Variable_1
, mysasdata as Start_date format=ddmmyy.
, etc as last_var format=z10.
from mysasdata;
quit;