BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
swayto
Fluorite | Level 6

I took a practice exam and question was a variable name in datasets employee is $char 10 format and a variable name in  datasets sales has $char 15 format . 

        data both;

        length name $ 20;

        merge sales employee;

        by id;

run;

Question  What is the format for the variable name in the dataset both? I ran a number of dataset and the answer is $20 instead of $15.

 

1 ACCEPTED SOLUTION

Accepted Solutions
tsap
Pyrite | Level 9

You're confusing length and format.

 

The question is "What is the format for the variable name in the dataset both?"

 

$20 is the Length.

 

Neither datasets have a "Format" of $20.

 

The two options are

Dataset                Variable                Format

Employee             name                    $10.

Sales                    name                    $15.

 

 

So in the merge, the first table read in is the 'Sales' table where the variable 'name' is formatted $15. so the new table has the variable 'name' formatted as $15.

 

Hope this helps.

View solution in original post

1 REPLY 1
tsap
Pyrite | Level 9

You're confusing length and format.

 

The question is "What is the format for the variable name in the dataset both?"

 

$20 is the Length.

 

Neither datasets have a "Format" of $20.

 

The two options are

Dataset                Variable                Format

Employee             name                    $10.

Sales                    name                    $15.

 

 

So in the merge, the first table read in is the 'Sales' table where the variable 'name' is formatted $15. so the new table has the variable 'name' formatted as $15.

 

Hope this helps.

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
  • 2295 views
  • 3 likes
  • 2 in conversation