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.