<?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: Creating variables with If statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607497#M176630</link>
    <description>&lt;P&gt;You most probably will have to put those codes in quotes, as zipcodes are usually stored as character.&lt;/P&gt;
&lt;P&gt;If you store these codes in a dataset, you can use code to automate the selection and avoid typing literals in a data step.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2019 20:29:59 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-11-26T20:29:59Z</dc:date>
    <item>
      <title>Creating variables with If statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607477#M176617</link>
      <description>&lt;P&gt;I have zip codes that i want to combine into two groups. How would i program this in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;these zip codes need to be in GroupA&lt;/P&gt;&lt;P&gt;97003, 97004, 97005, 97006, 97007, 97008, 97009, 97010, 97013, 97014, 97015, 97019, 97022&lt;/P&gt;&lt;P&gt;97023, 97024, 97027, 97028, 97030, 97031, 97034, 97035, 97036, 97041, 97045, 97051, 97055&lt;/P&gt;&lt;P&gt;97056, 97060, 97062, 97064, 97068, 97070, 97078, 97080, 97086, 97089, 97106, 97109, 97112&lt;/P&gt;&lt;P&gt;97113, 97116, 97119, 97123, 97124, 97125, 97132, 97133, 97135, 97140, 97149, 97201, 97202&lt;/P&gt;&lt;P&gt;97203, 97204, 97205, 97206, 97209, 97210, 97211, 97212, 97213, 97214, 97215, 97216, 97217&lt;/P&gt;&lt;P&gt;97218, 97219, 97220, 97221, 97222, 97223, 97224, 97225, 97227, 97229, 97230, 97231, 97232&lt;/P&gt;&lt;P&gt;97233, 97236, 97239, 97242, 97258, 97266, 97267, 97268, 97286, 97292, 97330, 97331, 97333&lt;/P&gt;&lt;P&gt;97339, 97351, 97361, 97371, 97376, 97401, 97402, 97403, 97404, 97405, 97408, 97454, 97455&lt;/P&gt;&lt;P&gt;97477, 97478, 97482, 97520, 97525, 97701, 97702, 97703, 97707, 97708, 97709&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and all other Oregon zip codes need to be in GroupB&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 19:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607477#M176617</guid>
      <dc:creator>LLH8</dc:creator>
      <dc:date>2019-11-26T19:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables with If statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607480#M176619</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if zip in (97003, 97004, 97005, 97006, 97007, 97008, 97009, 97010, 97013, 
97014, 97015, 97019, 97022, 97023, 97024, 97027, 97028, 97030, 97031, 
97034, 97035, 97036, 97041, 97045, 97051, 97055, 97056, 97060, 97062, 
97064, 97068, 97070, 97078, 97080, 97086, 97089, 97106, 97109, 97112,
97113, 97116, 97119, 97123, 97124, 97125, 97132, 97133, 97135, 97140, 
97149, 97201, 97202, 97203, 97204, 97205, 97206, 97209, 97210, 97211, 
97212, 97213, 97214, 97215, 97216, 97217, 97218, 97219, 97220, 97221, 
97222, 97223, 97224, 97225, 97227, 97229, 97230, 97231, 97232, 97233, 
97236, 97239, 97242, 97258, 97266, 97267, 97268, 97286, 97292, 97330, 
97331, 97333, 97339, 97351, 97361, 97371, 97376, 97401, 97402, 97403, 
97404, 97405, 97408, 97454, 97455, 97477, 97478, 97482, 97520, 97525, 
97701, 97702, 97703, 97707, 97708, 97709) 
then group='GroupA';
else group='GroupB';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Nov 2019 19:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607480#M176619</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-26T19:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables with If statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607482#M176621</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   if zip in (97003, 97004, 97005, 97006, 97007, 97008, 97009, 97010, 97013, 97014, 97015, 97019, 97022
              97023, 97024, 97027, 97028, 97030, 97031, 97034, 97035, 97036, 97041, 97045, 97051, 97055
              97056, 97060, 97062, 97064, 97068, 97070, 97078, 97080, 97086, 97089, 97106, 97109, 97112
              97113, 97116, 97119, 97123, 97124, 97125, 97132, 97133, 97135, 97140, 97149, 97201, 97202
              97203, 97204, 97205, 97206, 97209, 97210, 97211, 97212, 97213, 97214, 97215, 97216, 97217
              97218, 97219, 97220, 97221, 97222, 97223, 97224, 97225, 97227, 97229, 97230, 97231, 97232
              97233, 97236, 97239, 97242, 97258, 97266, 97267, 97268, 97286, 97292, 97330, 97331, 97333
              97339, 97351, 97361, 97371, 97376, 97401, 97402, 97403, 97404, 97405, 97408, 97454, 97455
              97477, 97478, 97482, 97520, 97525, 97701, 97702, 97703, 97707, 97708, 97709) then group='GroupA';
   else group='GroupB';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Nov 2019 19:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607482#M176621</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-11-26T19:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables with If statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607497#M176630</link>
      <description>&lt;P&gt;You most probably will have to put those codes in quotes, as zipcodes are usually stored as character.&lt;/P&gt;
&lt;P&gt;If you store these codes in a dataset, you can use code to automate the selection and avoid typing literals in a data step.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2019 20:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607497#M176630</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-26T20:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating variables with If statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607502#M176632</link>
      <description>Do you need to use an IF statement or can you use FORMATS? I find those much cleaner IMO.</description>
      <pubDate>Tue, 26 Nov 2019 20:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-variables-with-If-statement/m-p/607502#M176632</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-26T20:37:17Z</dc:date>
    </item>
  </channel>
</rss>

