<?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: Duration of Recording in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512534#M2364</link>
    <description>&lt;P&gt;A SAS-time value is the number of seconds since midnight. I can't see any logic, that would transfer File_Duration to the shown time.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 13:50:27 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2018-11-13T13:50:27Z</dc:date>
    <item>
      <title>Duration of Recording</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512533#M2363</link>
      <description>&lt;P&gt;I am trying to use SAS to grab information from a folder including that contains a series of recordings. &amp;nbsp;These recordings are in several different formats so Windows Explorer cannot even provide a duration of the recordings in most cases. &amp;nbsp;But I have figured out (I think) that I can take the file size and determine a length of each recording (or at least an estimate). &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, what I have is the formula of:&lt;/P&gt;&lt;P&gt;File_Duration = File_Size * 0.00000000524111952&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which appears something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;File_Size&lt;/TD&gt;&lt;TD&gt;File_Duration&lt;/TD&gt;&lt;TD&gt;How Do I Get?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;122,106&lt;/TD&gt;&lt;TD&gt;0.0006399721&lt;/TD&gt;&lt;TD&gt;0:00:49&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4,019,252&lt;/TD&gt;&lt;TD&gt;0.0210653801&lt;/TD&gt;&lt;TD&gt;0:30:03&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;68,557&lt;/TD&gt;&lt;TD&gt;0.0003593154&lt;/TD&gt;&lt;TD&gt;0:00:31&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, What I am looking for is the actual duration&amp;nbsp;in Hours, Minutes &amp;amp; Seconds. &amp;nbsp;I can't seem to figure out a format to convert this decimal to a duration. &amp;nbsp;But added all of this detail as I recognize that I may being going about this in the least efficient manner. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Assistance is appreciated.&lt;/P&gt;&lt;P&gt;Thanks. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 13:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512533#M2363</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2018-11-13T13:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Duration of Recording</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512534#M2364</link>
      <description>&lt;P&gt;A SAS-time value is the number of seconds since midnight. I can't see any logic, that would transfer File_Duration to the shown time.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 13:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512534#M2364</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-11-13T13:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Duration of Recording</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512535#M2365</link>
      <description>&lt;P&gt;To be honest i don't think thats going to work.&amp;nbsp; There are lots of factors which will impact file size, type of movie, soundtrack, subtitles, format of file etc.&amp;nbsp; What I would suggest is you use a tool appropriate to the task to get the information, for instance:&lt;BR /&gt;&lt;A href="https://unix.stackexchange.com/questions/170961/get-total-duration-of-video-files-in-a-directory" target="_blank"&gt;https://unix.stackexchange.com/questions/170961/get-total-duration-of-video-files-in-a-directory&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 13:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512535#M2365</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-13T13:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Duration of Recording</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512554#M2374</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/208658"&gt;@Lost_Gary&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm also skeptical about your "universal" conversion factor given that the "&lt;SPAN&gt;recordings are in several different formats."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That said, I&amp;nbsp;guess your File_Duration values are measured in days (like times are in Excel). So, multiplying by 86400 will convert them to SAS time values:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input File_Size :comma. File_Duration;
cards;
122,106 0.0006399721
4,019,252 0.0210653801
68,557 0.0003593154
;

data want;
set have;
dur=file_duration*86400;
dur2=file_size*4.52832726528E-4; /* alternative formula */
format file_size comma10. file_duration best12. dur dur2 time8.;
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Result:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;                    File_
File_Size        Duration         dur        dur2

  122,106    0.0006399721     0:00:55     0:00:55
4,019,252    0.0210653801     0:30:20     0:30:20
   68,557    0.0003593154     0:00:31     0:00:31&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Note that I have included an alternative formula (based directly on File_Size) using your conversion factor times 86400 -- just for comparison (dur, dur2).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 14:41:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/512554#M2374</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-13T14:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Duration of Recording</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/513314#M2507</link>
      <description>&lt;P&gt;OK, I might be starting to accept that all of you might be right, and that this cannot be done. &amp;nbsp;So, is there a way for me to pull the length (actual recording time) from the Windows Explorer screen and then perhaps I can use this estimated process for those that do not have a published 'Length' within windows. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried various versions of my code below to capture the recording length, but I can't figure it out. &amp;nbsp;Your suggestions are appreciated. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename DIR pipe "dir &amp;nbsp;""C\my path"" /s/q/";&lt;/P&gt;&lt;P&gt;Data files;&lt;/P&gt;&lt;P&gt;infield dir pad;&lt;/P&gt;&lt;P&gt;input x $256.;&lt;/P&gt;&lt;P&gt;length PAT filename $256;&lt;/P&gt;&lt;P&gt;retain path;&lt;/P&gt;&lt;P&gt;if index(x,'Directory of') then PATH=substr(x,14);&lt;/P&gt;&lt;P&gt;else if char(x,3)-'/' and not index(x,'&amp;lt;DIR&amp;gt;') then do;&lt;/P&gt;&lt;P&gt;TOPDIR = cats('\',scan(path,1,'\',scan(path,2,'\'),scan(path,3,'\'));&lt;/P&gt;&lt;P&gt;filename =substr(x,63);&lt;/P&gt;&lt;P&gt;size = input(scan(x,4,' '),?? comma20.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* what do I put here to grab the recording length ????*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 14:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/513314#M2507</guid>
      <dc:creator>Lost_Gary</dc:creator>
      <dc:date>2018-11-15T14:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Duration of Recording</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/513320#M2508</link>
      <description>&lt;P&gt;It can be done, but just not by using file size.&amp;nbsp; File size is a measure of bits on the physical drive, if you have a compressed format like mp3 and an uncompressed format like flac, then the duration will be the same, however the file size will be vastly difference.&amp;nbsp; This is why its not a good idea to use file size to derive length.&amp;nbsp; Use something which is designed to open the specific file, and play it, that program would be best placed to tell you lengths.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 14:24:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/513320#M2508</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-15T14:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Duration of Recording</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/513690#M2569</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/208658"&gt;@Lost_Gary&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;filename DIR pipe "dir &amp;nbsp;""C\my path"" /s/q/";&lt;/P&gt;
&lt;P&gt;(...)&lt;/P&gt;
&lt;P&gt;/* what do I put here to grab the recording length ????*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think the DOS command DIR is insufficient to retrieve extended file properties such as recording length. I've just tried to get these using relatively simple commands of Windows PowerShell (which I rarely use), but to no avail: recording length was not among the items displayed. A quick web search revealed that &lt;EM&gt;maybe&lt;/EM&gt; more advanced PowerShell scripts could do the trick:&amp;nbsp;&lt;A href="https://www.powershellmagazine.com/2015/04/13/pstip-use-shell-application-to-display-extended-file-attributes/" target="_blank"&gt;https://www.powershellmagazine.com/2015/04/13/pstip-use-shell-application-to-display-extended-file-attributes/&lt;/A&gt;. But it's not clear to me if these "extended file attributes" will include recording length and I'm not familiar with such advanced PowerShell scripts anyway.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm pretty sure that either PowerShell or other software (as mentioned by &lt;STRONG&gt;RW9&lt;/STRONG&gt;) can retrieve this information into a text file or pipe (which could then be read with SAS after SAS had triggered the retrieval process). For one of my projects I managed to have SAS read information &lt;EM&gt;from the screen&lt;/EM&gt;&amp;nbsp;(of another software) by means of a C++ script which only read the&amp;nbsp;&lt;EM&gt;pixel colors&lt;/EM&gt;. So, it &lt;EM&gt;is&lt;/EM&gt; possible to get this information with SAS, but it might be difficult.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry that I can't be of more help.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 22:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Duration-of-Recording/m-p/513690#M2569</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-15T22:16:26Z</dc:date>
    </item>
  </channel>
</rss>

