Tag: Getting Started

Rick Wicklin 7
Storing and loading modules

You can extend the capability of the SAS/IML language by writing modules. A module is a user-defined function. You can define a module by using the START and FINISH statements. Many people, including myself, define modules at the top of the SAS/IML program in which they are used. You can

Rick Wicklin 6
Complex assignment statements: CHOOSE wisely

This article describes the SAS/IML CHOOSE function: how it works, how it doesn't work, and how to use it to make your SAS/IML programs more compact. In particular, the CHOOSE function has a potential "gotcha!" that you need to understand if you want your program to perform as expected. What

Rick Wicklin 1
Options for Printing a Matrix

A matrix is an array of numbers or character strings. When I print a matrix, I usually want to see only the data. However, sometimes it is helpful to add row or column headings that indicate the names of variables or labels for rows. A simple example is count data

Rick Wicklin 0
A simple signum function

The other day I needed to compute the signum function for each element of a matrix. If x is a real number, then the sgn(x) is -1 when x<0, 1 when x>0, and 0 when x=0. I wrote a SAS/IML module that contains a compact little expression: proc iml; start

Rick Wicklin 3
An easy way to specify dates and times

Dates and times. As Wayne Finley states in his SUGI25 paper on SAS date and time handling, "The SAS system provides a plethora of methods to handle date and time values." Along with the plethora of methods is a plethora of papers on the topic. If you want to trick

1 16 17 18 19 20 22