BookmarkSubscribeRSS Feed
KingstonCole
Calcite | Level 5

Hi everyone! Can someone help me with this question? I took a practice SAS exam a couple days ago and there was this question that is absolutely driving me insane. The question was about using a length statement before the merge statement. I have always thought that if you add the length statement before the merge then the length statement chooses the length of the column. However, I got the answer wrong because apparently SAS uses the first table in the merge statement to choose the length and not the length statement even though it was written before. I feel like I am missing something here. Can someone help?

 
1 REPLY 1
Kurt_Bremser
Super User

We've covered exactly this question quite recently (see https://communities.sas.com/t5/SAS-Programming/Length-statement-before-merge-statement/m-p/613827#M1...).

Please post the source of the practice exam ("practice exams" not provided by SAS are often unusable junk), the exact question and answer.

 

The correct answer to your question as posted is of course that the length statement takes precedence.

 


@KingstonCole wrote:

Hi everyone! Can someone help me with this question? I took a practice SAS exam a couple days ago and there was this question that is absolutely driving me insane. The question was about using a length statement before the merge statement. I have always thought that if you add the length statement before the merge then the length statement chooses the length of the column. However, I got the answer wrong because apparently SAS uses the first table in the merge statement to choose the length and not the length statement even though it was written before. I feel like I am missing something here. Can someone help?

 

 

SAS Innovate 2025: Register Now

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 344 views
  • 1 like
  • 2 in conversation