Hi everyone! Please I'm trying to figure out if the process of setting the accumulating variable in sum statement occurs at the compilation or execution phase.
The documentation reads, "the variable is automatically set to 0 before SAS reads the first observation. The variable's value is retained from one iteration to the next, as if it had appeared in a RETAIN statement." I think "before SAS reads the first observation" implies it occurred before the data step execution, i.e. at the compilation stage.
Now in the case of group processing where the accumulating variable is set to zero at the start of each BY group, this appears to be at the execution stage.
Thanks.
During compilation, the memory space for variables is set up, and usually initialized with missing values. Under certain circumstances, other values are used (0 through a SUM statement, or the initial values declared in a RETAIN).
I don't think this will make any practical difference.
My two cents, compilation is the process to transform your text input to executable instructions.
Setting up variables, assignments and such, for me that is part of the execution.
During compilation, the memory space for variables is set up, and usually initialized with missing values. Under certain circumstances, other values are used (0 through a SUM statement, or the initial values declared in a RETAIN).
I stand corrected:
https://documentation.sas.com/doc/en/lrcon/9.4/p18vk5t9cwort1n18g7zg2no6tr4.htm
This is very helpful. Thank you.
Thank you.
Okay Thank you.
This is a knowledge-sharing community for SAS Certified Professionals and anyone who wants to learn more about becoming SAS Certified. Ask questions and get answers fast. Share with others who are interested in certification and who are studying for certifications.To get the most from your community experience, use these getting-started resources:
Community Do's and Don'ts
How to add SAS syntax to your post
How to get fast, helpful answers
Select SAS Training centers are offering in-person courses. View upcoming courses for: