<?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: use Option OBS statement with Number and &amp;variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/use-Option-OBS-statement-with-Number-and-variable/m-p/147383#M39042</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple of easy ways.&amp;nbsp; You could keep everything as is, except for the final statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options obs=%eval(6600 - &amp;amp;mbrs);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you could construct the number that you want originally, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select 6600 - count(distinct MemberID) into : obs_needed from table1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options obs=&amp;amp;obs_needed;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Sep 2014 20:40:48 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2014-09-16T20:40:48Z</dc:date>
    <item>
      <title>use Option OBS statement with Number and &amp;variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-Option-OBS-statement-with-Number-and-variable/m-p/147382#M39041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have two numbers one is fixed and one comes from a table that changes every time. I want to select number of obeservations based on the changing number. Instead of selecting the number everytime i am trying to find a permanent way to do this. Here is what i tried to give some idea...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the changing number....&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;select Count (distinct MemberID) into: mbrs&lt;/P&gt;&lt;P&gt;From table1;&lt;/P&gt;&lt;P&gt;;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;mbrs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My fix number is 6600.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option OBS=6600-&amp;amp;mbrs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 20:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-Option-OBS-statement-with-Number-and-variable/m-p/147382#M39041</guid>
      <dc:creator>rups</dc:creator>
      <dc:date>2014-09-16T20:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: use Option OBS statement with Number and &amp;variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-Option-OBS-statement-with-Number-and-variable/m-p/147383#M39042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple of easy ways.&amp;nbsp; You could keep everything as is, except for the final statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options obs=%eval(6600 - &amp;amp;mbrs);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, you could construct the number that you want originally, such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select 6600 - count(distinct MemberID) into : obs_needed from table1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options obs=&amp;amp;obs_needed;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 20:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-Option-OBS-statement-with-Number-and-variable/m-p/147383#M39042</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-09-16T20:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: use Option OBS statement with Number and &amp;variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/use-Option-OBS-statement-with-Number-and-variable/m-p/147384#M39043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked. Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2014 21:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/use-Option-OBS-statement-with-Number-and-variable/m-p/147384#M39043</guid>
      <dc:creator>rups</dc:creator>
      <dc:date>2014-09-16T21:06:43Z</dc:date>
    </item>
  </channel>
</rss>

