SAS Stored Processes
Debugging Stored ProcessesThere are two techniques for debugging stored processes: Examining the SAS LogThe client interfaces provided to stored processes usually include a mechanism for retrieving the SAS log from a stored process. For example, passing an input parameter _DEBUG=LOG to the SAS Stored Process Web Application causes the SAS log to be returned with the stored process output. The SAS log is directly accessible from the Stored Process Service API. Assuming your installation is configured correctly, most run-time stored process errors will appear in the SAS log. If you are unable to access the SAS log from the client interface, you might be able to access the SAS log from the server log files. The server administrator controls the level of server logging enabled and the location of the server log files. Server log options vary depending on the server type. The stored process server enables you to capture the SAS log for each stored process in the server log with the APPLEVEL option. The APPLEVEL option can be specified in the Object Server Parameters field in the Server Manager definition for the server in SAS Management Console. The following table describes the supported values for the APPLEVEL option:
The workspace server also supports the APPLEVEL option, but does not log the same information. The logging behavior in the previous table is supported only by the stored process server. Client-side access is generally recommended for the SAS log. The IOMLEVEL=2 option can be enabled in cases where debugging must be performed from server logs, but this option is not recommended for production servers. The log output with this option is very verbose and might affect server performance. Using SAS OptionsThere are several SAS options that can help you debug problems in your stored processes. 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 stored process that contains macro code, you should supply one or more of these options at the beginning of your stored process: MPRINT, SYMBOLGEN, MLOGIC, MERROR. If, for security reasons, you have disabled the display of submitted source code in your stored process 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 finished debugging, you can revert to using NOSOURCE if your security model requires it. |