From: Gerhard Hellriegel on
Arthur,
that seems to be another problem. I didn't try it, but this is a copy from
the 9.1.3 documentation:

proc export data=myfiles.grades1
dbms=excel2000
outfile='c:\Myfiles\Grades.xls';

sheet=Grades1;
run;

Gerhard




On Sun, 28 Feb 2010 08:38:02 -0800, Arthur Tabachneck
<art297(a)NETSCAPE.NET> wrote:

>Neil,
>
>Regarding point 3, yes I have tried it, but only on 9.1.3. On 9.1.3
>my log shows the following:
>
>79 sheet='01';
> -----
> 180
>
>ERROR 180-322: Statement is not valid or it is used out of proper
>order.
>
>Is it now possible with 9.2? If not, are you simply overwriting
>sheet1?
>
>Art
>------------
>On Feb 27, 7:41 pm, neil <nei...(a)gmail.com> wrote:
>> 1 and 2 my typo.
>> 3, dbms=xls does support sheet. Have you ever tried?
>> 4. The problem is, after you open and change the excel file, then
>> export another dataset to the same excel file, the date format will be
>> lost.
>>
>> On Feb 27, 9:35 am, art...(a)NETSCAPE.NET (Arthur Tabachneck) wrote:
>>
>>
>>
>> > Neil,
>>
>> > Unless a number of things have changed in 9.2, I'd guess that you and
>> > SAS are simply interpreting your statements differently.
>>
>> > A number of things:
>>
>> > 1. I don't think the proc export command is supposed to end with a
>> > semi-colon.
>> > 2. when you specified dmbs did you mean dbms?
>> > 3. I don't think that the xls engine supports the sheet= option
>> > 4. I think that the xls engine formats all dates and datetimes as
>> > date9 unless you set the sas system option (I'm not sure if I remember
>> > the correct option name but it is something like) sasdatefmt.
>>
>> > HTH,
>> > Art
>> > -------------
>> > On Feb 27, 5:33 am, neil <nei...(a)gmail.com> wrote:
>>
>> > > I think it's very weird. And it's very easy to reproduce the
problem.
>>
>> > > SAS 9.2 (32-bit/64-bit)
>>
>> > > proc export data=whatever_dataset_with_datetime;
>> > > outfile='path\filename'
>> > > dmbs=xls replace;
>> > > sheet='01';
>> > > run;
>>
>> > > Note: the reason I am using "dbms=xls" instead of "dbms=excel" is
xls
>> > > is only option in 64-bit sas. This "XLS" causes the following
problem.
>>
>> > > After you submit it, everything is fine.
>>
>> > > OPEN the excel and SWITCH two columns, THEN SAVE it.
>>
>> > > run the same code again but with sheet='02', open the excel file,
you
>> > > will find the date format in sheet02 is LOST.
>>
>> > > Do you know what's the fix?
>>
>> > > Thanks- Hide quoted text -
>>
>> - Show quoted text -
From: Arthur Tabachneck on
Gerhard,

I think you missed the part of the OP's original post indicating that the
dbms had to be xls. Yes, I know sheet= will work with the various Excel
engines, but I don't think it works with the xls engine.

Art
--------
On Mon, 1 Mar 2010 06:29:17 -0500, Gerhard Hellriegel
<gerhard.hellriegel(a)T-ONLINE.DE> wrote:

>Arthur,
>that seems to be another problem. I didn't try it, but this is a copy from
>the 9.1.3 documentation:
>
>proc export data=myfiles.grades1
> dbms=excel2000
> outfile='c:\Myfiles\Grades.xls';
>
> sheet=Grades1;
>run;
>
>Gerhard
>
>
>
>
>On Sun, 28 Feb 2010 08:38:02 -0800, Arthur Tabachneck
><art297(a)NETSCAPE.NET> wrote:
>
>>Neil,
>>
>>Regarding point 3, yes I have tried it, but only on 9.1.3. On 9.1.3
>>my log shows the following:
>>
>>79 sheet='01';
>> -----
>> 180
>>
>>ERROR 180-322: Statement is not valid or it is used out of proper
>>order.
>>
>>Is it now possible with 9.2? If not, are you simply overwriting
>>sheet1?
>>
>>Art
>>------------
>>On Feb 27, 7:41 pm, neil <nei...(a)gmail.com> wrote:
>>> 1 and 2 my typo.
>>> 3, dbms=xls does support sheet. Have you ever tried?
>>> 4. The problem is, after you open and change the excel file, then
>>> export another dataset to the same excel file, the date format will be
>>> lost.
>>>
>>> On Feb 27, 9:35 am, art...(a)NETSCAPE.NET (Arthur Tabachneck) wrote:
>>>
>>>
>>>
>>> > Neil,
>>>
>>> > Unless a number of things have changed in 9.2, I'd guess that you and
>>> > SAS are simply interpreting your statements differently.
>>>
>>> > A number of things:
>>>
>>> > 1. I don't think the proc export command is supposed to end with a
>>> > semi-colon.
>>> > 2. when you specified dmbs did you mean dbms?
>>> > 3. I don't think that the xls engine supports the sheet= option
>>> > 4. I think that the xls engine formats all dates and datetimes as
>>> > date9 unless you set the sas system option (I'm not sure if I
remember
>>> > the correct option name but it is something like) sasdatefmt.
>>>
>>> > HTH,
>>> > Art
>>> > -------------
>>> > On Feb 27, 5:33 am, neil <nei...(a)gmail.com> wrote:
>>>
>>> > > I think it's very weird. And it's very easy to reproduce the
>problem.
>>>
>>> > > SAS 9.2 (32-bit/64-bit)
>>>
>>> > > proc export data=whatever_dataset_with_datetime;
>>> > > outfile='path\filename'
>>> > > dmbs=xls replace;
>>> > > sheet='01';
>>> > > run;
>>>
>>> > > Note: the reason I am using "dbms=xls" instead of "dbms=excel" is
>xls
>>> > > is only option in 64-bit sas. This "XLS" causes the following
>problem.
>>>
>>> > > After you submit it, everything is fine.
>>>
>>> > > OPEN the excel and SWITCH two columns, THEN SAVE it.
>>>
>>> > > run the same code again but with sheet='02', open the excel file,
>you
>>> > > will find the date format in sheet02 is LOST.
>>>
>>> > > Do you know what's the fix?
>>>
>>> > > Thanks- Hide quoted text -
>>>
>>> - Show quoted text -