<?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: How to take SPSS code and do it in SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-take-SPSS-code-and-do-it-in-SAS/m-p/822298#M34974</link>
    <description>&lt;P&gt;Looks like a normal IF THEN statement.&amp;nbsp; SAS does support using | and &amp;amp; as substitutes of AND and OR, but I can never remember which is which so it is probably better use the human readable keywords instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And IF statement would need to be part of a DATA step.&amp;nbsp; So if you have a dataset named HAVE that has the I3 and I3_1 variables then you could use a step like this to make a dataset named WANT that adds the I3_UNMET variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  IF  (i3=0  or i3_1=2) then i3_unmet=0 ;
  IF  (i3_1=0  or  i3_1=1) then i3_unmet=1 ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For other combinations of values of i3 and i3_1 (such as when i3=1 or when i3_1=4) the value of I3_UNMET will not be set.&lt;/P&gt;
&lt;P&gt;So if it already exists in the HAVE dataset the value for those observations will be unchanged.&lt;/P&gt;
&lt;P&gt;And if it was not in the HAVE dataset then the value will be missing.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jul 2022 15:24:56 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-07-08T15:24:56Z</dc:date>
    <item>
      <title>How to take SPSS code and do it in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-take-SPSS-code-and-do-it-in-SAS/m-p/822291#M34973</link>
      <description>&lt;P&gt;How do I do I code the following SPSS code in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF&amp;nbsp; (i3=0 | i3_1=2) i3_unmet=0.&lt;/P&gt;&lt;P&gt;EXECUTE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF&amp;nbsp; (i3_1=0 | i3_1=1) i3_unmet=1.&lt;/P&gt;&lt;P&gt;EXECUTE.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Part 1 of this code says if variable i3 is marked as not needed OR variable i3_1 is marked as “fully met” then your new variable i3_unmet is 0.&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Part 2 of this code says if variable i3_1 is marked as “not met” OR i3_1 is marked as partially met then your new variable i3_unmet is 1.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 14:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-take-SPSS-code-and-do-it-in-SAS/m-p/822291#M34973</guid>
      <dc:creator>gtucke1</dc:creator>
      <dc:date>2022-07-08T14:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to take SPSS code and do it in SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-take-SPSS-code-and-do-it-in-SAS/m-p/822298#M34974</link>
      <description>&lt;P&gt;Looks like a normal IF THEN statement.&amp;nbsp; SAS does support using | and &amp;amp; as substitutes of AND and OR, but I can never remember which is which so it is probably better use the human readable keywords instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And IF statement would need to be part of a DATA step.&amp;nbsp; So if you have a dataset named HAVE that has the I3 and I3_1 variables then you could use a step like this to make a dataset named WANT that adds the I3_UNMET variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  IF  (i3=0  or i3_1=2) then i3_unmet=0 ;
  IF  (i3_1=0  or  i3_1=1) then i3_unmet=1 ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For other combinations of values of i3 and i3_1 (such as when i3=1 or when i3_1=4) the value of I3_UNMET will not be set.&lt;/P&gt;
&lt;P&gt;So if it already exists in the HAVE dataset the value for those observations will be unchanged.&lt;/P&gt;
&lt;P&gt;And if it was not in the HAVE dataset then the value will be missing.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2022 15:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-take-SPSS-code-and-do-it-in-SAS/m-p/822298#M34974</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-07-08T15:24:56Z</dc:date>
    </item>
  </channel>
</rss>

