<?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: is not missing statement in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265054#M18388</link>
    <description>&lt;P&gt;If I understand correctly, this might be close to the mark:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data site;&lt;/P&gt;
&lt;P&gt;set agent2;&lt;/P&gt;
&lt;P&gt;if agent_name in ('18F-site', 'Subtotal of 18F-site') then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I misunderstood the proper observations, there must be a fix that is pretty close to this program.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2016 11:15:24 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-04-20T11:15:24Z</dc:date>
    <item>
      <title>is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264952#M18374</link>
      <description>&lt;P&gt;Hi All, &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am writing a DataStep to pull only certain information out of a file that i imported into SAS..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The part i am having trouble with is when i am trying to tell SAS that if data exists in the field (its a character field) that i want it to output to the specifed table. &amp;nbsp;My code is below. &amp;nbsp;Can anyone tell me the correct syntax for this datastep.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.site;
set work.agent2;
if agent_name = "18F-site" then siteflag = 1;
if siteflag then do;
if agent_name is not missing then output work.site; 
if agent_name = "Subtotal of 18F-site" then siteflag = 0;
end;
drop siteflag;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Apr 2016 23:11:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264952#M18374</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-04-19T23:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264953#M18375</link>
      <description>&lt;P&gt;If not missing(agent_name) then ...&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 23:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264953#M18375</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-19T23:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264989#M18378</link>
      <description>&lt;P&gt;Your intention isn't really clear. &amp;nbsp;Which observations should go into the new data set?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 02:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264989#M18378</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-20T02:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264996#M18381</link>
      <description>&lt;P&gt;So i have a list of agents from a CSV file that is seperated by site names (18F-Site) and then a subtotal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So i am looking for each dataset to output all the agent names and information between the site name and the subtotal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When i used the code above, i just got the line with the 18F-Site in it but not the names in between which is what my goal was.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 04:00:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/264996#M18381</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-04-20T04:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265033#M18387</link>
      <description>&lt;P&gt;The reason you only get one line out is that siteflag is missing unless assigned on each row, it is not carried over. &amp;nbsp;You would need to retain this value if you want to use it as a flag like that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.site (drop=siteflag);
  set work.agent2;&lt;BR /&gt;  retain siteflag;
  if agent_name = "18F-site" then siteflag = 1;
  if siteflag and not missing(agent_name) then output; 
  if agent_name = "Subtotal of 18F-site" then siteflag = 0;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 08:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265033#M18387</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-04-20T08:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265054#M18388</link>
      <description>&lt;P&gt;If I understand correctly, this might be close to the mark:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data site;&lt;/P&gt;
&lt;P&gt;set agent2;&lt;/P&gt;
&lt;P&gt;if agent_name in ('18F-site', 'Subtotal of 18F-site') then delete;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I misunderstood the proper observations, there must be a fix that is pretty close to this program.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 11:15:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265054#M18388</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-20T11:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265123#M18393</link>
      <description>&lt;P&gt;That would work... but let me see if i can explain how the data itself is setup. it looks something like this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Agent_Name &amp;nbsp; &amp;nbsp; Field1 &amp;nbsp; Field2 &amp;nbsp; Field3 &amp;nbsp;Field4&lt;/P&gt;
&lt;P&gt;18F-Site&lt;/P&gt;
&lt;P&gt;John &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100 &amp;nbsp; &amp;nbsp; &amp;nbsp; 50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;/P&gt;
&lt;P&gt;Jame &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 40 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30 &amp;nbsp; &amp;nbsp; &amp;nbsp; 15&lt;/P&gt;
&lt;P&gt;Rick &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 175 &amp;nbsp; &amp;nbsp; &amp;nbsp; 35 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/P&gt;
&lt;P&gt;Subtotal 18Fsite &amp;nbsp; 325 &amp;nbsp; &amp;nbsp; &amp;nbsp;125 &amp;nbsp; &amp;nbsp; &amp;nbsp;75 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 40&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;18F-Site2&lt;/P&gt;
&lt;P&gt;Mary &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 15 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20 &amp;nbsp; &amp;nbsp; &amp;nbsp; 30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 40&lt;/P&gt;
&lt;P&gt;Mike &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50&lt;/P&gt;
&lt;P&gt;Subtotal 18FSite2 35 &amp;nbsp; &amp;nbsp; &amp;nbsp; 50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;70 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;18F-Site3&lt;/P&gt;
&lt;P&gt;and so on&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in essense, i only want the data for 18F-Site and not the others and i don't want to go past the subtotal into the informaiton for my other sites. &amp;nbsp;I think that may make my intention with this a little clearer and the data step i was using may make a little more sense now.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dean&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 15:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265123#M18393</guid>
      <dc:creator>D_Z_</dc:creator>
      <dc:date>2016-04-20T15:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: is not missing statement</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265132#M18395</link>
      <description>&lt;P&gt;If the site you are looking for is always the first one, then it's easy:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data site;&lt;/P&gt;
&lt;P&gt;set agent2;&lt;/P&gt;
&lt;P&gt;if agent_name='18F-site' then delete;&lt;/P&gt;
&lt;P&gt;if agent_name='Subtotal of 18F-site' then stop;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the site you are looking for might be in the middle of the data, it takes a little more programming:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data site;&lt;/P&gt;
&lt;P&gt;set agent2;&lt;/P&gt;
&lt;P&gt;if flag=1 then output;&lt;/P&gt;
&lt;P&gt;if agent_name='18F-site' then flag=1;&lt;/P&gt;
&lt;P&gt;retain flag;&lt;/P&gt;
&lt;P&gt;if agent_name='Subtotal of 18F-site' then stop;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 15:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/is-not-missing-statement/m-p/265132#M18395</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-20T15:34:05Z</dc:date>
    </item>
  </channel>
</rss>

