<?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: SAS Date Prompt in Proc SQL Statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165352#M31910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, implicit pass-thru may make the process more complicated as the process requires multi-table joins and nested queries to gather the necessary data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Dec 2014 15:46:11 GMT</pubDate>
    <dc:creator>NathanOch</dc:creator>
    <dc:date>2014-12-30T15:46:11Z</dc:date>
    <item>
      <title>SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165350#M31908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;s I am connecting via ODBC connection to a SQL database using a SAS PROC SQL statement. My goal is to use a SAS date prompt within the PROC SQL statement to limit the amount of data I am extracting from the database and decrease my run time. The SAS date prompt code looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;&lt;SPAN style="color: #000000;"&gt;Date_Column&lt;/SPAN&gt; between&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; convert(datetime,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"&amp;amp;Date_Placed_min"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; convert(datetime,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"&amp;amp;Date_Placed_max"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;The SAS date prompt is represented by the &amp;amp;Date_Placed indicator within the code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue I am having is with getting the SAS date to interact with the SQL date format. I get this error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;ERROR: CLI describe error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name '24Nov2014'. : [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name '30Dec2014'. : [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;As you can see, it isn't converting the date to the SQL standard YYYY-MM-DD format. What type of conversion either within the SQL code or a SAS macro must I do in order to get the SAS date to successfully interact with the SQL code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Nate&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 15:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165350#M31908</guid>
      <dc:creator>NathanOch</dc:creator>
      <dc:date>2014-12-30T15:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165351#M31909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look like explicit SQL pass-thru code...?&lt;/P&gt;&lt;P&gt;If you could use implicit SQL pass-thru instead, and let SAS/ACCESS do the date conversion for you...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 15:40:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165351#M31909</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-12-30T15:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165352#M31910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, implicit pass-thru may make the process more complicated as the process requires multi-table joins and nested queries to gather the necessary data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 15:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165352#M31910</guid>
      <dc:creator>NathanOch</dc:creator>
      <dc:date>2014-12-30T15:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165353#M31911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're connecting to SQL server?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks to me like it can handle without the convert function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Date_Column between 'yyyymmdd' and 'yyyymmdd'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would take a look at what you have in &amp;amp;date_placed_min.&amp;nbsp; Is it '24Nov2014'd now? and convert it to YYYYMMDD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you know what you have in the macro variable, you can use PUTN() to convert it, something like (untested):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let new_date_placed_min=%sysfunc(putn(&amp;amp;date_placed_min,yymmddn8.)) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 15:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165353#M31911</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-12-30T15:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165354#M31912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am connecting to SQL server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have actually experimented with converting it via a macro:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%let LDmin = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;(putn("&amp;amp;Date_Placed_min"d,YYMMDD10.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;%let LDmax = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;%sysfunc&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;(putn("&amp;amp;Date_Placed_max"d,YYMMDD10.));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I then reference the new variable in the WHERE statement:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;cast(d.turnover_date as&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;between&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; cast(convert(datetime,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"&amp;amp;LDmin"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; cast(convert(datetime,&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 12pt; font-family: Courier New;"&gt;"&amp;amp;LDmax"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt; date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: Courier New;"&gt;I get an error with the correct date format, but SAS still doesn't like it:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: CLI describe error: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name '2014-11-24'. : [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name '2014-12-30'. : [Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 16:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165354#M31912</guid>
      <dc:creator>NathanOch</dc:creator>
      <dc:date>2014-12-30T16:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165355#M31913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like the SQL server thinks the date values you are passing are variable names not values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 18:24:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165355#M31913</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-12-30T18:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165356#M31914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Understand what is happening with all the involved conversions.&lt;/P&gt;&lt;P&gt;Within a SAS environment a data indication is eg:&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080; font-family: Courier New; font-size: 12pt;"&gt;"&amp;amp;Date_Placed_min"d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This will convert the date to a number. That number is not translated to native SQL format in an easy way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The more easy approach is defining the macros as a native string the ODBC is expecting, in explicit pass thru.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;See:&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#p1f29m86u65hken1deqcybowtgma.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#p1f29m86u65hken1deqcybowtgma.htm"&gt;SAS/ACCESS(R) 9.3 for Relational Databases: Reference, Second Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type matching for date(time) can be adjusted set: &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#p13xka550rm442n1gdvi1swxgr1h.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#p13xka550rm442n1gdvi1swxgr1h.htm"&gt;SAS/ACCESS(R) 9.3 for Relational Databases: Reference, Second Edition&lt;/A&gt; and &lt;A href="http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#n0l9jhk6dhd2ktn1vw123s31bm2e.htm" title="http://support.sas.com/documentation/cdl/en/acreldb/65247/HTML/default/viewer.htm#n0l9jhk6dhd2ktn1vw123s31bm2e.htm"&gt;SAS/ACCESS(R) 9.3 for Relational Databases: Reference, Second Edition&lt;/A&gt; string/numeric&lt;/P&gt;&lt;P&gt;What you should do is defining the sas-trace for SQL so you can see and follow what is generated and send as SQL.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 18:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165356#M31914</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-12-30T18:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165357#M31915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks to me like you don't have the SQL syntax right. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;suggest you u write the code without any macro variables so you can confirm the syntax. From what I read, you shouldn't need convert() or even cast() if you have a date literal SQL recognizes, being compared to a date variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then once you have the SQL syntax correct, come back to macro land to generate the needed date string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 20:44:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165357#M31915</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-12-30T20:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165358#M31916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My memory is oracle likes single quotes around literals but does not like double quotes. Perhaps SQL server is the same??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 20:46:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165358#M31916</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2014-12-30T20:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165359#M31917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suggest you first try and get the SQL working by running it with hard coded date strings, eg. something like:&amp;nbsp; cast(d.turnover_date as date) between '2014-01-01' and '2014-12-30'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once your code works this way add the variable bits. Below some code how you could test that the correct code gets generated and sent to the SQL server (generating the hard coded string you know already that it will be working).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let Date_Placed_min=01jan2014;&lt;/P&gt;&lt;P&gt;%let Date_Placed_max=30dec2014;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let LDmin = %sysfunc(putn("&amp;amp;Date_Placed_min"d,YYMMDD10.));&lt;/P&gt;&lt;P&gt;%let LDmax = %sysfunc(putn("&amp;amp;Date_Placed_max"d,YYMMDD10.));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put LDmin: &amp;amp;LDmin;&lt;/P&gt;&lt;P&gt;%put LDmax: &amp;amp;LDmax;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let min=%str(%')&amp;amp;LDmin%str(%');&lt;/P&gt;&lt;P&gt;%let max=%str(%')&amp;amp;LDmax%str(%');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put min: &amp;amp;min;&lt;/P&gt;&lt;P&gt;%put max: &amp;amp;max;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put %bquote(&amp;nbsp; cast(d.turnover_date as date) between &amp;amp;min and &amp;amp;max&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;cast(d.turnover_date as date) between '2014-01-01' and '2014-12-30'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 00:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/165359#M31917</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-12-31T00:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Date Prompt in Proc SQL Statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/275031#M54948</link>
      <description>&lt;P&gt;SAS tech support created this macro code to help inject a date prompt into my SQL code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; new_min=&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%str&lt;/FONT&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;(inputn(&amp;amp;Date_Range_min,date9.),yymmdd10.)&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%str&lt;/FONT&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;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%let&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt; new_max=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%str&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(%')&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%sysfunc&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(inputn(&amp;amp;Date_Range_max,date9.),yymmdd10.)&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;%str&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;&lt;FONT face="Courier New" size="3"&gt;(%');&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I use the new_min value&amp;nbsp;for the start date, and the new_max value for the end date.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 16:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Date-Prompt-in-Proc-SQL-Statement/m-p/275031#M54948</guid>
      <dc:creator>NathanOch</dc:creator>
      <dc:date>2016-06-03T16:56:48Z</dc:date>
    </item>
  </channel>
</rss>

