The DO Loop
Statistical programming in SAS with an emphasis on SAS/IML programs![Catch run-time errors in SAS/IML programs](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
Did you know that a SAS/IML function can recover from a run-time error? You can specify how to handle run-time errors by using a programming technique that is similar to the modern "try-catch" technique, although the SAS/IML technique is an older implementation. Preventing errors versus handling errors In general, SAS/IML
![A tip for debugging SAS/IML modules: The PAUSE statement The PAUSE statement as a debugging tool in SAS/IML Studio](https://blogs.sas.com/content/iml/files/2017/11/pause3-496x336.png)
Debugging is the bane of every programmer. SAS supports a DATA step debugger, but that debugger can't be used for debugging SAS/IML programs. In lieu of a formal debugger, many SAS/IML programmers resort to inserting multiple PRINT statements into a function definition. However, there is an easier way to query
![How to format rows of a table in SAS](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
A SAS programmer wanted to display a table in which the rows have different formats. An example is shown below. The programmer wanted columns that represent statistics and rows that represent variables. She wanted to display formats (such as DOLLAR) for some variables—but only for certain statistics. For example, the
![What is a factoid in SAS?](https://blogs.sas.com/content/iml/files/2017/01/ProgrammingTips-2.png)
Have you ever seen the "Fit Summary" table from PROC LOESS, as shown to the right? Or maybe you've seen the "Model Information" table that is displayed by some SAS analytical procedures? These tables provide brief interesting facts about a statistical procedure, hence they are called factoids. In SAS, a
![Evaluate a function by using the function name in SAS/IML](https://blogs.sas.com/content/iml/files/2017/11/evalfunc.png)
A SAS/IML programmer asked whether you can pass the name of a function as an argument to a SAS/IML module and have the module call the function that is passed in. The answer is "yes." The basic idea is to create a string that represents the function call and then
![A SAS programming technique to modify ODS templates](https://blogs.sas.com/content/iml/files/2017/10/KuhfeldTMT2-640x336.png)
This article demonstrates a SAS programming technique that I call Kuhfeld's template modification technique. The technique enables you to dynamically modify an ODS template and immediately call the modified template to produce a new graph or table. By following the five steps in this article, you can implement the technique