Date: Fri, 22 Sep 2006 10:06:28 -0600
Reply-To: Kevin Bladon <kevin.bladon@SILVACOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Kevin Bladon <kevin.bladon@SILVACOM.COM>
Organization: Silvacom Ltd.
Subject: Re: Order variables when exporting to Excel
In-Reply-To: <BAY123-F4A46D8626BE16B71CB2D9DE210@phx.gbl>
Content-Type: text/plain; charset=UTF-8
Hello all,
Thanks for the replies... the previous methods work on their own. However, is it possible to re-order the output variables to Excel using PROC
EXPORT. For example... I would like the following data to be exported to Excel , but in the order age, ht.
data one;
 input id ht age;
cards;
1Â 22Â Â Â 62
2Â 22Â Â Â 72
3Â 22Â Â Â 82
4Â 33Â Â Â 76
5Â 33Â Â Â 66
6Â 44Â Â Â 78
;
run;
PROC EXPORT DATA= One
OUTFILE='C:\Documents and Settings\test.xls'|OUTTABLE='Summary'
DBMS=EXCEL;
Thanks in advance!
Kevin.
On Sep 22, 2006 09:17, toby dunn wrote:
>Kevin ,
>
>Well without know how you are exporting your data set(s) it is pretty hard
>to tell you exactly how you need to do what you ask. Two things in general
>ome to mind:
>
>Var statement in a procedure
>
>And
>
>Retain statement in your data step that creates the data.
>
>Example:
>
>Data One ;
>A = 1 ;
>B = 2 ;
>C = 3 ;
>Run ;
>
>Data New ;
>Retains B C A ;
>Set One ;
>Run ;
>
>
>
>
>Toby Dunn
>
>When everything is coming at you all at once, your in the wrong lane.
>
>A truly happy person is someone who can smile and enjoy the scenery on a
>detour.
>
>
>
>
>
>From: Kevin Bladon
>Reply-To: Kevin Bladon
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Order variables when exporting to Excel
>Date: Fri, 22 Sep 2006 11:01:31 -0400
>
>Hello all,
>
>Does anyone know how to select the order that my variables (columns) will
>appear in Excel when exporting from SAS?
>
>Thanks,
>Kevin Bladon
>
>
Kevin Bladon, Ph.D., A.Ag.
Resource Analyst
Silvacom Ltd.
3825 - 93 Street
Edmonton, AB
T6E 5K5
Phone: 780.462.3238
Fax: 780.462.4726
E-mail: kevin.bladon@silvacom.com
www.silvacom.com
"Make every obstacle an opportunity."
                              - Lance Armstrong
                                Cancer survivor and 7 time Tour de France champion (1999-2005)