Contents SAS/IntrNet 8.2: Application Dispatcher Previous Next

Debugging in the Program Component

There are four techniques for debugging Dispatcher programs:


Examining the SAS Log

Passing a name/value pair of _DEBUG=128 to the Dispatcher will cause the SAS log to be returned to the Web browser. This is useful because you will be able to check for errors, which typically show up in the log. The Dispatcher will highlight them in red. If the code that you are debugging contains macro statements, turn on various options such as MPRINT and MLOGIC. Sometimes the Dispatcher will return an error message that suggests to send a debug value of 131. This is the values 1, 2, and 128 combined. See the List of Valid Debug Values section for a complete list of debug values.

If you are unable to retrieve the SAS log with _DEBUG=128, then you should contact your Application Server administrator. The administrator may need to examine the SAS log file that the Application Server writes to disk. This file can often contain more information than is displayed in your browser.

Using SAS Options

There are several SAS options that can help you debug problems in your Dispatcher programs. If you can return the SAS log to your browser, activating some of these options can make that log more useful. If you are debugging a program that contains macro code, you should supply one or more of these options at the beginning of your program: MPRINT, SYMBOLGEN, MLOGIC, MERROR.

If, for security reasons, you have disabled the display of submitted source code in your program using the NOSOURCE option when you are debugging, you should enable this feature by supplying the SOURCE option. You can then see your submitted SAS code in the log that is returned to your browser. After you are done, you can revert to using NOSOURCE if your security model requires it.

The DATA Step Debugger

To use the DATA step debugger, you must start the Application Server in full-screen mode, and you must be working on the computer where SAS software will display the debugger windows. To debug a DATA step, add /debug to the DATA statement, like this:

   data mylib.mydata/debug;

When the Server executes the program, the DATA step debugger windows will pop up and pause, waiting for you to step through the code.

The SCL Debugger

To use the SCL debugger, you must start the Application Server with the AFPARMS='debug=yes' option. The SCL program that you want to debug must be compiled with the debug option. The Application Server must be in full-screen mode, and you must be working on the computer where SAS software will display the debugger windows. When the Server executes the SCL program, the debugger windows will appear and allow you to step through the code.


Contents SAS/IntrNet 8.2: Application Dispatcher Previous Next