<?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 Multiple Data Steps... in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Data-Steps/m-p/13288#M2854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would think the same way that you have, i.e., by adding one more if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I would create a new file rather than replacing your current file, so that you can test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I personally, like to enter such statements in a way that makes it clearer what the various operators are supposed to do.&amp;nbsp; e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sped;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input (incidenttype weapontype) ($) repdist;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;3700 3711 15&lt;/P&gt;&lt;P&gt;3701 3711 15&lt;/P&gt;&lt;P&gt;3700 3711 15&lt;/P&gt;&lt;P&gt;3701 3711 15&lt;/P&gt;&lt;P&gt;3700 3712 15&lt;/P&gt;&lt;P&gt;3700 3712 80&lt;/P&gt;&lt;P&gt;3700 3712 93&lt;/P&gt;&lt;P&gt;3700 3712 105&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA sped2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET sped;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If incidenttype = '3700';&lt;/P&gt;&lt;P&gt;&amp;nbsp; If weapontype = '3711' then weap = 'HANDGUNS&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Else if weapontype = '3712' then weap = 'RIFLESHOTGUN';&lt;/P&gt;&lt;P&gt;&amp;nbsp; If weap = 'HANDGUNS&amp;nbsp;&amp;nbsp;&amp;nbsp; ' and REPDIST in (11,15,52,62,64,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80,89,93,103) then gfsa = 'YESWITHREP';&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if weap = 'RIFLESHOTGUN' and REPDIST in (11,15,52,62,64,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80,89,93,103) then gfsa = 'YESWITHREP';&lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSE gfsa = 'YESWOREP';&lt;/P&gt;&lt;P&gt;&amp;nbsp; truants = -1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if gfsa eq 'YESWITHREP';&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Feb 2012 19:10:13 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-24T19:10:13Z</dc:date>
    <item>
      <title>Multiple Data Steps...</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Data-Steps/m-p/13287#M2853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;How do I fix this code so that the data steps tell it to first select out and name the weapons and then out of those weapons that were named select out the specific reporting districts only and name 'YESWITHREP'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000080; font-size: 12pt; font-family: Courier New;"&gt;Right now it is naming all reporting districts that are in the list and it is not looking at the weapons field first.&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="background-color: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="background-color: white; font-family: 'Courier New';"&gt; &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;STRONG style="background-color: white; font-family: 'Courier New';"&gt;DATA&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt; sped;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-size: 12pt; font-family: Courier New;"&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;SET sped;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;If incidenttype = '3700';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;If weapontype = '3711' then weap = 'HANDGUNS&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;Else if weapontype = '3712' then weap = 'RIFLESHOTGUN';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;If weap = 'HANDGUNS&amp;nbsp;&amp;nbsp;&amp;nbsp; ' and REPDIST = &lt;STRONG&gt;11&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;15&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;or REPDIST = &lt;STRONG&gt;52&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;62&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;64&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;80&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;or REPDIST = &lt;STRONG&gt;89&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;93&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;103&lt;/STRONG&gt; then gfsa = 'YESWITHREP';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;If weap = 'RIFLESHOTGUN' and REPDIST = &lt;STRONG&gt;11&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;15&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;52&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;62&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;64&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;80&lt;/STRONG&gt; or &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;REPDIST = &lt;STRONG&gt;89&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;93&lt;/STRONG&gt; or REPDIST = &lt;STRONG&gt;103&lt;/STRONG&gt; then gfsa = 'YESWITHREP';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;ELSE gfsa = 'YESWOREP';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New';"&gt;truants = -&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="background-color: white; font-family: 'Courier New';"&gt;Run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 18:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Data-Steps/m-p/13287#M2853</guid>
      <dc:creator>agambaccini</dc:creator>
      <dc:date>2012-02-24T18:40:24Z</dc:date>
    </item>
    <item>
      <title>Multiple Data Steps...</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Data-Steps/m-p/13288#M2854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would think the same way that you have, i.e., by adding one more if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I would create a new file rather than replacing your current file, so that you can test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, I personally, like to enter such statements in a way that makes it clearer what the various operators are supposed to do.&amp;nbsp; e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sped;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input (incidenttype weapontype) ($) repdist;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;3700 3711 15&lt;/P&gt;&lt;P&gt;3701 3711 15&lt;/P&gt;&lt;P&gt;3700 3711 15&lt;/P&gt;&lt;P&gt;3701 3711 15&lt;/P&gt;&lt;P&gt;3700 3712 15&lt;/P&gt;&lt;P&gt;3700 3712 80&lt;/P&gt;&lt;P&gt;3700 3712 93&lt;/P&gt;&lt;P&gt;3700 3712 105&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA sped2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET sped;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If incidenttype = '3700';&lt;/P&gt;&lt;P&gt;&amp;nbsp; If weapontype = '3711' then weap = 'HANDGUNS&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Else if weapontype = '3712' then weap = 'RIFLESHOTGUN';&lt;/P&gt;&lt;P&gt;&amp;nbsp; If weap = 'HANDGUNS&amp;nbsp;&amp;nbsp;&amp;nbsp; ' and REPDIST in (11,15,52,62,64,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80,89,93,103) then gfsa = 'YESWITHREP';&lt;/P&gt;&lt;P&gt;&amp;nbsp; else if weap = 'RIFLESHOTGUN' and REPDIST in (11,15,52,62,64,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80,89,93,103) then gfsa = 'YESWITHREP';&lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSE gfsa = 'YESWOREP';&lt;/P&gt;&lt;P&gt;&amp;nbsp; truants = -1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if gfsa eq 'YESWITHREP';&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Feb 2012 19:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Multiple-Data-Steps/m-p/13288#M2854</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-24T19:10:13Z</dc:date>
    </item>
  </channel>
</rss>

