<?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: Data step options in PROC SQL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304304#M60829</link>
    <description>&lt;P&gt;Functionally they may be the same, however I would recommend not using dataset options in SQL. &amp;nbsp;There are various reasons, the two are separate languages, so using one in the other would confuse those people familiar with SQL. &amp;nbsp;Also, the code no longer becomes portable - i.e. you cant copy th code out to a pure SQL processor. &amp;nbsp;Also, if you use in conjunction with an actual database you may find it takes longer to process or compile. &amp;nbsp;I can tell you straight off there is &lt;STRONG&gt;never&lt;/STRONG&gt; a need to use dataset options in SQL. &amp;nbsp;So this question is really mute. &amp;nbsp;The only time I have seen it used usefully is when people use select *, which in itself is not recommended. &amp;nbsp;You should know what data you want to pull from the table{s}, select * is both sloppy lazy programming, and could cause issues with your code.&lt;/P&gt;
&lt;P&gt;So simply put, there is no benefit to using these, its not portable, and sloppy coding should be avoided anyways.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Oct 2016 09:54:08 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-10-13T09:54:08Z</dc:date>
    <item>
      <title>Data step options in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304303#M60828</link>
      <description>&lt;P&gt;I noticed that I can use data step options inside a proc SQL for example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;create table countries2 as
select * from sql.countries(drop=UNDate);&lt;/PRE&gt;&lt;P&gt;Now in the case of the WHERE option I'm wondering what's the difference between this&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;PRE&gt;PROC SQL;
	CREATE TABLE sql_where AS
		SELECT *
		FROM essentia.olympic
		WHERE year = 2012;
QUIT;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
	CREATE TABLE sql_where (WHERE= (year=2012)) AS
		SELECT *
		FROM essentia.olympic;
QUIT;&lt;/PRE&gt;&lt;P&gt;the resulting sets are the same so I'm thinking the difference is in efficency. Which&amp;nbsp;form is better?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 09:53:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304303#M60828</guid>
      <dc:creator>Crysis85</dc:creator>
      <dc:date>2016-10-13T09:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Data step options in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304304#M60829</link>
      <description>&lt;P&gt;Functionally they may be the same, however I would recommend not using dataset options in SQL. &amp;nbsp;There are various reasons, the two are separate languages, so using one in the other would confuse those people familiar with SQL. &amp;nbsp;Also, the code no longer becomes portable - i.e. you cant copy th code out to a pure SQL processor. &amp;nbsp;Also, if you use in conjunction with an actual database you may find it takes longer to process or compile. &amp;nbsp;I can tell you straight off there is &lt;STRONG&gt;never&lt;/STRONG&gt; a need to use dataset options in SQL. &amp;nbsp;So this question is really mute. &amp;nbsp;The only time I have seen it used usefully is when people use select *, which in itself is not recommended. &amp;nbsp;You should know what data you want to pull from the table{s}, select * is both sloppy lazy programming, and could cause issues with your code.&lt;/P&gt;
&lt;P&gt;So simply put, there is no benefit to using these, its not portable, and sloppy coding should be avoided anyways.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 09:54:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304304#M60829</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-13T09:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Data step options in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304309#M60830</link>
      <description>&lt;P&gt;Thanks for the answer, I never used myself (didn't even know it was possible) but then I ended up maintaining some code that used this WHERE as a data option and asked myself if it was better than the other way. It is not apparently, good to know. Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 10:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304309#M60830</guid>
      <dc:creator>Crysis85</dc:creator>
      <dc:date>2016-10-13T10:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Data step options in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304310#M60831</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;&amp;nbsp;input whether my understanding is correct that I have written down below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
	CREATE TABLE sql_where AS
		SELECT *
		FROM essentia.olympic
		WHERE year = 2012;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Above step would restrict rows in PDV. Only those row would come in PDV that has year=2012.&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
	CREATE TABLE sql_where (WHERE= (year=2012)) AS
		SELECT *
		FROM essentia.olympic;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The second approach would read every row in PDV irrespective of year =2012 and later on it will restrict while writing output dataset. Therefore this approach would definately take much longer time&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 10:16:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304310#M60831</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-10-13T10:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data step options in PROC SQL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304313#M60832</link>
      <description>&lt;P&gt;That sounds about right to me, its a bit like putting dataset options on the set statment rather than on the data statement:&lt;/P&gt;
&lt;P&gt;E.g.&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set have (keep= a b c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if d=1 ... this will fail as d is not read into PDV for processing&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want (keep=a b c);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if d=1 ... this will not fail as all variables are read into the PDV and only a b c are written out to the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do note, I haven't tested or anything, just my best guess&amp;nbsp;&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2016 10:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Data-step-options-in-PROC-SQL/m-p/304313#M60832</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-13T10:23:49Z</dc:date>
    </item>
  </channel>
</rss>

