142 data work.demosum;
143 set work.calculation;
NOTE: There were 2 observations read from the data set WORK.CALCULATION.
NOTE: The data set WORK.DEMOSUM has 2 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
At compile time, the sum statement initializes the variable Z to zero and retains it. The expression that will be added to Z is num1+sum(num2). But, given that the sum of a single variable is nothing more than the value of that variable, the expression added to Z is essentially num1+num2. In the first pass through the DATA step, Z gets and holds the value 100+200. In the second pass through the DATA step, Z gets an additional value of 300+400 added, thus totaling 1,000.
Following output is created from original dataset, Work.CALCULATION:
GeorgeK Nov 19, 2015ginado Jan 07, 2016shovland Nov 28, 2016shovland Nov 28, 2016shovland Dec 06, 2016kamal Jul 06, 2017
Bi Exam Academy
The one and only FREE resource for general SAS online training as well as study guides for the SAS Base Certification. My goal is to create the SAS Certification prep guide that I never found but always wanted. This should also be a place to come if you are new to the language but are simply looking for online SAS training.