Indiana University   Hangeul KB Help Sitemap Calc Links

SAS/IML

This document summarizes the usage of SAS/IML (interactive Matrix Language) Procedure.

SAS icon

APPLICATION DOCUMENTS

SAS icon

SAS/IML BASICS

Basic Rules

Printing

SAS icon

PROC IML

SAS icon

MATRIX DEFINITION

General Definitions

Definition Using Index Vectors

Definition Using Functions

SAS icon

OPERATORS AND FUNCTIONS

Operators

Subscript Reduction Operators

Functions

SAS icon

INPUT AND OUTPUT

Referring to a Data Set

Selecting Observations (USE and READ)

Editing Observations (EDIT, FIND, and DELETE)

Listing Observations (LIST)

Operand

Transforming to Data Sets and External Files (CREATE)

SAS icon

PROGRAMMING

Module

START module-name (argument1, argument2,...);
...
RETURN (results);
FINISH;

IF THEN/ELSE IF

x=3;
IF x=3 | x=6 THEN print 'x=' x;
ELSE IF x=4 THEN print 'x is 4';
ELSE print 'x is bad';

x=4;
IF x=3 | x=6 THEN print 'x=' x;
ELSE IF x=4 THEN print 'x is 4';
ELSE print 'x is bad';

x=5;
IF x=3 | x=6 THEN print 'x=' x;
ELSE IF x=4 THEN print 'x is 4';
ELSE print 'x is bad';

DO ... END

x=3;
DO i=1 TO x BY 2;
print i;
END;

DO WHILE ... END

x=3;
DO WHILE (x<2);
print x; x=x+1;
END;

The DO WHILE loop is evaluated at the top, meaning that if count was 10 in this example, the loop would not execute. The DO UNTIL loop is evaluated at the bottom, meaning that it will always execute at least once.

Do UNTIL ... END

x=3;
DO UNTIL (x<2);
print x'; x=x+1;
END;

SAS icon

MATRIX GENERAL

Definition

Various Matrices

SAS icon

INVERSE MATRICES

Determinant

Inverse Matrices

Theorem

SAS icon

REFERENCES