From: ash007 on
Hello Sas-Users,

I would like to count the number of line of an Excel Sheet in order to
put this number in a Sas macro-variable.

Unfortunately, in my SAS Software (Windows) I have not the right to
import an Excel sheet. How can I do with DDE please.

Thanks.

ash007.
From: Arthur Tabachneck on
Ash,

While the safest way is to import the data, then use proc sql to get the
number of rows, Koen Vyverman has a paper that describes how to obtain such
metadata (if present) in a spreadsheet. Take a look at the paper titled:

"Using Dynamic Data Exchange to Export Your SAS® Data to MS Excel — Against
All ODS, Part I." Proceedings of the 26th SAS Users Group International
Conference, 2001

You can download a copy of it at:
http://www.sas-consultant.com/professional/papers.html

HTH,
Art
---------
On Sun, 6 Dec 2009 09:47:11 -0800, ash007 <ramsamyashley(a)GMAIL.COM> wrote:

>Hello Sas-Users,
>
>I would like to count the number of line of an Excel Sheet in order to
>put this number in a Sas macro-variable.
>
>Unfortunately, in my SAS Software (Windows) I have not the right to
>import an Excel sheet. How can I do with DDE please.
>
>Thanks.
>
>ash007.
From: Wensui Liu on
if i were you, i will get this count value into a cell in excel file and
then ask sas to read the value of this cell so as to get the count number of
lines.

On Sun, Dec 6, 2009 at 12:47 PM, ash007 <ramsamyashley(a)gmail.com> wrote:

> Hello Sas-Users,
>
> I would like to count the number of line of an Excel Sheet in order to
> put this number in a Sas macro-variable.
>
> Unfortunately, in my SAS Software (Windows) I have not the right to
> import an Excel sheet. How can I do with DDE please.
>
> Thanks.
>
> ash007.
>



--
==============================
WenSui Liu
Blog : statcompute.spaces.live.com
Tough Times Never Last. But Tough People Do. - Robert Schuller
==============================
From: Proc Me on
For an alternative approach, have a look at Chang Chung's comment
(http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0911a&L=sas-l&D=0&X=425EED7CEBA9567EEB&P=30198)
on exporting data to Excel.

You could extend this approach to use VBA to generate a file with metadata
about a spreadsheet. In this case you are after the number of observations,
which, assuming data starts in cell A1 of sheet mySheet is returned with

ActiveWorkbook.Sheets("mySheet").Cells(1, 1).CurrentRegion.Rows.Count

You could get VBA to write this data to a cell in a new workbook or a new
sheet, or to a text file, which could then be imported into SAS.

I hope this helps,

Proc Me
From: Vishwanath on
On Dec 6, 11:11 pm, pro...(a)CONCEPT-DELIVERY.COM (Proc Me) wrote:
> For an alternative approach, have a look at Chang Chung's comment
> (http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0911a&L=sas-l&D=0&X=425E...)
> on exporting data to Excel.
>
> You could extend this approach to use VBA to generate a file with metadata
> about a spreadsheet. In this case you are after the number of observations,
> which, assuming data starts in cell A1 of sheet mySheet is returned with
>
> ActiveWorkbook.Sheets("mySheet").Cells(1, 1).CurrentRegion.Rows.Count
>
> You could get VBA to write this data to a cell in a new workbook or a new
> sheet, or to a text file, which could then be imported into SAS.
>
> I hope this helps,
>
> Proc Me

thanks for your answers !

ash007.