123k views
1 vote
Which of the following functions can convert the values of the numeric variable Level to character values?

a. put(Level,3.)
b. input(3.,Level)
c. put(3.,Level)
d. input(Level,3.)

User FireGM
by
7.9k points

1 Answer

2 votes

Final answer:

The function that converts numeric values to character values is put(Level,3.), making option a. the correct choice. The PUT function changes the format from numeric to character, while the INPUT function, which is seen in the other options, is used for the opposite conversion, the correct option is A).

Step-by-step explanation:

The function that can convert the values of the numeric variable Level to character values in a programming context is put(Level,3.). The PUT function in many programming languages, including SAS, is used to convert numeric data to character format. The syntax put(variable, format.) takes a numeric variable and a format as arguments and returns a character string. So, option a. put(Level,3.) is the correct choice.

Option b. input(3.,Level), and option d. input(Level,3.) are using the INPUT function incorrectly, as it is used to convert character data to numeric format, not the other way around. In addition, the syntax is incorrect because the INPUT function takes a character string to convert and a format as arguments. Option c. put(3.,Level) is also incorrect due to improper use of the PUT function, as it expects a variable as the first argument, not a numeric literal.

User Roman Svyatnenko
by
7.8k points