Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the purpose of the SUM statement in the DATA step?
Answer: The SUM statement in the DATA step is used to accumulate the sum of numeric variables across observations within a BY group or across all observations.

Example:

DATA summary_dataset; SET original_dataset; BY category_variable; /* Create a running total of variable */ RUNNING_TOTAL + variable; IF LAST.category_variable THEN OUTPUT; RUN;
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook