<?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: Referring to multiple variables in if/then statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Referring-to-multiple-variables-in-if-then-statement/m-p/174257#M33463</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on the structure and contents of your Word document you may be able to use it to make a dataset that will create formats.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 May 2014 17:11:18 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2014-05-27T17:11:18Z</dc:date>
    <item>
      <title>Referring to multiple variables in if/then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referring-to-multiple-variables-in-if-then-statement/m-p/174255#M33461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I have a large SAS assignment which I know how to do by hand, but I'm sure there are lots of useful shortcuts that I don't know about which could make it less cumbersome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Word document outlining about a thousand values that have been divided into 16 categories. I also have a SAS dataset in which each row can contain up to 10 variables containing the values that have been categorized in the Word document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way I can think to do this is to code by hand:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If var1 in (abc, def, ghi, jkl) then category1=1;&lt;/P&gt;&lt;P&gt;else if var1 in (mno, pqr, stu, vwx) then category1=2;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;else if var1 in (zzz, zyx, wvu, tsr) then category1=16;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if var2 in (abc, def, ghi, jkl) then category2=1;&lt;/P&gt;&lt;P&gt;else if var2 in (mno, pqr, stu, vwx) then category2=2;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, this gets very cumbersome very quickly, as I have 10 vars containing the values and 16 categories. Any shortcuts would be much 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, 27 May 2014 15:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referring-to-multiple-variables-in-if-then-statement/m-p/174255#M33461</guid>
      <dc:creator>Walternate</dc:creator>
      <dc:date>2014-05-27T15:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Referring to multiple variables in if/then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referring-to-multiple-variables-in-if-then-statement/m-p/174256#M33462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'd have to provide more detailed examples for more detailed help. But generally, if its categorizing or recoding, look at a merge, hash or proc format instead of multiple if/then statements.&lt;/P&gt;&lt;P&gt;If you're doing the same thing across a whole bunch of variables consider an array as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 16:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referring-to-multiple-variables-in-if-then-statement/m-p/174256#M33462</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-05-27T16:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Referring to multiple variables in if/then statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Referring-to-multiple-variables-in-if-then-statement/m-p/174257#M33463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depending on the structure and contents of your Word document you may be able to use it to make a dataset that will create formats.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 17:11:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Referring-to-multiple-variables-in-if-then-statement/m-p/174257#M33463</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-05-27T17:11:18Z</dc:date>
    </item>
  </channel>
</rss>

