<?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: Display a variable using select in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557978#M155637</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271494"&gt;@jffeudo86&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;x is a variable that has been calculated prior to the select statement. You can also say SELECT DATE() or any function. It's probably a T-SQL statement more than a pure SQL statement.&amp;nbsp; And I don't know if it works in MySQL.&amp;nbsp; MS SQL/T-SQL sure does.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS Proc SQL is basically ANSI standard with some specific functions (not features such as this) implemented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something in the environment of that specific is using an implied FROM when one is not supplied. But SAS does not support that type of behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that not knowing where a value may come from is problematic.&lt;/P&gt;
&lt;P&gt;I don't think I have even used an intentional or implied _LAST_ reference except for demonstration code on this forum in the past 10 or more years.&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2019 20:51:51 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-05-10T20:51:51Z</dc:date>
    <item>
      <title>Display a variable using select</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557807#M155550</link>
      <description>&lt;P&gt;Is there a statement in SAS equivalent to MS SQL's "Select x" that will display the value of x, with no FROM nor WHERE clauses, just SELECT variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not looking for the %PUT statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 15:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557807#M155550</guid>
      <dc:creator>jffeudo86</dc:creator>
      <dc:date>2019-05-10T15:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Display a variable using select</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557813#M155554</link>
      <description>&lt;P&gt;I doubt that any actual SQL will display a value without something to indicate a source. Where would MySQL find the value??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS will require a FROM to indicate a source;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS will allow you to use FROM _last_ to reference the last created data set as the source of data if for some reason you do not know the actual name of a data set. Of course, if that data set does not contain the specified variable then that is going to generate a variable not found error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data junk;
   x='abc';
run;

proc sql;
  select x
  from _last_
  ;
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 15:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557813#M155554</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-10T15:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Display a variable using select</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557896#M155600</link>
      <description>&lt;P&gt;x is a variable that has been calculated prior to the select statement. You can also say SELECT DATE() or any function. It's probably a T-SQL statement more than a pure SQL statement.&amp;nbsp; And I don't know if it works in MySQL.&amp;nbsp; MS SQL/T-SQL sure does.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 17:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557896#M155600</guid>
      <dc:creator>jffeudo86</dc:creator>
      <dc:date>2019-05-10T17:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Display a variable using select</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557978#M155637</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271494"&gt;@jffeudo86&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;x is a variable that has been calculated prior to the select statement. You can also say SELECT DATE() or any function. It's probably a T-SQL statement more than a pure SQL statement.&amp;nbsp; And I don't know if it works in MySQL.&amp;nbsp; MS SQL/T-SQL sure does.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;SAS Proc SQL is basically ANSI standard with some specific functions (not features such as this) implemented.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something in the environment of that specific is using an implied FROM when one is not supplied. But SAS does not support that type of behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think that not knowing where a value may come from is problematic.&lt;/P&gt;
&lt;P&gt;I don't think I have even used an intentional or implied _LAST_ reference except for demonstration code on this forum in the past 10 or more years.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 20:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Display-a-variable-using-select/m-p/557978#M155637</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-10T20:51:51Z</dc:date>
    </item>
  </channel>
</rss>

