<?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 sas base question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237111#M43456</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please anyone explain how the below answer is correct. This question is from a sas dump.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the SAS data set SASDATA.TWO:&lt;BR /&gt;SASDATA.TWO&lt;BR /&gt;XY&lt;BR /&gt;----&lt;BR /&gt;52&lt;BR /&gt;31&lt;BR /&gt;56&lt;BR /&gt;The following SAS program is submitted:&lt;BR /&gt;data sasuser.one two sasdata.three;&lt;BR /&gt;set sasdata two;&lt;BR /&gt;if x = 5 then output sasuser.one;&lt;BR /&gt;else output sasdata two;&lt;BR /&gt;run;&lt;BR /&gt;What is the result?&lt;BR /&gt;A. data set SASUSER.ONE has 5 observations&lt;BR /&gt;data set SASUSER.TWO has 5 observations&lt;BR /&gt;data set WORK.OTHER has 3 observations&lt;BR /&gt;B. data set SASUSER.ONE has 2 observations&lt;BR /&gt;data set SASUSER.TWO has 2 observations&lt;BR /&gt;data set WORK.OTHER has 1 observations&lt;BR /&gt;C. data set SASUSER.ONE has 2 observations&lt;BR /&gt;data set SASUSER.TWO has 2 observations&lt;BR /&gt;data set WORK.OTHER has 5 observations&lt;BR /&gt;D. No data sets are output.&lt;BR /&gt;The DATA step fails execution due to syntax errors.&lt;BR /&gt;Answer: A&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2015 07:45:25 GMT</pubDate>
    <dc:creator>new510</dc:creator>
    <dc:date>2015-12-01T07:45:25Z</dc:date>
    <item>
      <title>sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237111#M43456</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please anyone explain how the below answer is correct. This question is from a sas dump.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given the SAS data set SASDATA.TWO:&lt;BR /&gt;SASDATA.TWO&lt;BR /&gt;XY&lt;BR /&gt;----&lt;BR /&gt;52&lt;BR /&gt;31&lt;BR /&gt;56&lt;BR /&gt;The following SAS program is submitted:&lt;BR /&gt;data sasuser.one two sasdata.three;&lt;BR /&gt;set sasdata two;&lt;BR /&gt;if x = 5 then output sasuser.one;&lt;BR /&gt;else output sasdata two;&lt;BR /&gt;run;&lt;BR /&gt;What is the result?&lt;BR /&gt;A. data set SASUSER.ONE has 5 observations&lt;BR /&gt;data set SASUSER.TWO has 5 observations&lt;BR /&gt;data set WORK.OTHER has 3 observations&lt;BR /&gt;B. data set SASUSER.ONE has 2 observations&lt;BR /&gt;data set SASUSER.TWO has 2 observations&lt;BR /&gt;data set WORK.OTHER has 1 observations&lt;BR /&gt;C. data set SASUSER.ONE has 2 observations&lt;BR /&gt;data set SASUSER.TWO has 2 observations&lt;BR /&gt;data set WORK.OTHER has 5 observations&lt;BR /&gt;D. No data sets are output.&lt;BR /&gt;The DATA step fails execution due to syntax errors.&lt;BR /&gt;Answer: A&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 07:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237111#M43456</guid>
      <dc:creator>new510</dc:creator>
      <dc:date>2015-12-01T07:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237122#M43457</link>
      <description>&lt;P&gt;You seem to be having errors in the code...&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Given the SAS data set SASDATA.TWO:
SASDATA.TWO
XY
----
52
31
56
The following SAS program is submitted:
data sasuser.one two sasdata.three;
set sasdata two;
if x = 5 then output sasuser.one;
else output sasdata two;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the set statement, a period "." is missing as your dataset name is SASDATA.TWO&lt;/P&gt;&lt;P&gt;Also, in the else statement, you are writing to sasdata &amp;amp; two however you have defined "sasdata.three" as the dataset name in your DATA step &amp;gt;&amp;gt; &amp;nbsp;"&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sasuser.one two sasdata.three;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps....Good Luck...!!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 08:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237122#M43457</guid>
      <dc:creator>kannand</dc:creator>
      <dc:date>2015-12-01T08:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237139#M43461</link>
      <description>&lt;P&gt;The correct answer is not A. It is D ("The DATA step fails execution due to syntax errors."). The this due to the errors described in a previous reply. If submitting the code the SAS log looks like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;56   data sasuser.one two sasdata.three;
57       set sasdata two;
ERROR: File WORK.SASDATA.DATA does not exist.
58       if x = 5 then output sasuser.one;
59       else output sasdata two;
                     -------
                     455
ERROR 455-185: Data set was not specified on the DATA statement.

60   run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SASUSER.ONE may be incomplete.  When this step was stopped there were 0
         observations and 1 variables.
WARNING: Data set SASUSER.ONE was not replaced because this step was stopped.
WARNING: The data set WORK.TWO may be incomplete.  When this step was stopped there were 0
         observations and 1 variables.
WARNING: Data set WORK.TWO was not replaced because this step was stopped.
WARNING: The data set SASDATA.THREE may be incomplete.  When this step was stopped there were 0
         observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.04 seconds&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 10:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237139#M43461</guid>
      <dc:creator>Rikard</dc:creator>
      <dc:date>2015-12-01T10:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: sas base question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237165#M43466</link>
      <description>Thank you</description>
      <pubDate>Tue, 01 Dec 2015 14:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-base-question/m-p/237165#M43466</guid>
      <dc:creator>new510</dc:creator>
      <dc:date>2015-12-01T14:17:52Z</dc:date>
    </item>
  </channel>
</rss>

