Monday, 5 October 2009

NOTE: The DATA Step Debugger

While the IT world moves from hand-typed code to visually-created, drag-and-drop code, beneath the covers there usually lurks machine-generated code that we can all recognise. And, while we await the nirvana of a visual-coding tool that offers all the power and flexibility of hand-cranked code (don't hold your breath!) we still need to create what SAS DI Studio calls User-Written Code Nodes. In other words, as I said in my recent DI Studio in V9.2 post, DI Studio is a great tool and it becomes greater with every new release, but we're still some years away from that day when we don't need to write any code ourselves.

In the meantime, we need to continue writing code, testing code, and debugging code. A key tool for use when debugging DATA steps is the DATA step debugger (DSD). I mentioned it in my 2001 paper "Debugging Made Easy Easier". I recommended that SAS programmers be on intimate terms with the DSD! At the time, my suggestion was to read Dave Riba's paper from SUGI25 - “How to Use the Data Step Debugger”.

This week I noticed a more recent paper by Russ Lavery - "An Animated Guide: The SAS® Data Step Debugger" presented at SGF 2007. Russ offers a very accessible, easily understandable and well-illustrated guide to using the DSD. Highly recommended.

DSD helps you understand the detail of what SAS does (and when) within the DATA step - you feel like you can see inside the SAS's head. It's a real education!
 
DSD is almost exclusively an interactive tool, but it can be used in batch. Dave Riba tells you how in his aforementioned paper. However, I've never found a satisfactory use for it in practice.
 
I'm conscious that this post hasn't offered any new information, it's merely pointed you to a number of existing materials that were produced in past years. I'm happy to do that; I'm happy to avoid repeating good information that's held elsewhere (and avoid plagiarism and claiming the information as my own!!); I'm happy to provide a channel that makes SAS practitioners aware of this excellent material. I hope you agree that this, and other similar styled posts, have value. Share your thoughts with a comment...

[Yes, I know DI Studio is actually called DI Server these days, but spare me a thought - I've only just got used to calling it DI Studio rather than Warehouse Administrator]