<?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: Create multiple conditions in a where statement in a dynamic way in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490420#M128301</link>
    <description>&lt;P&gt;Of course.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adding only:&amp;nbsp; PROC APPEND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Deleting / modifying / adding:&amp;nbsp; a DATA step or PROC SQL&lt;/P&gt;</description>
    <pubDate>Tue, 28 Aug 2018 11:38:47 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-08-28T11:38:47Z</dc:date>
    <item>
      <title>Create multiple conditions in a where statement in a dynamic way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490022#M128092</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need to create multiple conditions in a where statement in a dynamic way.&lt;BR /&gt;I'll explain.&lt;BR /&gt;Let's say we have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where first = "&amp;amp; vala" and second = "&amp;amp; valb" and third = "&amp;amp; valc";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where &amp;amp; val # are values taken from a table with three columns (first, second, third) and a row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do if I want to add one or more lines to the table and make the code in the following way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where (first = "&amp;amp; vala1" and second = "&amp;amp; valb1" and third = "&amp;amp; valc1"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; OR first = "&amp;amp; vala2" and second = "&amp;amp; valb2" and third = "&amp;amp; valc2"&lt;BR /&gt;&amp;nbsp;&amp;nbsp; OR first = "&amp;amp; vala #" and second = "&amp;amp; valb #" and third = "&amp;amp; valc #")&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more question: is there a SAS application which permits the user to modify a table based on some prompt you designed? Such as add rows, upodate a column or something like this?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 10:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490022#M128092</guid>
      <dc:creator>gabras</dc:creator>
      <dc:date>2018-08-27T10:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple conditions in a where statement in a dynamic way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490023#M128093</link>
      <description>&lt;P&gt;Are you allowed to sort your data sets?&amp;nbsp; If so, this becomes a simple match merge and doesn't need any macro language:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=have;&lt;/P&gt;
&lt;P&gt;by first second third;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=valid_values;&lt;/P&gt;
&lt;P&gt;by first second third;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge have (in=in1) valid_values (in=in2);&lt;/P&gt;
&lt;P&gt;by first second third;&lt;/P&gt;
&lt;P&gt;if in1 and in2;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 10:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490023#M128093</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-27T10:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple conditions in a where statement in a dynamic way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490065#M128110</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&lt;/P&gt;&lt;P&gt;you are right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But&amp;nbsp;the problem is not so simple.&lt;/P&gt;&lt;P&gt;I migth have the case in which i have also the fourth column that i not always need to use in the where condition, such as:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where first = &amp;amp;valuea1 and second =&lt;SPAN&gt;valueb1&lt;/SPAN&gt; and third=&lt;SPAN&gt;valuec1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;OR&amp;nbsp;&lt;SPAN&gt;first = &amp;amp;valuea2 and second =&amp;amp;valueb2 and third=&amp;amp;valuec2 and fourth=&amp;nbsp;&amp;amp;valued2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 12:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490065#M128110</guid>
      <dc:creator>gabras</dc:creator>
      <dc:date>2018-08-27T12:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple conditions in a where statement in a dynamic way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490093#M128122</link>
      <description>&lt;P&gt;This is nearly as simple.&amp;nbsp; Presumably you can tell whether you need three variables or four.&amp;nbsp; If you can't tell, that's another story and takes a little more work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let varlist=first second third fourth;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=have;&lt;/P&gt;
&lt;P&gt;by &amp;amp;varlist;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;proc sort data=valid_values;&lt;/P&gt;
&lt;P&gt;by &amp;amp;varlist;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge have (in=in1) valid_values (in=in2 keep=&amp;amp;varlist);&lt;/P&gt;
&lt;P&gt;by &amp;amp;varlist;&lt;/P&gt;
&lt;P&gt;if in1 and in2;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Aug 2018 14:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490093#M128122</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-27T14:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple conditions in a where statement in a dynamic way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490382#M128288</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let's say that what you suggested is correct: i have to think if it fits for my case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is thera a SAS application that permits a user to modify the table &lt;SPAN&gt;valid_values by adding, updating or deleting rows?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 08:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490382#M128288</guid>
      <dc:creator>gabras</dc:creator>
      <dc:date>2018-08-28T08:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple conditions in a where statement in a dynamic way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490420#M128301</link>
      <description>&lt;P&gt;Of course.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adding only:&amp;nbsp; PROC APPEND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Deleting / modifying / adding:&amp;nbsp; a DATA step or PROC SQL&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 11:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490420#M128301</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-08-28T11:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create multiple conditions in a where statement in a dynamic way</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490430#M128304</link>
      <description>&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was looking for the SAS AppDev Studio which you can use to develop web application that could permit the end-user to modify table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 12:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-multiple-conditions-in-a-where-statement-in-a-dynamic-way/m-p/490430#M128304</guid>
      <dc:creator>gabras</dc:creator>
      <dc:date>2018-08-28T12:18:38Z</dc:date>
    </item>
  </channel>
</rss>

