125 data work.passengers;
126 if OrigPassengers = . then
127 OrigPassengers = 100;
128 TransPassengers = 100;
129 OrigPassengers = .;
130 NonPaying = 10;
131 TotalPassengers = sum (OrigPassengers, TransPassengers);
NOTE: The data set WORK.PASSENGERS has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
The SUM function is used in the statement TotalPassengers = sum (OrigPassengers, TransPassengers);. This function returns the sum of nonmissing arguments (and simply ignores missing arguments). The variable TransPassenger contains a value of '100' and OrigPassengers contains a missing value '.'; thus SUM returns a value of '100' in the output.
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.