title: equivalent date_part function in sas
body: <p>I have a sql statement to extract date object. It runs fine in Postgres but not sas. Part query is like this:</p>
  
  <pre><code>(case when date_part('month',run_date)::integer &lt; 10 
       THEN '0'||
            date_part('month',run_date)::varchar(1)||
            date_part('year',run_date)::varchar(4)
       else  date_part('month',run_date)::varchar(2)||date_part('year',run_date)::varchar(4)
       end) as our_date
  </code></pre>
  
  <p>In sas, there's no date_part function. I tried datepart function. But it's not performing the same functionality. How could I make that sql statement run in sas? Thanks.</p>