Posts Tagged ‘ Getting Started ’

Ways to multiply in the SAS/IML language

May 20, 2013
By
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 [...]

Read more »

Initializing vectors by using repetition factors

February 25, 2013
By
Initializing vectors by using repetition factors

The SAS/IML language has a curious syntax that enables you to specify a "repetition factor" when you initialize a vector of literal values. Essentially, the language enables you to specify the frequency of an element. For example, suppose you want to define the following vector: proc iml; x = {1 [...]

Read more »

Empty subscripts: How to fill rows and columns of a matrix

February 18, 2013
By
Empty subscripts: How to fill rows and columns of a matrix

Suppose that you have a SAS/IML matrix and you want to set each element of a submatrix to zero (or any other value). There is a simple syntax that accomplishes this task. If you subscript a matrix and do not specify a row, it means "use all rows." So, for [...]

Read more »

How to access any program or data set that appears in the SAS/STAT documentation

February 13, 2013
By
How to access any program or data set that appears in the SAS/STAT documentation

If you are like me, you've experienced the following frustration. You are reading the SAS/STAT documentation, trying to understand some procedure or option, when you find an example that is very similar to what you need. "Great," you think, "this example will help me understand how the SAS procedure works!" [...]

Read more »

How the J function got its name

February 11, 2013
By
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 [...]

Read more »

Simulate discrete variables by using the "Table" distribution

February 4, 2013
By
Simulate discrete variables by using the "Table" distribution

I wanted to write a blog post about the "Table distribution" in SAS. The Table distribution, which is supported by the RAND and the RANDGEN function, enables you to specify the probability of selecting each of k items. Therefore you can use the Table distribution to sample, with replacement, from [...]

Read more »

Oh, those pesky temporary variables!

January 30, 2013
By
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 [...]

Read more »

Breaking bad programming habits. What’s yours?

January 23, 2013
By
Breaking bad programming habits. What’s yours?

I like to be efficient in my SAS/IML programs, but sometimes I get into bad habits. Recently I realized that I was reshaping a bunch of SAS/IML row vectors because I wanted to write them to a SAS data set. This is completely unnecessary! The SAS/IML language will create a [...]

Read more »

Reading big data in the SAS/IML language

January 21, 2013
By
Reading big data in the SAS/IML language

A SAS/IML user on a discussion forum was trying to read data into a SAS/IML matrix, but the data was so large that it would not fit into memory. (Recall that SAS/IML matrices are kept in RAM.) After a few questions, it turned out that the user was trying to [...]

Read more »

Getting started with the SAS/IML language: A free hands-on workshop

January 7, 2013
By
Getting started with the SAS/IML language: A free hands-on workshop

I am pleased to announce that this year at SAS Global Forum 2013 (San Francisco, April 27 to May 1, 2013) I am giving a free hands-on workshop (HOW) entitled "Getting Started with the SAS/IML Language." If you are not familiar with the very popular Hands-On Workshop series at SAS [...]

Read more »

Subscribe

Email:

  Subscribe