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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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