Statistical Analysis System (SAS) Programming Certification Practice Exam

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

Study for the SAS Programming Certification Exam. Master multiple choice questions, check explanations, and gear up for success. Boost your knowledge and confidence with engaging content!

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 function is used to extract a substring from a specific position in a character variable?

  1. SCAN

  2. SUBSTR

  3. INPUT

  4. PUT

The correct answer is: SUBSTR

The function used to extract a substring from a specific position in a character variable is SUBSTR. This function allows you to specify the starting position and the length of the substring you want to retrieve. For example, if you have a character variable containing the string "SAS Programming" and you wish to extract "Programming," you can use SUBSTR with a starting position of 5 and a length of 11, which effectively isolates that part of the string. It is particularly useful for string manipulation and data processing tasks where you need to work with specific segments of character data. In contrast, SCAN is used to extract words from a string based on a delimiter, while INPUT converts character strings to numeric values or SAS date values, and PUT converts numeric values to character strings. These functions serve different purposes and do not provide the same kind of substring extraction that SUBSTR does.