Statistical Analysis System (SAS) Programming Certification Practice Exam

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare for the SAS Programming Certification Exam with our comprehensive quiz. Study with multiple-choice questions, detailed explanations, and helpful hints to boost your confidence. Ace your certification test!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


Which statement effectively converts the character variable Target to numeric values?

  1. TargetNo=input(target,comma6.);

  2. TargetNo=input(target,comma7.);

  3. TargetNo=put(target,comma6.);

  4. TargetNo=put(target,comma7.);

The correct answer is: TargetNo=input(target,comma7.);

The statement that effectively converts the character variable Target to numeric values uses the INPUT function, which is specifically designed for this purpose. The correct statement utilizes the INPUT function with the appropriate informat, which in this case is comma7. The INPUT function allows for the conversion of character strings to numeric values based on the specified informat. The informat 'comma7.' will interpret the character data in Target as a number, considering up to 7 characters, including commas as thousand separators. This is essential for numerical analysis since numeric variables can be used in calculations while character variables cannot in a straightforward manner. In contrast, the PUT function is meant for converting numeric values to character strings, which would not serve the purpose of converting a character variable to numeric. Therefore, options that utilize the PUT function are not suitable for this task. Additionally, although both options A and B mention the INPUT function, it is important to choose the one that appropriately matches the expected size and format for the target data, which 'comma7.' does in this case. Hence, it confirms that the correct statement facilitates the conversion from character to numeric effectively by using the proper function and informat.