Working with Matrices

More about Missing Values

Missing values in matrices are discussed in Chapter 2, Understanding the SAS/IML Language. You should carefully read that chapter and Chapter 24, Further Notes, so that you are aware of the way SAS/IML software handles missing values. The following examples show how missing values are handled for elementwise operations and for subscript reduction operators.

Consider the following two matrices bold upper X and bold upper Y:

bold upper X equals Start 3 By 3 Matrix 1st Row 1st Column 1 2nd Column 2 3rd Column period 2nd Row 1st Column period 2nd Column 5 3rd Column 6 3rd Row 1st Column 7 2nd Column period 3rd Column 9 EndMatrix bold upper Y equals Start 3 By 3 Matrix 1st Row 1st Column 4 2nd Column period 3rd Column 2 2nd Row 1st Column 2 2nd Column 1 3rd Column 3 3rd Row 1st Column 6 2nd Column period 3rd Column 5 EndMatrix

The following operations handle missing values in matrices:

Matrix addition colon bold upper X plus bold upper Y is Start 3 By 3 Matrix 1st Row 1st Column 5 2nd Column period 3rd Column period 2nd Row 1st Column period 2nd Column 6 3rd Column 9 3rd Row 1st Column 13 2nd Column period 3rd Column 14 EndMatrix
Elementwise multiplication colon bold upper X number-sign bold upper Y is Start 3 By 3 Matrix 1st Row 1st Column 4 2nd Column period 3rd Column period 2nd Row 1st Column period 2nd Column 5 3rd Column 18 3rd Row 1st Column 42 2nd Column period 3rd Column 45 EndMatrix
Subscript reduction colon bold upper X left-bracket plus comma right-bracket is Start 1 By 3 Matrix 1st Row 1st Column 8 2nd Column 7 3rd Column 15 EndMatrix
Last updated: July 20, 2026