BookmarkSubscribeRSS Feed
thomask23
Fluorite | Level 6

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"

1 REPLY 1
art297
Opal | Level 21

untested:

CASE WHEN a.DT > '02Jan2015'd

     THEN b.STAT

          Else a.STAT end as STAT

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 5156 views
  • 0 likes
  • 2 in conversation