Further Notes |
The Interactive Matrix Language is an interpretive language executor that can be characterized as follows:
Consider the following four methods of summing the elements of a matrix:
s=0; /* method 1 */ do i=1 to m; do j=1 to n; s=s+x[i,j]; end; end; s=j[1,m]*x*j[n,1]; /* method 2 */ s=x[+,+]; /* method 3 */ s=sum(x); /* method 4 */Method 1 is the least efficient, method 2 is more efficient, method 3 is more efficient yet, and method 4 is the most efficient. The greatest advantage of using IML is reducing human programming labor.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.