<?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 Point with Conditional work-around in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Point-with-Conditional-work-around/m-p/837675#M331233</link>
    <description>&lt;P&gt;I have a dataset A that looks like:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;Account#&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;Userno&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;123&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;456&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;2&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 a dataset B that looks like:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;Userno&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are thousands of accounts and around 15 users total. Right now I have a datastep where I assign accounts to users in a loop like so:&lt;/P&gt;
&lt;P&gt;data example;&lt;BR /&gt;set work.A;&lt;BR /&gt;p = 1 + mod(_n_-1,nobs);&lt;BR /&gt;set work.B point=p nobs=nobs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need is something that does not function with the 'point' function in SAS I think...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to add a conditional that would be like this:&lt;BR /&gt;data example;&lt;BR /&gt;set work.A;&lt;BR /&gt;p = 1 + mod(_n_-1,nobs);&lt;BR /&gt;set work.B &lt;EM&gt;where ((userno in (1,2,3) and flag = 1) OR (userno in (4,5,6) and flag in (1,0)));&lt;BR /&gt;&lt;/EM&gt;point=p nobs=nobs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know, you can't add a 'WHERE' when you use the POINT function in the SET option. Does anyone have a recommendation on how to accomplish this another way, or if I'm not being explicit enough, please let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Mon, 10 Oct 2022 15:11:27 GMT</pubDate>
    <dc:creator>hporter</dc:creator>
    <dc:date>2022-10-10T15:11:27Z</dc:date>
    <item>
      <title>Point with Conditional work-around</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Point-with-Conditional-work-around/m-p/837675#M331233</link>
      <description>&lt;P&gt;I have a dataset A that looks like:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;Account#&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;Userno&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;123&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="50%" height="30px"&gt;456&lt;/TD&gt;
&lt;TD width="50%" height="30px"&gt;2&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 a dataset B that looks like:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;Userno&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="100%"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are thousands of accounts and around 15 users total. Right now I have a datastep where I assign accounts to users in a loop like so:&lt;/P&gt;
&lt;P&gt;data example;&lt;BR /&gt;set work.A;&lt;BR /&gt;p = 1 + mod(_n_-1,nobs);&lt;BR /&gt;set work.B point=p nobs=nobs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need is something that does not function with the 'point' function in SAS I think...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to add a conditional that would be like this:&lt;BR /&gt;data example;&lt;BR /&gt;set work.A;&lt;BR /&gt;p = 1 + mod(_n_-1,nobs);&lt;BR /&gt;set work.B &lt;EM&gt;where ((userno in (1,2,3) and flag = 1) OR (userno in (4,5,6) and flag in (1,0)));&lt;BR /&gt;&lt;/EM&gt;point=p nobs=nobs;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as I know, you can't add a 'WHERE' when you use the POINT function in the SET option. Does anyone have a recommendation on how to accomplish this another way, or if I'm not being explicit enough, please let me know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 15:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Point-with-Conditional-work-around/m-p/837675#M331233</guid>
      <dc:creator>hporter</dc:creator>
      <dc:date>2022-10-10T15:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Point with Conditional work-around</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Point-with-Conditional-work-around/m-p/837696#M331238</link>
      <description>&lt;P&gt;What is variable FLAG? It's not in your data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's really hard to generalize from data that has just two observations, but it seems like you just want to do a MERGE with some conditions on variable FLAG (which we know nothing about).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You state you need a loop and POINT=, but I don't see those requirements as necessary or helpful at this time. Instead of requiring certain code to be used (its rarely a good idea to specify that certain code should be used), please explain the problem in more detail, and provide a larger example, I think that will be more helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 16:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Point-with-Conditional-work-around/m-p/837696#M331238</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-10T16:52:24Z</dc:date>
    </item>
  </channel>
</rss>

