|
On Tue, 2 Jul 2002, Mangavalli, Ramanujam wrote: > > Well, if the program is in debug mode, I want to send certain messages into > the job log. Say some kind of performance information/SQL Statements/etc... > This is what I use the /if defined, /if not defined, etc compiler directives are for. You can include code that is compiled into the program based on whether certain symbols are defined. For example, let's say you had a subprocedure called "Log" that you wanted to call only when you are debugging a program. You could put: c/if defined(EXTRA_LOGGING) c callp Log('SQL statement: ' + SqlStmt) c/endif into your RPG source, and then when you want to debug the program you'd compile it like this: CRTBNDRPG MYPGM DEFINE(EXTRA_LOGGING) but, when you compile it for use in production, you'd omit the "DEFINE(EXTRA_LOGGING)" so that the compiler would ignore those statements.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.