CRE Programmer's Guide
CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
2-51
Using ARMTRAP
See the Guardian Programmer’s Guide for more information on establishing the 
debugger program for your process.
•
If the TNS CRE cannot write a diagnostic message to standard log, but it can write 
to your home terminal, it writes message 61, “Standard log file error (
error),” to 
your home terminal. 
error appears only if the TNS CRE has an error number it 
can report. See message 61 in Section 10, Run-Time Diagnostic Messages
, for 
more details.
•
If the standard log is available, the TNS CRE writes a stack trace that shows the 
user routine in which the error occurred as the top element on the stack. If the error 
occurred in a run-time library, in the TNS CRE, or in a system procedure, the top 
element of the stack trace is the user routine that invoked the routine in its run-time 
library, in the TNS CRE, or in the operating system.
•
The TNS CRE calls CRE_Terminator_ to bring your program to a smooth stop.
Using ARMTRAP
If your program invokes the ARMTRAP system procedure, it will receive notification of 
all traps, regardless of the language of the routine that was executing when the trap 
occurred. After your program has called ARMTRAP, ARMTRAP must handle all traps. 
It cannot handle traps for a portion of your program and then return trap handling to the 
TNS CRE. For this reason, do not invoke the ARMTRAP system procedure.
Writing Messages to Standard Log
The CRE writes all messages to standard log, regardless of the language of the routine 
that caused the message to be written or how many languages are represented in your 
program.
The CRE writes most of the messages that appear in standard log on behalf of run-
time libraries that support the routines in your process. For example, the TNS CRE 
writes COBOL messages only as a result of requests it receives from run-time 
libraries—typically the COBOL run-time library—to do so. The TNS CRE does not write 
COBOL messages because of errors it detects during its own processing.
Any routine in your process has the ability to send a request to the CRE to write a 
message to the log file. In general, however, messages identified as COBOL 
messages are written in response to requests from the COBOL run-time library, and so 
forth.
Note. When the CRE prints a stack trace, it scans from the top of the stack toward the bottom 
of the stack, skipping entries on the top of the stack until it encounters a routine name that 
does not end in an underscore. The top of the stack trace begins with the first procedure 
whose name does not end in an underscore. Therefore, if you create a routine whose name 
ends in an underscore and you call a system procedure from your routine, a stack trace will not 
include your routine. Therefore, do not create routines whose names end in an underscore. 










