<?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: Base SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448042#M112653</link>
    <description>&lt;P&gt;You need a new source for questions. You get what you pay for sometimes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A is not correct and D would not be my guess.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183720"&gt;@Prasad84&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;Key says answer is option A, But according to my knowledge its for range of character variables so( Option D).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please anyone clarify.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Given a SAS data set with the following characteristics:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;200 million observations&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;300 variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Compressed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resides on a network location&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A SAS DATA Step program is written that will retrieve 20% of the data using a search based on a range of a character variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which type of statement is the best choice to minimize computer resource utilization when subsetting this data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;A. KEEP/DROP&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;B. WHERE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C. CASE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;D. IF/THEN/ELSE&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Mar 2018 03:26:13 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-03-23T03:26:13Z</dc:date>
    <item>
      <title>SAS multiple choice efficiency question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448041#M112652</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Key says answer is option A, But according to my knowledge its for range of character variables so( Option D).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please anyone clarify.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Given a SAS data set with the following characteristics:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;200 million observations&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;300 variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Compressed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resides on a network location&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A SAS DATA Step program is written that will retrieve 20% of the data using a search based on a range of a character variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which type of statement is the best choice to minimize computer resource utilization when subsetting this data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;A. KEEP/DROP&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;B. WHERE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C. CASE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;D. IF/THEN/ELSE&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 03:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448041#M112652</guid>
      <dc:creator>Prasad84</dc:creator>
      <dc:date>2018-03-23T03:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448042#M112653</link>
      <description>&lt;P&gt;You need a new source for questions. You get what you pay for sometimes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A is not correct and D would not be my guess.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/183720"&gt;@Prasad84&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;Key says answer is option A, But according to my knowledge its for range of character variables so( Option D).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Please anyone clarify.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Given a SAS data set with the following characteristics:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;200 million observations&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;300 variables&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Compressed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resides on a network location&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;A SAS DATA Step program is written that will retrieve 20% of the data using a search based on a range of a character variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which type of statement is the best choice to minimize computer resource utilization when subsetting this data?&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;A. KEEP/DROP&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;B. WHERE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C. CASE&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;D. IF/THEN/ELSE&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 03:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448042#M112653</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-23T03:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS multiple choice efficiency question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448049#M112656</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;.&lt;/P&gt;
&lt;P&gt;Supposing the question means what it seems to imply, the answer would be&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;where VAR between 'A' and 'B';&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 04:13:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448049#M112656</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-23T04:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS multiple choice efficiency question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448056#M112660</link>
      <description>I agree as where filters data before entering into PDV, So Where is more&lt;BR /&gt;efficient.&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Mar 2018 05:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448056#M112660</guid>
      <dc:creator>Prasad84</dc:creator>
      <dc:date>2018-03-23T05:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: SAS multiple choice efficiency question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448079#M112673</link>
      <description>&lt;P&gt;Ha, that's the theory. If only things were that simple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In fact WHERE clauses are a bit faster than IF tests when simple (equality or inequality) value validations are performed.&lt;/P&gt;
&lt;P&gt;But they are slower when functions are used.&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;

16741  data TEST;
16742    do I=1 to 1e8;
16743      output;
16744    end;
16745  run;


16746  data _null_;
16747    set TEST;
16748    if I=1;
16749  run;

      &lt;STRONG&gt;real time           5.21 seconds&lt;/STRONG&gt;


16750  data _null_;
16751    set TEST;
16752    where I=1;
16753  run;

&lt;STRONG&gt;      real time           4.73 seconds&lt;/STRONG&gt;


16754  data _null_;
16755    set TEST;
16756    if round(I)=1;
16757  run;

&lt;STRONG&gt;      real time           8.40 seconds&lt;/STRONG&gt;


16758  data _null_;
16759    set TEST;
16760    where round(I)=1;
16761  run;&lt;BR /&gt;
&lt;STRONG&gt;      real time           16.07 seconds&lt;/STRONG&gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this simple test on my PC, WHERE is 10% faster than IF for an equality validation, but 100% slower if a function is used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I only uncovered these variations last year, and will have to update the third edition of my book.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks as if functions compiled as part of the data step are more efficient than functions that process the data buffer before the PDV is loaded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Mar 2018 08:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-multiple-choice-efficiency-question/m-p/448079#M112673</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-23T08:12:41Z</dc:date>
    </item>
  </channel>
</rss>

