<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799806#M314534</link>
    <description>&lt;P&gt;Please stop writing text in upcase.&lt;/P&gt;
&lt;P&gt;Afaik you can't get the number of obs without reading the file.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2022 11:25:20 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-03-03T11:25:20Z</dc:date>
    <item>
      <title>HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799798#M314529</link>
      <description>&lt;P&gt;&lt;BR /&gt;%macro obs_count(input=);&lt;BR /&gt;%global dsid rc cnt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;%let rc=%sysfunc(filename(data,&amp;amp;input));&amp;nbsp;&lt;BR /&gt;&amp;nbsp;%if &amp;amp;rc.=0&lt;/P&gt;&lt;P&gt;%then %put success; */&lt;BR /&gt;%let did = %sysfunc(fopen(&amp;amp;data));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;did.&amp;gt;0 %then&lt;BR /&gt;%put can open;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;*/MY EXTERNAL FILE CAN BE OPENED*/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;did %then&lt;BR /&gt;%do;&lt;BR /&gt;%let cnt=%sysfunc(attrn(&amp;amp;did, NVARS));&amp;nbsp; &amp;nbsp;&lt;STRONG&gt;/*THIS GIVES FOR A DATASE I WANT FOR AN EXTERNAL EXCEL FILE*/&lt;/STRONG&gt;&lt;BR /&gt;/*%put &amp;amp;cnt.;&lt;BR /&gt;%end;*/&lt;/P&gt;&lt;P&gt;/* %let rc=fdelete('testdir'); */&lt;BR /&gt;%let rc = %sysfunc(close(&amp;amp;did));&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%obs_count(input=/home/u60099960/sasuser.v94/sashelp.xlsx)&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 10:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799798#M314529</guid>
      <dc:creator>ANIRBAN2</dc:creator>
      <dc:date>2022-03-03T10:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799806#M314534</link>
      <description>&lt;P&gt;Please stop writing text in upcase.&lt;/P&gt;
&lt;P&gt;Afaik you can't get the number of obs without reading the file.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 11:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799806#M314534</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-03-03T11:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799810#M314536</link>
      <description>One way would be to treat the xlsx file as a zip archive and get the value of the dimension ref element in book\xl\worksheets\sheet1.xml.&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Mar 2022 12:01:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799810#M314536</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-03-03T12:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799812#M314538</link>
      <description>&lt;P&gt;After exporting sashelp.class using proc export i see&lt;/P&gt;
&lt;PRE&gt;&amp;lt;dimension ref="A1:E1048576"/&amp;gt;&lt;/PRE&gt;
&lt;P&gt;in the xml-file. E1048576 seems to be wrong &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 12:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799812#M314538</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-03-03T12:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799859#M314561</link>
      <description>&lt;P&gt;In practicality I would say it can't be done. Even importing the data you can have issue with actual observations versus rows of data in Excel.&lt;/P&gt;
&lt;P&gt;Multiple header rows means any count of just "rows" occupied by Excel would be off by the number of header rows minus 1 for most cases.&lt;/P&gt;
&lt;P&gt;Also Excel has an annoying habit for manually edited files of creating "phantom" occupied cells. A cell that has ever been populated even if deleted can create rows with no actual data that will be treated by Excel as "observations" with all missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get lots of Excel files that have as many as 20,000 "rows" of all missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW, this one reason that Excel files can get pretty large even though not much read data is in them. These marked cells all have overhead.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 14:23:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/799859#M314561</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-03T14:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/800046#M314667</link>
      <description>&lt;P&gt;What is the purpose of fopen function ?What operation can be done after opening a external file using fopen ??&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 03:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/800046#M314667</guid>
      <dc:creator>ANIRBAN2</dc:creator>
      <dc:date>2022-03-04T03:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO COUNT NUMBER OF OBSERVATION IN A EXCEL FILE WITHOUT IMPORTING IN SAS ENVIRONMENT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/800050#M314671</link>
      <description>&lt;P&gt;Once you have a file opened with FOPEN() you can then begin reading the lines from it using FREAD().&amp;nbsp; And close it with FCLOSE().&amp;nbsp; &amp;nbsp;It has no value for this problem and very little value for most problems.&amp;nbsp; &amp;nbsp;You could read an XSLX file as binary bytes using FREAD() but you could not make any sense of it.&amp;nbsp; And if the file was really just a text file then just run a data step to read it.&amp;nbsp; No need to use these file functions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to see it put to use check out this macro:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sasutils/macros/blob/master/fread.sas" target="_blank"&gt;https://github.com/sasutils/macros/blob/master/fread.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 03:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HOW-TO-COUNT-NUMBER-OF-OBSERVATION-IN-A-EXCEL-FILE-WITHOUT/m-p/800050#M314671</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-04T03:42:27Z</dc:date>
    </item>
  </channel>
</rss>

