Date: Tue, 19 Feb 2008 12:16:47 -0500
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: data step
Content-Type: text/plain; charset=ISO-8859-1
I don't like PROC EXPORT. In my opinion, many people where crying "why
does SAS have no IMPORT / EXPORT option, like many other windows tools...?"
so finally they made something.
You wrote it, there are many different ways to bring data to excel. A CSV
file, created by a DATA _NULL_ step with PUTs (for SAS 6 I had a macro
which does that very comfortable, but something like PROC EXPORT...)
What I like very much is to use ODS with type HTML. EXCEL can read that
and takes all the formatting, colours, traffic lighting, fonts and other
attributes, which I can use in PROC REPORT. The results are very nice.
Like you wrote, in almost all other PROCs you can tell which variables, in
which format, in which order they are displayed. For me there is no reason
to use EXPORT. I use ODS HTML and give the file the aaa.XLS name. That's
good enough for me.
Gerhard
On Tue, 19 Feb 2008 12:01:08 -0500, Ashley Sanders <asanders@UFL.EDU>
wrote:
>I was watching the spin off about retain with interest, but had lost sight
>of the original question about exporting to Excel. I kept trying to figure
>out why it would be important to reorder the variables in a dataset. Now I
>have two questions for the list:
>
>What other reasons are there for actually changing the 'order' of
variables
>in a dataset?
>Since export to Excel is one time when order of variable handling could be
>extremely important, why is it the one place you can't just specify the
>order you want in the Export or other file-handling proc? --given, you
could
>output a csv or some other type of Excel-readable format with a number of
>procedures that would let you order anyway you want. What would you really
>give up if you used ODS to output a file for instance (i.e. what can that
>export with excel engine do that other ways can't)? --I guess that's 3
>questions...
>
>>>-----Original Message-----
>>>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
>>>Gerhard Hellriegel
>>>Sent: Tuesday, February 19, 2008 11:49 AM
>>>To: SAS-L@LISTSERV.UGA.EDU
>>>Subject: Re: data step
>>>
>>>you can also try to change the order of the variables:
>>>
>>>data test;
>>> retain fname lname;
>>> set test;
>>>run;
>>>
>>>if that is exported in wrong order, try
>>>
>>> retain lname fname;
>>>
>>>don't know what PROC EXPORT is doing. From left to right or from right
>>>to
>>>left?
>>>
>>>Gerhard
>>>
>>>
>>>
>>>On Tue, 19 Feb 2008 11:19:04 +0800, Hu, Jiangtang
>>><jiangtanghu@GMAIL.COM>
>>>wrote:
>>>
>>>>proc sql may help you. Like this:
>>>>
>>>>data a;
>>>> input lname$ fname$;
>>>> cards;
>>>> lname1 fname1
>>>> lname2 fname2
>>>> ;
>>>>run;
>>>>
>>>>*proc sql;
>>>> create table c as
>>>> select fname, lname
>>>> from a;
>>>>quit;*
>>>>
>>>>proc export data=c
>>>> outfile="d:\c.xls"
>>>> dbms=excel replace;
>>>>run;
>>>>
>>>>On Feb 19, 2008 10:55 AM, Miguel de la Hoz <miguel_hoz@yahoo.es>
>>>wrote:
>>>>
>>>>> I am starting my problem with the following disposal of my dataset:
>>>>>
>>>>> # variable
>>>>> 1 lname
>>>>> 2 fname
>>>>>
>>>>> I am trying to export it to excel but it is keeping that order. I
>>>would
>>>>> like to be able to write
>>>>>
>>>>> # variable
>>>>> 1 fname
>>>>> 2 lname
>>>>>
>>>>> This is only an example my dataset contains around 20 fields.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> MDH.
>>>>>
>>>>>
>>>>>
>>>>> ______________________________________________
>>>>> ?Con Mascota por primera vez? Sé µn mejor Amigo. Entra en Yahoo!
>>>>> Respuestas http://es.answers.yahoo.com/info/welcome
>>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>Jiangtang Hu
>>>>Peking University
|