BookmarkSubscribeRSS Feed
webart999ARM
Quartz | Level 8

Hi there,

I have a program part with proc SQL in my code, but I don't understand one particular part from that SQL code.

 

webart999ARM_1-1597398741334.png


Could anyone please help me to understand for what is responsible above highlighted END= part in this SQL query.

 

Thank you in advance.

 

2 REPLIES 2
gamotte
Rhodochrosite | Level 12
Hello,

It is part of the syntax of CASE WHEN expressions.
https://documentation.sas.com/?docsetId=sqlproc&docsetTarget=n0a85s0ijz65irn1h3jtariooea5.htm&docset...

Here, the join is made on the condition that the variable defined by "CASE WHEN ... END" is equal to (uppercased) preunit.
Tom
Super User Tom
Super User

The END marks the end of the CASE.  The equal sign is an equality test. 

 

Your ON conditions are using CASE to recode A.LPARM and A.PREUNIT on the fly and compare the results to B.PARM and B.PREUNIT respectively.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1774 views
  • 0 likes
  • 3 in conversation