Date: Wed, 1 Apr 2009 22:08:43 -0500
Reply-To: "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "./ ADD NAME=Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: EXCEL libname engine update existing sheet.
In-Reply-To: <200904012226.n31JuHJ5000309@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
I have to add data to an existing sheet this method replaces the sheets.
On 4/1/09, Arthur Tabachneck <art297@netscape.net> wrote:
> datanull,
>
> You only asked which methods are available, without any mention of
> efficiency. I don't know if anyone would really want to try the
> following, but it will accomplish the task:
>
> *Build test spreadsheet;
> data test;
> input var1 var2 var3;
> cards;
> 1 1 1
> 2 2 2
> ;
>
> PROC EXPORT DATA= WORK.test
> OUTFILE= "c:\test.xls"
> DBMS=excel2000 replace;
> RUN;
>
> *import the test spreadsheet;
> PROC IMPORT OUT= WORK.TEST
> DATAFILE= "c:\test.xls"
> DBMS=EXCEL2000 REPLACE;
> GETNAMES=YES;
> RUN;
>
> *add desired records;
> data test;
> do until (eof ne 0);
> set test end=eof;
> output;
> end;
> infile cards end=eof2;
> do until (eof2 ne 0);
> input var1 var2 var3;
> output;
> end;
> cards;
> 3 3 3
> 4 4 4
> 5 5 5
> ;
>
> *export the modified spreadsheet;
> PROC EXPORT DATA= WORK.test
> OUTFILE= "c:\test.xls"
> DBMS=EXCEL2000 REPLACE;
> RUN;
>
> Art
> --------
> On Wed, 1 Apr 2009 13:48:53 -0500, ./ ADD NAME=Data _null_;
> <iebupdte@GMAIL.COM> wrote:
>
> >What SAS statements can I use to write observations to and existing
> >sheet. e.g. ex.'Sheet1$'n.
> >
> >I can use SQL; INSERT INTO but I would like to know other alternatives
> >if they exist.
>
|