DATA Step, Macro, Functions and more

Case Statement with Date

Reply
Occasional Contributor
Posts: 16

Case Statement with Date

Hello,

I need to write a case statement that would return a specific variable based on the date.  I tried the below syntax and is recieving an error.  Please advise on the appropiate syntax.

CASE WHEN a.DT > 02Jan2015'd'

     THEN b.STAT

          Else a.STAT end as "STAT"

PROC Star
Posts: 7,468

Re: Case Statement with Date

Posted in reply to thomask23

untested:

CASE WHEN a.DT > '02Jan2015'd

     THEN b.STAT

          Else a.STAT end as STAT

Ask a Question
Discussion stats
  • 1 reply
  • 1457 views
  • 0 likes
  • 2 in conversation