<?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 Calculate Parts Per Minute in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-To-Calculate-Parts-Per-Minute/m-p/688884#M209366</link>
    <description>&lt;P&gt;Your value for duration is not a number, it is a text string, and you can't divide by a text string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to convert this text string to a number&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;duration1 = input(duration,time7.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you have the a numeric variable which contains the number of&amp;nbsp;&lt;EM&gt;seconds&lt;/EM&gt; in the duration. So to get the PPM, you want to divide by DURATION1/60.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Oct 2020 14:25:57 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-10-05T14:25:57Z</dc:date>
    <item>
      <title>How To Calculate Parts Per Minute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Calculate-Parts-Per-Minute/m-p/688877#M209363</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to figure out how to calculate Parts-Per-Minute (PPM) in SAS. I have Quantity (formatted as a number) and Duration (formatted as TIME. with HH:MM:SS) within SAS. I'm trying to create the PPM variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In excel, the formula is PPM=Quantity/(Duration*24*60) however, this formula is erroring out in SAS. Below is an example of the table and what PPM should be equal to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Quantity&lt;/TD&gt;&lt;TD&gt;Duration&lt;/TD&gt;&lt;TD&gt;PPM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;215&lt;/TD&gt;&lt;TD&gt;0:10:00&lt;/TD&gt;&lt;TD&gt;21.50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data step that is erroring looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA WORK.TEST;
SET WORK.TEST;
PPM = Quantity/(Duration*24*60);
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And the error message I'm receiving says: "&lt;EM&gt;NOTE: Invalid numeric data, Duration=' 0:07:40' , at line 64 column 18.&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm assuming I need to format the Duration differently, but am not entirely sure. Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 14:16:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Calculate-Parts-Per-Minute/m-p/688877#M209363</guid>
      <dc:creator>BlayLay</dc:creator>
      <dc:date>2020-10-05T14:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: How To Calculate Parts Per Minute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Calculate-Parts-Per-Minute/m-p/688881#M209364</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to the log, Duration column is a character variable. You need to convert it to a numeric time variable :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Duration2=input(Duration,time7.)/60; /* Duration in minutes */&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 14:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Calculate-Parts-Per-Minute/m-p/688881#M209364</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2020-10-05T14:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: How To Calculate Parts Per Minute</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-To-Calculate-Parts-Per-Minute/m-p/688884#M209366</link>
      <description>&lt;P&gt;Your value for duration is not a number, it is a text string, and you can't divide by a text string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have to convert this text string to a number&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;duration1 = input(duration,time7.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then you have the a numeric variable which contains the number of&amp;nbsp;&lt;EM&gt;seconds&lt;/EM&gt; in the duration. So to get the PPM, you want to divide by DURATION1/60.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 14:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-To-Calculate-Parts-Per-Minute/m-p/688884#M209366</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-05T14:25:57Z</dc:date>
    </item>
  </channel>
</rss>

