<?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 How to apply where condition on multiple datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-where-condition-on-multiple-datasets/m-p/767426#M243296</link>
    <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to apply where condition ( same condition ) when there are multiple ( apprx 30 - 100) datasets (dataset names and count is unknown ) in 1 library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have do this manually, but this is not feasible when there are multiple datasets in 1 library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how do i short this code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I want same naming covension for input dataset and output datasets. like one and one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data one;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;B 200&lt;BR /&gt;C 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data two;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;B 200&lt;BR /&gt;D 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data three;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;F 300&lt;BR /&gt;D 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data four;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;F 300&lt;BR /&gt;D 300&lt;BR /&gt;G 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data one ; set one; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;data two ; set two; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;data three ; set three; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;data four ; set four; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Sep 2021 14:26:15 GMT</pubDate>
    <dc:creator>pdhokriya</dc:creator>
    <dc:date>2021-09-13T14:26:15Z</dc:date>
    <item>
      <title>How to apply where condition on multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-where-condition-on-multiple-datasets/m-p/767426#M243296</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how to apply where condition ( same condition ) when there are multiple ( apprx 30 - 100) datasets (dataset names and count is unknown ) in 1 library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have do this manually, but this is not feasible when there are multiple datasets in 1 library.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how do i short this code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I want same naming covension for input dataset and output datasets. like one and one.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data one;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;B 200&lt;BR /&gt;C 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data two;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;B 200&lt;BR /&gt;D 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data three;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;F 300&lt;BR /&gt;D 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;data four;&lt;BR /&gt;input name $ var1 ;&lt;BR /&gt;cards;&lt;BR /&gt;A 100&lt;BR /&gt;F 300&lt;BR /&gt;D 300&lt;BR /&gt;G 300&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data one ; set one; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;data two ; set two; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;data three ; set three; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;data four ; set four; if var1 = 300 then delete; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 14:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-apply-where-condition-on-multiple-datasets/m-p/767426#M243296</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-09-13T14:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to apply where condition on multiple datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-apply-where-condition-on-multiple-datasets/m-p/767437#M243301</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55374"&gt;@pdhokriya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use data-driven code generation with file-put-include!&lt;BR /&gt;Other techniques are also possible (call execute, macro, ...).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL noprint;
 create table work.tables as
 select memname
 from dictionary.tables
; QUIT;

/* suppose above query results in below data set */
data work.tables;
LENGTH memname $ 32;
memname='one';   output;
memname='two';   output;
memname='three'; output;
memname='four';  output;
run;

filename tt temp;

data _NULL_;
 set work.tables;
 file tt;
PUT 'data ' memname '; set ' memname '; if var1 = 300 then delete; run;';
run;

/* proc fslist file=tt; run; */
options source2;
%INCLUDE tt;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 15:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-apply-where-condition-on-multiple-datasets/m-p/767437#M243301</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-09-13T15:03:19Z</dc:date>
    </item>
  </channel>
</rss>

