Date: Wed, 20 Oct 2004 19:10:59 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: Sas to Excel questions
Mike,
My suggested solution will only work in SAS9 (I'm running SAS 9.12). As Ya
pointed out, this feature alone might make SAS9 worth the effort of
upgrading, although there are a number of other good reasons.
On the Import side, the problem Greg mentioned, is also corrected in SAS9.
One of Import's new options is the keyword "MIXED". If set to "no", the
problem Greg mentioned will still exist. However, if set to "yes", SAS will
correctly import a column that contains both character and numeric entries.
Art
-------
"Ross, Michael D" <michael.ross@ASTRAZENECA.COM> wrote in message
news:22F95BC7C879D211AB120008C7A43B8008B971E2@usuwphmsx01.usuwd.astrazeneca.net...
> Hi There,
> The "sheet" logic doesn't seem to be working in the following. Any
> suggestions?
>
> Tx.
>
> data one;
> input a $ b $ c $ ;
> datalines;
> aaaaaaaa bbbbbbbb cccccccc
> ;run;
> data two;
> input d $ e $ f $ ;
> datalines;
> dddddddd eeeeeeee ffffffff
> ;
> run;
> data three;
> input g $ h $ i $ ;
> datalines;
> gggggggg hhhhhhhh iiiiiiii
> ;
> run;
>
> PROC EXPORT DATA= WORK.one
> OUTFILE= "C:\excel.xls"
> DBMS=EXCEL REPLACE;
> SHEET="one";
> RUN;
> PROC EXPORT DATA= WORK.two
> OUTFILE= "C:\excel.xls"
> DBMS=EXCEL REPLACE;
> SHEET="sheet2";
> RUN;
>
> PROC EXPORT DATA= WORK.three
> OUTFILE= "C:\excel.xls"
> DBMS=EXCEL REPLACE;
> SHEET="sheet3";
> RUN;
>
> -----Original Message-----
> From: Jim Hoffman [mailto:jshoffman@dbsicorp.com]
> Sent: Tuesday, October 19, 2004 10:04 PM
> To: Ross, Michael D
> Subject: RE: Sas to Excel questions
>
>
> Here is an example of creating a new tab.
>
> filename excel dde 'EXCEL|SYSTEM';
> data _null_;
> file excel;
> put '[error(false)]';
> put '[file.close(false)]';
> put '[new(1)]';
> put '[save.as("c:\temp\color")]';
> run;
>
> It assumes that Excel Is running and has a spreadsheet open. It will
> close the existing spreadsheet and create one with one tab "sheet1" then
> save it.
>
> Regards, Jim Hoffman
>
>
> -----Original Message-----
> From: Ross, Michael D [mailto:michael.ross@ASTRAZENECA.COM]
> Sent: Tuesday, October 19, 2004 3:02 PM
> Subject: Sas to Excel questions
>
>
> Hi All,
> I'm trying to create multiple tabs in excel programatically from Sas
> (4-6 tabs). I looked at the Sas-L archives and had no luck. Does
> anyone have some example code to help me do this task?
>
> Also, does anyone know if you declare specific columns in excel
> "Read-only" and how to allow other columns to be written too in the same
> "tab" of a workbook programatically.
>
> Thanks.
> Mike
|