<?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: Date Not Matching in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728719#M226736</link>
    <description>&lt;P&gt;Instead of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let REPORT_DATE=%sysfunc(putn(%sysevalf(%sysfunc(today()) - 1), yymmddd10.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx("report_date","'"!!put(today()-1,yymmddd10.)!!"'","g");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to add single quotes.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Mar 2021 11:19:42 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2021-03-24T11:19:42Z</dc:date>
    <item>
      <title>Date Not Matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728689#M226724</link>
      <description>&lt;P&gt;Issue with the below code.&lt;BR /&gt;The Report date is not getting matched in the below code. So, no rows are getting updated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let REPORT_DATE=%sysfunc(putn(%sysevalf(%sysfunc(today()) - 1), yymmddd10.)); */to get yesterday date in YYYY-MM-DD format/*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;connect to teradata (user="***********" password="*************" server="****************"&lt;BR /&gt;mode=teradata);&lt;/P&gt;&lt;P&gt;create table FLOW_YESTERDAY as&lt;BR /&gt;select * from connection to teradata&lt;BR /&gt;( SELECT * FROM EDWDB.FLOW_ITD&lt;BR /&gt;WHERE CAST(T1_DATE AS DATE) = &amp;amp;REPORT_DATE );&amp;nbsp; */T1_DATE='2021-03-23' gives the required output/*&lt;BR /&gt;disconnect from teradata;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc append base=SASVA.FLOW data=FLOW_YESTERDAY;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please provide a way around.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 08:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728689#M226724</guid>
      <dc:creator>SARATH_IDBI</dc:creator>
      <dc:date>2021-03-24T08:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date Not Matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728692#M226726</link>
      <description>&lt;P&gt;Looks like you need to wrap the macro variable in single quotes but still resolve the value. Here is one way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let REPORT_DATE=%sysfunc(putn(%sysevalf(%sysfunc(today()) - 1), yymmddd10.)); */to get yesterday date in YYYY-MM-DD format/*

 

proc sql;
connect to teradata (user="***********" password="*************" server="****************"
mode=teradata);

create table FLOW_YESTERDAY as
select * from connection to teradata
( SELECT * FROM EDWDB.FLOW_ITD
WHERE CAST(T1_DATE AS DATE) = %str(%')&amp;amp;REPORT_DATE%str(%') );  */T1_DATE='2021-03-23' gives the required output/*
disconnect from teradata;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Mar 2021 09:03:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728692#M226726</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-03-24T09:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: Date Not Matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728719#M226736</link>
      <description>&lt;P&gt;Instead of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let REPORT_DATE=%sysfunc(putn(%sysevalf(%sysfunc(today()) - 1), yymmddd10.));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx("report_date","'"!!put(today()-1,yymmddd10.)!!"'","g");
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to add single quotes.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 11:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728719#M226736</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-24T11:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Date Not Matching</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728739#M226740</link>
      <description>&lt;P&gt;You are comparing your date variable to the formula 2021 minus 3 minus 23 .&lt;/P&gt;
&lt;P&gt;Add quotes.&lt;/P&gt;
&lt;P&gt;Here is a simple macro to make it easier.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://raw.githubusercontent.com/sasutils/macros/master/squote.sas" target="_self"&gt;%squote()&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 13:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Date-Not-Matching/m-p/728739#M226740</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-24T13:01:27Z</dc:date>
    </item>
  </channel>
</rss>

