Date: Fri, 22 Sep 2006 12:11:47 -0400
Reply-To: "Gerstle, John (CDC/CCID/NCHSTP) (CTR)" <yzg9@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Gerstle, John (CDC/CCID/NCHSTP) (CTR)" <yzg9@CDC.GOV>
Subject: Re: Order variables when exporting to Excel
Content-Type: text/plain; charset="US-ASCII"
I would guess the answer is no. PROC EXPORT/IMPORT are
moving/reading/converting/etc. datasets from one package to another.
The other methods mentioned are CREATING a dataset/output, so you have
more flexibility when creating the dataset/output file. The order of
variables in a dataset is irrelevant to analyses. The order only
benefits us humans reading the dataset/output file.
John Gerstle, MS
Biostatistician
Northrop Grumman
CDC Information Technological Support Contract (CITS)
NCHSTP \DHAP \HICSB \Research, Analysis, and Evaluation Section
Centers for Disease Control and Prevention
"Boss. We've got cats." "Meow"
"All truth passes through three stages:
First, it is ridiculed;
Second, it is violently opposed;
Third, it is accepted as being self-evident."
- Arthur Schopenhauer (1830)
>>-----Original Message-----
>>From: owner-sas-l@listserv.uga.edu
[mailto:owner-sas-l@listserv.uga.edu]
>>On Behalf Of Kevin Bladon
>>Sent: Friday, September 22, 2006 12:06 PM
>>To: toby dunn
>>Cc: kevin.bladon@silvacom.com; SAS-L@LISTSERV.UGA.EDU
>>Subject: RE: Order variables when exporting to Excel
>>
>>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)
|