<?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: SQL function in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5695#M503</link>
    <description>Linda,&lt;BR /&gt;
&lt;BR /&gt;
There are some types of functions that work in different ways in SQL from the data step (they are called "aggregate" functions, like mean, sum, etc.).  For those, look at the SQL reference manual.&lt;BR /&gt;
&lt;BR /&gt;
Your question is sufficiently naive that you may want to do some background reading. There are (at least) two Books-By-Users that are available on the SAS/Publishing web site that address SAS and SQL.  Prairie's might be a good place to start, followed by Lafler's book.&lt;BR /&gt;
&lt;BR /&gt;
For your specific example, the SQL might look something like&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
CREATE TABLE xyz AS&lt;BR /&gt;
SELECT &lt;BR /&gt;
  *&lt;BR /&gt;
FROM mydata.abc&lt;BR /&gt;
WHERE &lt;BR /&gt;
  Eff_Frm_Dt GE TODAY()&lt;BR /&gt;
;&lt;BR /&gt;
QUIT; RUN;&lt;BR /&gt;
&lt;BR /&gt;
as the result-equivalent of&lt;BR /&gt;
&lt;BR /&gt;
DATA xyz;&lt;BR /&gt;
SET mydata.abc;&lt;BR /&gt;
IF Eff_Frm_Dt GE TODAY();&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
    <pubDate>Tue, 29 Jan 2008 21:50:35 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2008-01-29T21:50:35Z</dc:date>
    <item>
      <title>SQL function</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5692#M500</link>
      <description>I am so new to SAS that I am not sure how to even ask a question but here goes - I want to say the following in a Where statement:&lt;BR /&gt;
&lt;BR /&gt;
Eff_Frm_Dt GE to TODAY.   How do I use functions in a Where statement?</description>
      <pubDate>Mon, 26 Nov 2007 20:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5692#M500</guid>
      <dc:creator>lloraine</dc:creator>
      <dc:date>2007-11-26T20:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL function</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5693#M501</link>
      <description>Juste add a pair of parenthesis to TODAY, so as it is known as a function.&lt;BR /&gt;
[pre]&lt;BR /&gt;
Eff_Frm_Dt &amp;gt;= TODAY()&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Regards.&lt;BR /&gt;
Olivier</description>
      <pubDate>Tue, 27 Nov 2007 13:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5693#M501</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2007-11-27T13:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: SQL function</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5694#M502</link>
      <description>...or if your eff_frm_dt returns a datetime value you could do:&lt;BR /&gt;
&lt;BR /&gt;
Eff_Frm_Dt &amp;gt;= datetime()&lt;BR /&gt;
&lt;BR /&gt;
or:&lt;BR /&gt;
&lt;BR /&gt;
eff_frm_dt &amp;gt;= dhms(date(),00,00,00)  &lt;BR /&gt;
&lt;BR /&gt;
This is assuming that you are not connecting to a database.  If you are, you'll have to format the output of the SAS date function to match whatever format the database returns a date value.</description>
      <pubDate>Tue, 29 Jan 2008 19:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5694#M502</guid>
      <dc:creator>JasonDiVirgilio</dc:creator>
      <dc:date>2008-01-29T19:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL function</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5695#M503</link>
      <description>Linda,&lt;BR /&gt;
&lt;BR /&gt;
There are some types of functions that work in different ways in SQL from the data step (they are called "aggregate" functions, like mean, sum, etc.).  For those, look at the SQL reference manual.&lt;BR /&gt;
&lt;BR /&gt;
Your question is sufficiently naive that you may want to do some background reading. There are (at least) two Books-By-Users that are available on the SAS/Publishing web site that address SAS and SQL.  Prairie's might be a good place to start, followed by Lafler's book.&lt;BR /&gt;
&lt;BR /&gt;
For your specific example, the SQL might look something like&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
CREATE TABLE xyz AS&lt;BR /&gt;
SELECT &lt;BR /&gt;
  *&lt;BR /&gt;
FROM mydata.abc&lt;BR /&gt;
WHERE &lt;BR /&gt;
  Eff_Frm_Dt GE TODAY()&lt;BR /&gt;
;&lt;BR /&gt;
QUIT; RUN;&lt;BR /&gt;
&lt;BR /&gt;
as the result-equivalent of&lt;BR /&gt;
&lt;BR /&gt;
DATA xyz;&lt;BR /&gt;
SET mydata.abc;&lt;BR /&gt;
IF Eff_Frm_Dt GE TODAY();&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
Doc Muhlbaier&lt;BR /&gt;
Duke</description>
      <pubDate>Tue, 29 Jan 2008 21:50:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/SQL-function/m-p/5695#M503</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2008-01-29T21:50:35Z</dc:date>
    </item>
  </channel>
</rss>

