Tag: Getting Started

Learn SAS
Rick Wicklin 0
The GCD and LCM functions in SAS

My daughter's middle school math class recently reviewed how to compute the greatest common factor (GCF) and the least common multiple (LCM) of a set of integers. (The GCF is sometimes called the greatest common divisor, or GCD.) Both algorithms require factoring integers into a product of primes. While helping

Learn SAS
Rick Wicklin 0
Rotating matrices

This article is about rotating matrices. No, I don't mean "rotation matrices," I mean rotating matrices. As in turning a matrix 90 degrees in a clockwise or counterclockwise direction. I was reading a program written in MATLAB in which the programmer used a MATLAB function called ROT90, which rotates a

Learn SAS
Rick Wicklin 0
Ways to multiply in the SAS/IML language

For programmers who are learning the SAS/IML language, it is sometimes confusing that there are two kinds of multiplication operators, whereas in the SAS DATA step there is only scalar multiplication. This article describes the multiplication operators in the SAS/IML language and how to use them to perform common tasks

Learn SAS
Rick Wicklin 0
How the J function got its name

In linear algebra, the I symbol is used to denote an n x n identity matrix. The symbol J (or sometimes 1) is used to denote an n x p matrix of ones. When the SAS/IML language was implemented, the I function was defined to generate the identity matrix. The J function was defined

Learn SAS
Rick Wicklin 0
Oh, those pesky temporary variables!

The SAS/IML language secretly creates temporary variables. Most of the time programmers aren't even aware that the language does this. However, there is one situation where if you don't think carefully about temporary variables, your program will silently produce an error. And as every programmer knows, silent wrong numbers are

1 2 3 4 5 6 8