<?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: Omission of AS keyword in PROC SQL - new column name _TEMA001 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291639#M270071</link>
    <description>&lt;P&gt;This is good to know &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom﻿&lt;/a&gt;. In an upcoming engagement, I will need to use T-SQL so the differences between PROC SQL and other SQL implementations will come in handy.&lt;/P&gt;</description>
    <pubDate>Mon, 15 Aug 2016 04:16:01 GMT</pubDate>
    <dc:creator>DataScientist</dc:creator>
    <dc:date>2016-08-15T04:16:01Z</dc:date>
    <item>
      <title>Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291491#M270060</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The omission of the AS keyword in PROC SQL causes the new column name to be _TEMA001. Does TEMA stand for&amp;nbsp;Tivoli Enterprise Monitoring Agent or does it have some other significance in SAS?&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 work.birth_months as
select Employee_ID, Birth_Date,
month(Birth_Date) /*as Birth_Month*/,
Employee_Gender
from orion.employee_information;
describe table work.birth_months;
select * from work.birth_months;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2016 07:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291491#M270060</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-13T07:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291493#M270061</link>
      <description>I definitely don't think that SAS names columns after a product from another vendor. &lt;BR /&gt;Even if the name isn't random I don't think it has little significance for the SAS user.&lt;BR /&gt;Best practice must be to always name your columns.</description>
      <pubDate>Sat, 13 Aug 2016 07:36:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291493#M270061</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-08-13T07:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291495#M270062</link>
      <description>&lt;P&gt;I agree&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH﻿&lt;/a&gt;, I make sure I name my columns. In the off chance that I did not, though, got me wondering whether TEMA was&amp;nbsp;an acronym or random letters strung together.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2016 07:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291495#M270062</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-13T07:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291535#M270063</link>
      <description>&lt;P&gt;To be exact, it is not the absence of the AS keyword that causes the creation of _TEMA001 column name, it is the omission of an alias name. The AS keyword itself is optional.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2016 18:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291535#M270063</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-13T18:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291539#M270064</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;, I know the AS keyword is optional in Transact-SQL. However, when PROC SQL code without the AS keyword is executed a syntax error occurs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4597iDDC2D22BDEE35A5F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Alias.PNG" title="Alias.PNG" /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table work.birth_months as
select Employee_ID, Birth_Date,
		month(Birth_Date) Birth_Month,
		Employee_Gender
	from orion.employee_information;
describe table work.birth_months;
select * from work.birth_months;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 13 Aug 2016 19:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291539#M270064</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-13T19:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291540#M270065</link>
      <description>&lt;P&gt;My error. AS is optional for table aliases, but not for column names.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Aug 2016 19:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291540#M270065</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-13T19:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291570#M270066</link>
      <description>&lt;P&gt;Thanks very much for the clarification&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 10:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291570#M270066</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-14T10:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291577#M270067</link>
      <description>&lt;P&gt;Just tried omitting the AS for a table alias&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;. Please see a screenshot of the log.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4601iF868FB5655771B9A/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Table Alias.PNG" title="Table Alias.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table work.birth_months /*as*/
select Employee_ID, Birth_Date,
		month(Birth_Date) 
		as Birth_Month,
		Employee_Gender
	from orion.employee_information;
describe table work.birth_months;
select * from work.birth_months;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 14 Aug 2016 11:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291577#M270067</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-14T11:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291594#M270068</link>
      <description>&lt;P&gt;That is not a table alias. A table alias is defined immediately following the table name when it is referenced in a FROM clause. &amp;nbsp;The AS keyword is optional in that position. &amp;nbsp;For example run this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select a.name,b.height
  from sashelp.class as a
     , sashelp.class b
  where a.name = b.name
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The AS keyword after the CREATE TABLE clause is required when creating the new table directly from the results of a query.&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 15:00:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291594#M270068</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-08-14T15:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291596#M270069</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you ran a statement like this to create a new table using a calculated value:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table x as select mean(age) from sashelp.class;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Most SQL implementations would give an error that you did not give&amp;nbsp;a name to the calculated column. Especially if MEAN(AGE) was not a valid value to use as a name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But PROC SQL will allow you to not do that, but it will use the internally generated name for the column, as you saw.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Alphabetic List of Variables and Attributes

#    Variable    Type    Len

1    _TEMG001    Num       8&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Aug 2016 15:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291596#M270069</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-08-14T15:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291636#M270070</link>
      <description>&lt;P&gt;Thanks for your input&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom﻿&lt;/a&gt;. This clarifies the confusion regarding aliases.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 04:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291636#M270070</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-15T04:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291639#M270071</link>
      <description>&lt;P&gt;This is good to know &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom﻿&lt;/a&gt;. In an upcoming engagement, I will need to use T-SQL so the differences between PROC SQL and other SQL implementations will come in handy.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 04:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291639#M270071</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-15T04:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291691#M270072</link>
      <description>&lt;P&gt;I'm going to guess that the _tem is actually related to the missingness of AS. Note that different ways of not using as create different A or G and possibly other suffixes. And that there is something aparently keeping track of the temporary variables created as in this example code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table work.junk as
   select (age*3),(weight*3)
   from sashelp.class;
quit;

proc sql;
   create table work.junk as
   select mean(age*3),(weight*3)
   from sashelp.class;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the WEIGHT*3 gets two different names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 14:25:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291691#M270072</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-08-15T14:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: Omission of AS keyword in PROC SQL - new column name _TEMA001</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291719#M270073</link>
      <description>&lt;P&gt;Great insight&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw﻿&lt;/a&gt;. So _TEM is the prefix and then the suffix could be an A or G (or maybe another alphabet depending on the operation performed) followed by a number.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 16:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Omission-of-AS-keyword-in-PROC-SQL-new-column-name-TEMA001/m-p/291719#M270073</guid>
      <dc:creator>DataScientist</dc:creator>
      <dc:date>2016-08-15T16:04:11Z</dc:date>
    </item>
  </channel>
</rss>

