<?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: Get size of binary file in bytes in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596858#M4859</link>
    <description>&lt;P&gt;As Rick pointed out ,it is more like a data step question than a IML question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x 'c:\temp\x.txt';
proc sql;
create table temp as
select *
 from dictionary.EXTFILES
 where fileref='X';
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 16 Oct 2019 13:00:17 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2019-10-16T13:00:17Z</dc:date>
    <item>
      <title>Get size of binary file in bytes</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596509#M4856</link>
      <description>&lt;P&gt;I am attempting (for the first time) to read from binary data files directly into IML.&amp;nbsp; Is there a way to get the size of the file I have opened with INFILE in bytes?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 13:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596509#M4856</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2019-10-15T13:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get size of binary file in bytes</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596530#M4857</link>
      <description>&lt;P&gt;I don't usually use the INFILE statement or deal with binary files, but I think the process is exactly the same as for the DATA step. Remember that you can call most Base SAS functions from SAS/IML. In particular, you can &lt;A href="https://go.documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=p0cpuq4ew0dxipn1vtravlludjm7.htm&amp;amp;locale=en" target="_self"&gt;call the FINFO function&lt;/A&gt; and other file-related functions. Adapting the doc example to IML gives:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename fref "C:\temp\myfile";
proc iml;
fid=fopen('fref');
/* for my OS, what FINFO options are available? */
infonum=foptnum(fid);
infoname = foptname(fid, 1:infonum);
print infoname;

/* looks like the 4th element is the file size on Windows */
size = finfo(fid, infoname[4]);
print size;
close=fclose(fid);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Oct 2019 13:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596530#M4857</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-10-15T13:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Get size of binary file in bytes</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596772#M4858</link>
      <description>&lt;P&gt;Thanks Rick,&amp;nbsp; that works nicely.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Caution to others using this, the file size is returned as a character string.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 08:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596772#M4858</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2019-10-16T08:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get size of binary file in bytes</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596858#M4859</link>
      <description>&lt;P&gt;As Rick pointed out ,it is more like a data step question than a IML question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x 'c:\temp\x.txt';
proc sql;
create table temp as
select *
 from dictionary.EXTFILES
 where fileref='X';
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 13:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Get-size-of-binary-file-in-bytes/m-p/596858#M4859</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-10-16T13:00:17Z</dc:date>
    </item>
  </channel>
</rss>

