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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 600 views
  • 1 like
  • 2 in conversation