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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 237 views
  • 1 like
  • 2 in conversation