title: Convert SAS DATE and use in a PROC SQL
body: <p>I'm having problems to DATEs in SAS Enterprise Guide 7.1 M4.</p>
  
  <p>it's very very simple in SQL Server or VBA but in SAS is driving me crazy.</p>
  
  <p>Problem:
  For some strange reason I'm unable to make a simple select. I tried many different forms of formating and convertions but any seems to work
  My Simple select returns no observations.</p>
  
  <p>Description of <strong>T1.DT_DATE</strong> in proc contents
  Type: Num
  Len: 8
  Format: DDMMYY10.
  Informat: DATETIME20.</p>
  
  <pre><code>%let DATE_EXAMPLE='01JAN2019'd;
  
  data _null_;
        call symput ('CONVERTED_DATE',put(&amp;DATE_EXAMPLE, ddmmyy10.));
  run;
  
  %put &amp;CONVERTED_DATE;
  
  PROC SQL;
      CREATE TABLE TEST_SELECT AS 
          SELECT * 
          FROM MY_SAMPLE_DATA as T1
          WHERE T1.DT_DATE = &amp;CONVERTED_DATE
  ;QUIT;
  </code></pre>