Hello, Am trying to do a new computed column by advanced expression after doing an outer join:
" case when t1.'Claim No'n = "" then t2.'Claim No'n else t1.'Claim No'n end " where am asking it to find the value from the first table and if it is blank then take it from the second table.
The thing is it works for variable types that are string, once i tried to use it for Dates or numbers it gave the error message:
ERROR: Expression using equals (=) has components that are of different data types
Please Advice, thanks
Try a dot instead of quotes - dot is a missing numeric constant, quotes mean a missing character constant:
case when t1.'Claim No'n = .
Dear SASKIWI,
Thanks for your reply, it worked fine with the numeric type. can u advise on what should i use for a date instead of the ( " " or . )
regards,
Dates in SAS are stored as numbers - the number of days after 1 Jan 1960. So a dot works equally well as a constant for checking missing dates.
I have begun to use function missing() instead:
case when missing(t1.'Claim No'n) then t2.'Claim No'n else t1.'Claim No'n end
//Fredrik
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.