05-12-2014 03:00 PM
I have a dataset with 2 observations. I want to write them to a .csv file with the second observation first and the first observation second. E.g. my data looks like
var1 var2 var3 var4
b1 b2 b3 b4
a1 a2 a3 a4
I want my .csv looks like
I tried 'put' statement with _ALL_ instead of listing the variable names explicitly because there are thousands of variables, it writes 'var1=xxxxx var2=xxxxx' which I don't like. I only want the values to be written in the .csv file.
Thank you very much for your help.
05-12-2014 03:40 PM
I would sort the data so that it is in the order you want and then try proc export.
If you want to reverse the order of the data set;
proc sort data=want out=sorted(drop=order); by descenting order; run;
then export to csv.