Hello KMJ, You are correct. Assignment statements result in NULL if any operand is a NULL value. Sum statements and Sum functions do ignore NULL values in their final result. Regarding your last question, The functions, operands and operators on the right side of the equation drive the result. In your example, AVG is assigned the result since the MEAN function parameters that are NULL are ignored. If you tried to subtraction or add a NULL value, AVG=MEAN(of a1=a4) - null_val, then the AVG would be NULL. This code demonstrates each of your questions: DATA x; *** Assignment question ***; x=10; y=.; A=x+y; PUT "================="; PUT A= ; *** SUM() Question ***; d1=10; d2=20; d3=30; d4=.; D=SUM( of d1-d4); PUT D=; *** Combining Assignment and Function statements Question***; E=MEAN(of d1-d4); PUT E=; F=MEAN(of d1-d4) - d4; PUT F=; PUT "================="; RUN; *** SUM Statement Question***; DATA x2; INFILE DATALINES; LENGTH val 8; INPUT val ; val_sum + val; ** <- sum statement **; DATALINES; 10 20 30 . ; RUN; PROC PRINT; RUN; DATALINES; 10 20 30 . ; RUN; PROC PRINT; RUN; ========================LOG===================== ================= A=. D=60 E=20 F=. ================= NOTE: Missing values were generated as a result of performing an operation on missing values. Each place is given by: (Number of times) at (Line):(Column). 1 at 66:7 1 at 84:21 NOTE: The data set WORK.X has 1 observations and 10 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds ========================OUTPUT===================== Obs val val_sum 1 10 10 2 20 30 3 30 60 4 . 60
... View more