[…] the SAS IML matrix language, elements are stores in row-major order. I have previously shown how to generate the indices of the elements of the main diagonal. It is not much harder to directly enumerate the indices on the first sub- and superdiagonal of an …