<?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: Match numbers within a range in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541540#M149531</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Can you give me code example from the above example I used&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please indicate which records in your example data should get a "YES". Everything I examined was outside the range specified. So I am not sure that I am interpreting " rtrn within a range of 70% to 140% of first exp&amp;nbsp;" the same you that you are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code will hold the first value of EXP across all records.&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   retain holdexp;
   if _n_=1 then holdexp=exp;
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 08 Mar 2019 19:08:30 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-03-08T19:08:30Z</dc:date>
    <item>
      <title>Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541322#M149442</link>
      <description>&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;code&lt;/TD&gt;&lt;TD&gt;rtrn&lt;/TD&gt;&lt;TD&gt;exp&lt;/TD&gt;&lt;TD&gt;new&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2011&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;0.0098&l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-0.25874&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2013&lt;/TD&gt;&lt;TD&gt;99&lt;/TD&gt;&lt;TD&gt;-0.12589&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2014&lt;/TD&gt;&lt;TD&gt;99&lt;/TD&gt;&lt;TD&gt;0.0365&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to select rtrn in new columns within a range of 70% to 140% of first exp value by code. If rtrn is within a value of 70% to 140% then we say yes otherwise no. And the I have to maintain the result by code. So, in the new column I will get either "yes" or "No/blank if it is not within the range"&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 17:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541322#M149442</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-03-08T17:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541323#M149443</link>
      <description>&lt;P&gt;So what does your desired result look like?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 08:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541323#M149443</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-03-08T08:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541326#M149445</link>
      <description>&lt;P&gt;Post test data in the form of a datastep, and post it in the code window - its the {i} above post area.&lt;/P&gt;
&lt;P&gt;Show what the output should look like.&lt;/P&gt;
&lt;P&gt;At a guess, I would take observation _n_=1 from the data, and merge that back onto the whole dataset, so it appears on every row, then do your calculation, then drop it.&amp;nbsp; Note New is never populated in your example, so can't see how that fits.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 08:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541326#M149445</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-08T08:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541490#M149505</link>
      <description>I edited my question. Please check</description>
      <pubDate>Fri, 08 Mar 2019 17:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541490#M149505</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-03-08T17:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541502#M149512</link>
      <description>&lt;P&gt;tnx&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 22:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541502#M149512</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-03-11T22:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541540#M149531</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Can you give me code example from the above example I used&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please indicate which records in your example data should get a "YES". Everything I examined was outside the range specified. So I am not sure that I am interpreting " rtrn within a range of 70% to 140% of first exp&amp;nbsp;" the same you that you are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code will hold the first value of EXP across all records.&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   retain holdexp;
   if _n_=1 then holdexp=exp;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Mar 2019 19:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541540#M149531</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-08T19:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541554#M149536</link>
      <description>" rtrn within a range of 70% to 140% of first exp " would be " rtrn within a range of 70% to 140% of every first exp by code "</description>
      <pubDate>Fri, 08 Mar 2019 19:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541554#M149536</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-03-08T19:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541928#M149730</link>
      <description>&lt;P&gt;Again:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Post test data in the form of a datastep, and post it in the code window - its the {i} above post area.&lt;/P&gt;
&lt;P&gt;Show what the output should look like."&lt;/P&gt;
&lt;P&gt;Nobody volunteers their time here to type in test data for you.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 10:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541928#M149730</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-11T10:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541931#M149731</link>
      <description>&lt;P&gt;You don't have to mention that. If nobody understands, they will not answer. Please try to write things politely.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 22:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541931#M149731</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-03-11T22:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541935#M149733</link>
      <description>&lt;P&gt;Let me try again then.&amp;nbsp; In my post I asked you to provide some basic information which would help us to answer your question.&amp;nbsp; You have responded without providing any of the requested information, but asking me to spend my time typing in the text you provided in the original post, then spend more of my time writing code.&amp;nbsp; So to answer your question: "&lt;SPAN&gt;Can you give me code example from the above example I used", the answer I am afraid is no, I am very sorry, but I cannot.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 10:37:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541935#M149733</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-03-11T10:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541937#M149734</link>
      <description>&lt;P&gt;I have found my solution by the way. Thank you for your time&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 22:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/541937#M149734</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2019-03-11T22:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Match numbers within a range</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/542134#M149796</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/260675"&gt;@abdulla&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;" rtrn within a range of 70% to 140% of first exp " would be " rtrn within a range of 70% to 140% of every first exp by code "&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the formula you are using for 70% and 140% using some of the examples.&lt;/P&gt;
&lt;P&gt;As I said, I used one approach and had no "Yes" values. Or ensure that you have at least one "Yes". Better would be to have a number of them.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 17:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-numbers-within-a-range/m-p/542134#M149796</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-11T17:29:37Z</dc:date>
    </item>
  </channel>
</rss>

