|
On Thu, 11 Oct 2001 12:06:26 -0400, Fred Gehm <fred.x.gehm@HOUSEHOLD.COM>
wrote:
>Hi SAS-L'ers:
>
>1. I'm trying to querry a spreadsheet to find out what worksheets it
>contains. The commented input line below reads from Excel, but it doesn't
>seem to read enough. It cuts off at 256 characters. Any ideas?
>
>%let dataLoc = excel spreadsheet location... ;
>%let spreadSName = excel spreadsheet name... ;
>run;
>
>
>x "&excelLoc\excel.exe";
>data _null_; x=sleep(5);run;
>filename cmd dde 'excel|system!topics';
>data _null_;
> file log;
> length line $ 200;
> file cmd;
> put '[error(false)]';
> line = '[open('||quote("&dataLoc\&spreadSName")||', ,TRUE, , , ,TRUE)]';
> file log;
> put line;
> file cmd;
> put line;
> put '[error(true)]';
> put '[app.minimize()]';
>run;
>data _null_; x=sleep(5);run;
>data _null_;
> infile cmd length=length;
> length line $ 1000 phrase sheetnamePlus$ 200 sheetname $ 50;
> * retain dataLoc fileName;
> * dataLoc = "&dataLoc";
> * fileName = "&&&file&kount";
> * defaultKount = &defaultKount;
> input @;
> input line $varying. length; /*this line should read more than it does*/
>** input @1 line $1000.;
>** input @;
>** input line1 $varying. length;
> put // line=;
>run;
>
>2. Thanks to Rob Workman, William Viergever, and Mark Terjeson for the
help.
>I should have explained that I don't own the Excel file so I can't turn
>it's error messages off. Opps. Sorry. The line:
>
> put '[error(false)]';
>
>seams to work about half the time. I haven't noticed a partern to it's
>failures.
>
>3. Does anyone ever spell Willaim Viergever's name right????
I'm not sure if that helps! Just an idea: try to use the lrecl=1000 (or
more) option in the INFILE statement. The SAS default is 256. Maybe that is
not possible for DDE, but try it...
|