What statement is used to create a new variable in a DATA step?

Boost your career with the SAS Base Exam Certification. Dive into multiple choice questions, detailed explanations, and flashcards to enhance your understanding and ace your exam!

The DATA statement is used in a DATA step to create a new variable. When you use the DATA statement, it initiates a new data set and allows you to define variables within that context.

In the DATA step, you can create new variables by assigning values or calculations to them using the assignment operator (equal sign '='). For instance, you might see something like new_variable = existing_variable + 10; whereby new_variable is defined and calculated based on the value of existing_variable.

The other options represent different functionalities or keywords in SAS. The NEW statement does not exist in SAS, the SET statement is used to read in existing data sets rather than create new variables, and the ASSIGN statement, while it suggests a function of assigning values, is not an actual statement used in SAS syntax. Thus, the DATA statement is the appropriate choice for creating new variables in a DATA step.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy