<?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: Where and PDV in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62435#M13614</link>
    <description>clearly when you use a where clause in  data set options, it doesn't use the conditions of the where statement . This causes a WARNING if A is read on the SET statement only with WHERE clauses[pre]25   data B;&lt;BR /&gt;
26   set A(where=(i&amp;lt;8)) ;&lt;BR /&gt;
27   where i&amp;gt;3;&lt;BR /&gt;
WARNING: The WHERE statement cannot be applied to a data set on&lt;BR /&gt;
         the last SET/MERGE/UPDATE/MODIFY statement.  Either&lt;BR /&gt;
         the data sets listed failed with open errors or they&lt;BR /&gt;
         already specify a WHERE data set option.&lt;BR /&gt;
28   run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 7 observations read from the data set WORK.A.&lt;BR /&gt;
      WHERE i&amp;lt;8;&lt;BR /&gt;
NOTE: The data set WORK.B has 7 [/pre]  This is tested on SAS9.2&lt;BR /&gt;
It may be different on your release.</description>
    <pubDate>Fri, 14 Jan 2011 14:45:22 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2011-01-14T14:45:22Z</dc:date>
    <item>
      <title>Where and PDV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62432#M13611</link>
      <description>data A;&lt;BR /&gt;
	do i=1 to 10;&lt;BR /&gt;
		output;&lt;BR /&gt;
	end;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data B;&lt;BR /&gt;
	set A(where=(i&amp;lt;8)) A;&lt;BR /&gt;
	where i&amp;gt;3;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
SAS help document says "A WHERE expression tests the condition before an observation is read into the PDV".   But there are 14 observations in B. What happens in PDV?</description>
      <pubDate>Fri, 14 Jan 2011 08:41:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62432#M13611</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-14T08:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Where and PDV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62433#M13612</link>
      <description>Add dataset option IN= to your SET statement and enlighten us all. Somewhat like&lt;BR /&gt;
[pre]&lt;BR /&gt;
data b;&lt;BR /&gt;
   set a(in=a1 where=(i&amp;lt;8)) a(in=a2);&lt;BR /&gt;
   where i&amp;gt;3;&lt;BR /&gt;
   put (_n_ i a1 a2) (=);&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 14 Jan 2011 09:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62433#M13612</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2011-01-14T09:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Where and PDV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62434#M13613</link>
      <description>Consider the possibilities:&lt;BR /&gt;
&lt;BR /&gt;
- Learning opportunity....&lt;BR /&gt;
- Self-discovery...&lt;BR /&gt;
- Desk-checking SAS program code-path / logic...&lt;BR /&gt;
&lt;BR /&gt;
Amazing how much information one can learn from a PUT (to the SAS log) or with a PUTLOG statement.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 14 Jan 2011 14:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62434#M13613</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2011-01-14T14:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Where and PDV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62435#M13614</link>
      <description>clearly when you use a where clause in  data set options, it doesn't use the conditions of the where statement . This causes a WARNING if A is read on the SET statement only with WHERE clauses[pre]25   data B;&lt;BR /&gt;
26   set A(where=(i&amp;lt;8)) ;&lt;BR /&gt;
27   where i&amp;gt;3;&lt;BR /&gt;
WARNING: The WHERE statement cannot be applied to a data set on&lt;BR /&gt;
         the last SET/MERGE/UPDATE/MODIFY statement.  Either&lt;BR /&gt;
         the data sets listed failed with open errors or they&lt;BR /&gt;
         already specify a WHERE data set option.&lt;BR /&gt;
28   run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: There were 7 observations read from the data set WORK.A.&lt;BR /&gt;
      WHERE i&amp;lt;8;&lt;BR /&gt;
NOTE: The data set WORK.B has 7 [/pre]  This is tested on SAS9.2&lt;BR /&gt;
It may be different on your release.</description>
      <pubDate>Fri, 14 Jan 2011 14:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62435#M13614</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2011-01-14T14:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: Where and PDV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62436#M13615</link>
      <description>...&lt;BR /&gt;&lt;BR /&gt;
&amp;gt; SAS help document says "A WHERE expression tests the&lt;BR /&gt;&lt;BR /&gt;
&amp;gt; condition before an observation is read into the&lt;BR /&gt;&lt;BR /&gt;
&amp;gt; PDV".&lt;BR /&gt;&lt;BR /&gt;
...&lt;BR /&gt;&lt;BR /&gt;
It is &lt;I&gt;also&lt;/I&gt; clearly documented &lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/63026/HTML/default/viewer.htm#a000131192.htm"&gt;here&lt;/A&gt; that:&lt;BR /&gt;&lt;BR /&gt;
&lt;BR /&gt;"If you use both the WHERE= data set option and the WHERE statement in the same DATA step, SAS ignores the WHERE statement for data sets with the WHERE= data set option."</description>
      <pubDate>Fri, 14 Jan 2011 14:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62436#M13615</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2011-01-14T14:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Where and PDV</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62437#M13616</link>
      <description>"If you use both the WHERE= data set option and the WHERE statement in the same DATA step, SAS ignores the WHERE statement for data sets with the WHERE= data set option." &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I get it.  Thank you all.</description>
      <pubDate>Sat, 15 Jan 2011 07:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-and-PDV/m-p/62437#M13616</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-01-15T07:26:08Z</dc:date>
    </item>
  </channel>
</rss>

