<?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: pick up nearest number from data set in SAS Forecasting and Econometrics</title>
    <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/pick-up-nearest-number-from-data-set/m-p/337406#M2174</link>
    <description>&lt;P&gt;If the underlying_price is a constant within a day, you can use a sort and data step to get the nearest strike price.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data sample_new;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set sample;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; diff = abs(underlying_price - strike);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data = sample_new;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; by datadate diff;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data nearest_price;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set sample_new;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; by datadate diff;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if first.datadate;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Mar 2017 15:24:32 GMT</pubDate>
    <dc:creator>alexchien</dc:creator>
    <dc:date>2017-03-02T15:24:32Z</dc:date>
    <item>
      <title>pick up nearest number from data set</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/pick-up-nearest-number-from-data-set/m-p/337229#M2172</link>
      <description>&lt;P&gt;In my case, we have three variables - the underlying price, the strike price, and the datadate. When the program&amp;nbsp;picks up the strike price that is nearest to the underlying price, I also need it&amp;nbsp;to consider the datadate. Please see the attached document for a sample.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So basically, I need it to pick the nearest strike price within that given date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, on 2011/1/16, the underlying price is 26.33. The closest strike price is 26.5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;On 2011/1/17, the underlying price is 26.11 and the closest strike price is 26.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 04:04:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/pick-up-nearest-number-from-data-set/m-p/337229#M2172</guid>
      <dc:creator>Xinhui</dc:creator>
      <dc:date>2017-03-02T04:04:17Z</dc:date>
    </item>
    <item>
      <title>pick up nearest number from data set</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/pick-up-nearest-number-from-data-set/m-p/337228#M2173</link>
      <description>&lt;P&gt;In my case, we have three variables - the underlying price, the strike price, and the datadate. When the program&amp;nbsp;picks up the strike price that is nearest to the underlying price, I also need it&amp;nbsp;to consider the datadate. Please see the attached document for a sample.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So basically, I need it to pick the nearest strike price within that given date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, on 2011/1/16, the underlying price is 26.33. The closest strike price is 26.5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;On 2011/1/17, the underlying price is 26.11 and the closest strike price is 26.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 04:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/pick-up-nearest-number-from-data-set/m-p/337228#M2173</guid>
      <dc:creator>Xinhui</dc:creator>
      <dc:date>2017-03-02T04:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: pick up nearest number from data set</title>
      <link>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/pick-up-nearest-number-from-data-set/m-p/337406#M2174</link>
      <description>&lt;P&gt;If the underlying_price is a constant within a day, you can use a sort and data step to get the nearest strike price.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data sample_new;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set sample;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; diff = abs(underlying_price - strike);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data = sample_new;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; by datadate diff;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data nearest_price;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; set sample_new;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; by datadate diff;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if first.datadate;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 15:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Forecasting-and-Econometrics/pick-up-nearest-number-from-data-set/m-p/337406#M2174</guid>
      <dc:creator>alexchien</dc:creator>
      <dc:date>2017-03-02T15:24:32Z</dc:date>
    </item>
  </channel>
</rss>

