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.

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
  • 2 replies
  • 1201 views
  • 0 likes
  • 3 in conversation