<?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: compilation of sas data set in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55617#M15513</link>
    <description>Hi Sandy&lt;BR /&gt;
Just to show that in my environment variable "d" gets added:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
NOTE: This session is executing on the X64_VSPRO  platform.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: SAS initialization used:&lt;BR /&gt;
      real time           0.74 seconds&lt;BR /&gt;
      cpu time            0.60 seconds&lt;BR /&gt;
&lt;BR /&gt;
1    data test;&lt;BR /&gt;
2    a=12;&lt;BR /&gt;
3    c=12;&lt;BR /&gt;
4    run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The data set WORK.TEST has 1 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
5&lt;BR /&gt;
6    data test1;&lt;BR /&gt;
7    set test(keep=c b);&lt;BR /&gt;
ERROR: The variable b in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;
8    d=12;&lt;BR /&gt;
9    run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
WARNING: The data set WORK.TEST1 may be incomplete.  When this step was stopped there were 0 observations and 1 variables.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                          Alphabetic List of Variables and Attributes&lt;BR /&gt;
&lt;BR /&gt;
                                 #    Variable    Type    Len&lt;BR /&gt;
&lt;BR /&gt;
                                 1    d           Num       8</description>
    <pubDate>Fri, 31 Dec 2010 00:25:03 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2010-12-31T00:25:03Z</dc:date>
    <item>
      <title>compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55611#M15507</link>
      <description>Hi.&lt;BR /&gt;
I have a question about compilation step of SAS data step. When I execute the following code:&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
a=12;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data test1;&lt;BR /&gt;
set test(keep=b);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
SAS issues an error message: ERROR: The variable b in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;
My understanding is that this error message was issued by SAS during compilation of SAS data set option KEEP, &lt;BR /&gt;
because variable b was not found in  description portion of data test. However, data set test1 is created (with 0 variables &amp;amp; 0 rows).&lt;BR /&gt;
I thought that if there is an error found during compilation then SAS never gets to the execution step where outputs are created.&lt;BR /&gt;
I would appreciate if you let me know what I am missing.&lt;BR /&gt;
&lt;BR /&gt;
Thanks, George</description>
      <pubDate>Tue, 28 Dec 2010 04:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55611#M15507</guid>
      <dc:creator>gearut</dc:creator>
      <dc:date>2010-12-28T04:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55612#M15508</link>
      <description>removed by user

Message was edited by: TMorville</description>
      <pubDate>Tue, 28 Dec 2010 09:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55612#M15508</guid>
      <dc:creator>TMorville</dc:creator>
      <dc:date>2010-12-28T09:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55613#M15509</link>
      <description>Hi George&lt;BR /&gt;
&lt;BR /&gt;
Interesting observation.&lt;BR /&gt;
&lt;BR /&gt;
The data set and all variables are created during compilation time but observations are added to a data set during execution time.&lt;BR /&gt;
&lt;BR /&gt;
It seems that a wrong variable in the keep option of a set statement doesn't prevent SAS from creating the data set. The error only prevents the execution step from running so that you end up with a data set with zero observations.&lt;BR /&gt;
&lt;BR /&gt;
I agree with you that one would expect the data set not being created. So good to know that SAS reacts differently.&lt;BR /&gt;
&lt;BR /&gt;
HTH&lt;BR /&gt;
Patrick</description>
      <pubDate>Tue, 28 Dec 2010 11:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55613#M15509</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-12-28T11:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55614#M15510</link>
      <description>Hi George,&lt;BR /&gt;
&lt;BR /&gt;
From SAS engines' point of view, the syntax is not wrong.  So first it creates a dataset called TEST1.  The next step is to set a dataset called TEST.  SAS engine checks for the existence of the dataset TEST.  Since TEST exist it goes to the KEEP statement.  That is where it firsts encounters an error.  That's the reason why it gives an error for wrong referencing in KEEP.  But by then the dataset is created, but the variables are not yet defined.&lt;BR /&gt;
&lt;BR /&gt;
Imagine a door way of 8' by 5' and trying to bring 8' by 6' furniture inside.  Even though the whole idea is wrong, it(the ERROR) is identified only when we are at the door way or entry point. By then the room(DATASET) where it goes is defined.&lt;BR /&gt;
&lt;BR /&gt;
Hope you get an idea of why this happens.  This could be explained in a better manner.  Just that assigning words for our thought seems surprisingly complicated.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Sandhya.</description>
      <pubDate>Thu, 30 Dec 2010 19:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55614#M15510</guid>
      <dc:creator>Sandhya</dc:creator>
      <dc:date>2010-12-30T19:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55615#M15511</link>
      <description>Interestingly variable "d" gets added to "test1" but "c" not (SAS9.2 TS Level 2M3 / Win 7 64bit).&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
a=12;&lt;BR /&gt;
c=12;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data test1;&lt;BR /&gt;
set test(keep=c b);&lt;BR /&gt;
d=12;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc contents data=test1;&lt;BR /&gt;
quit;

Message was edited by: Patrick</description>
      <pubDate>Thu, 30 Dec 2010 20:18:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55615#M15511</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-12-30T20:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55616#M15512</link>
      <description>I just copied the code and executed it.&lt;BR /&gt;
&lt;BR /&gt;
Still the dataset is empty with no variable.&lt;BR /&gt;
&lt;BR /&gt;
Sandy.</description>
      <pubDate>Thu, 30 Dec 2010 21:05:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55616#M15512</guid>
      <dc:creator>Sandhya</dc:creator>
      <dc:date>2010-12-30T21:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55617#M15513</link>
      <description>Hi Sandy&lt;BR /&gt;
Just to show that in my environment variable "d" gets added:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
NOTE: This session is executing on the X64_VSPRO  platform.&lt;BR /&gt;
&lt;BR /&gt;
NOTE: SAS initialization used:&lt;BR /&gt;
      real time           0.74 seconds&lt;BR /&gt;
      cpu time            0.60 seconds&lt;BR /&gt;
&lt;BR /&gt;
1    data test;&lt;BR /&gt;
2    a=12;&lt;BR /&gt;
3    c=12;&lt;BR /&gt;
4    run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The data set WORK.TEST has 1 observations and 2 variables.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
5&lt;BR /&gt;
6    data test1;&lt;BR /&gt;
7    set test(keep=c b);&lt;BR /&gt;
ERROR: The variable b in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;
8    d=12;&lt;BR /&gt;
9    run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
WARNING: The data set WORK.TEST1 may be incomplete.  When this step was stopped there were 0 observations and 1 variables.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
                          Alphabetic List of Variables and Attributes&lt;BR /&gt;
&lt;BR /&gt;
                                 #    Variable    Type    Len&lt;BR /&gt;
&lt;BR /&gt;
                                 1    d           Num       8</description>
      <pubDate>Fri, 31 Dec 2010 00:25:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55617#M15513</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2010-12-31T00:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: compilation of sas data set</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55618#M15514</link>
      <description>Sandy and Patrick:&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your insights. I think  I understand it better. This is my &lt;BR /&gt;
thought process: If we run the following code:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
.....&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
then once word scanner is done with the first line, data set compiler&lt;BR /&gt;
is going to check for syntax and then creates a "blank" sas data set (just a door 'x' by 'y'):&lt;BR /&gt;
with no variables and no row. My understanding of blank sas data set&lt;BR /&gt;
is that both portions (description and actual data) are empty. &lt;BR /&gt;
If the compilation of the whole data step was successful then descriptor&lt;BR /&gt;
will have information about variables, otherwise it will remain blank.&lt;BR /&gt;
For example, if we execute the following code:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
bbbbbbb;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
blank sas data set will be created,   even though   the second statement will be not recognized by&lt;BR /&gt;
compiler and SAS will issue an error message.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Thanks and Happy New Year !&lt;BR /&gt;
&lt;BR /&gt;
George</description>
      <pubDate>Fri, 31 Dec 2010 19:39:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/compilation-of-sas-data-set/m-p/55618#M15514</guid>
      <dc:creator>gearut</dc:creator>
      <dc:date>2010-12-31T19:39:26Z</dc:date>
    </item>
  </channel>
</rss>

