104k views
5 votes
Which of the following statements is used in SAS to retain variables from the Dataset?

a) PRESERVE
b) RETAIN
c) KEEP
d) RESERVE

User Smishra
by
7.6k points

1 Answer

2 votes

Final answer:

The correct statement used in SAS to retain variables from the dataset is RETAIN.

Step-by-step explanation:

The correct statement used in SAS to retain variables from the dataset is RETAIN.

When we use the RETAIN statement in SAS, it allows us to keep the values of variables from one iteration of the data step to the next, ensuring that the values persist across iterations.

For example, if we want to calculate a running total or a cumulative sum of a variable, we can use the RETAIN statement to retain the value of the sum variable and add the current value to it in each iteration.

User Gnanz
by
7.8k points

Related questions