<?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: proc sql insert into values() question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320335#M70540</link>
    <description>&lt;P&gt;No reason to use %eval just use ('29DEC2015'd-'28DEC201&lt;WBR /&gt;5'd)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Though learning th INTCK function will help in the future.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2016 20:25:40 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-12-20T20:25:40Z</dc:date>
    <item>
      <title>Doing mathematical operations with proc sql insert into values()</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320324#M70533</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is it possible to use mathematical operations in the values() statement? For example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;input x $ y z;&lt;BR /&gt;datalines;&lt;BR /&gt;a 1 2&lt;BR /&gt;b 3 4&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;proc sql;&lt;/P&gt;
&lt;P&gt;insert into have values('c',5,6);&lt;BR /&gt;insert into have values('d',3*1,7-6);&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first insert statement works but the second does not. Is it possible to use mathematical operations?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 20:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320324#M70533</guid>
      <dc:creator>spirto</dc:creator>
      <dc:date>2016-12-20T20:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql insert into values() question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320325#M70534</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;input&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; x $ y z;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;a 1 2&lt;/P&gt;&lt;P&gt;b 3 4&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;insert&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;values&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'c'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;insert&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;values&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'d'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%EVAL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;*&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%EVAL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;7&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 19:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320325#M70534</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-12-20T19:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql insert into values() question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320332#M70537</link>
      <description>&lt;P&gt;Thank you for your response! A followup question: how would I use the %EVAL function with date literals.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example how can I do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;insert into have values('d',%EVAL(3*1),%EVAL('29DEC2015'd-'28DEC2015'd));&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 20:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320332#M70537</guid>
      <dc:creator>spirto</dc:creator>
      <dc:date>2016-12-20T20:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql insert into values() question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320335#M70540</link>
      <description>&lt;P&gt;No reason to use %eval just use ('29DEC2015'd-'28DEC201&lt;WBR /&gt;5'd)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Though learning th INTCK function will help in the future.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 20:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320335#M70540</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-20T20:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql insert into values() question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320337#M70542</link>
      <description>&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;insert&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;values&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'c'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;insert&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; have &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;values&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'d'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%EVAL&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;3&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;*&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;),&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%SYSFUNC&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;(INTCK(DAYS,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'28DEC2015'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="3"&gt;'29DEC2015'd&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 20:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320337#M70542</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2016-12-20T20:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql insert into values() question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320340#M70545</link>
      <description>&lt;P&gt;When I tried using just the literals I got an error but using %sysevalf worked. I guess date literals are considered floating point values and not purely interger values&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;insert into have values('d',%eval(3*1),%sysevalf('29DEC2015'd-'28DEC2015'd));&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 20:32:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Doing-mathematical-operations-with-proc-sql-insert-into-values/m-p/320340#M70545</guid>
      <dc:creator>spirto</dc:creator>
      <dc:date>2016-12-20T20:32:45Z</dc:date>
    </item>
  </channel>
</rss>

