Multiple choice technology

data temp; set lib1.x lib2.y; length jobcode $12.; run; What would be the length of Jobcode in temp?

  1. a.) 5

  2. b.) 8

  3. c.) 12

  4. d.) Syntax Error

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In SAS DATA step processing, when a LENGTH statement appears AFTER a SET statement, it cannot modify the length of variables that already exist in the input datasets. LENGTH only affects new variables or those not present in lib1.x or lib2.y. If jobcode already exists with length 8 in either dataset, it retains that original length despite the $12. specification appearing after SET.

AI explanation

To determine the length of the variable "Jobcode" in the dataset "temp", we need to consider the length specified in the length statement for the "temp" dataset.

In the given code, the length statement specifies that the variable "Jobcode" should have a length of $12. This means that the variable can have a maximum length of 12 characters.

Therefore, the correct answer is option B) 8.