Which of the following variable name is valid in SAS?

  1. 2Date

  2. Rate

  3. Item-Cost

  4. None


Correct Option: B
Explanation:

To solve this question, the user needs to know the rules for naming variables in SAS.

Valid variable names in SAS must adhere to the following rules:

  1. Variable names must start with a letter or an underscore (_).

  2. Subsequent characters can be letters, numbers, or underscores.

  3. Variable names can be up to 32 characters long.

Now, let's go through each option and explain whether it adheres to the naming rules:

A. 2Date: This option is not a valid variable name in SAS as it violates the first rule. Variable names must start with a letter or an underscore (_).

B. Rate: This option is a valid variable name in SAS. It adheres to all the rules for naming variables in SAS.

C. Item-Cost: This option is not a valid variable name in SAS. It violates the second rule. Subsequent characters can be letters, numbers, or underscores, and hyphens are not allowed.

D. None: This option is not a valid variable name in SAS. It violates the first rule. Variable names must start with a letter or an underscore (_).

Therefore, the valid variable name in SAS is option B, Rate.

The Answer is: B

Find more quizzes: