CRE Programmer's Guide

CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
2-36
Using a Spooler Collector
$RECEIVE, the CRE will not be able to open $RECEIVE because it requires exclusive
access.
To access $RECEIVE, a COBOL or FORTRAN run-time library function, or C/C++,
TAL, or pTAL routine opens $RECEIVE by calling CRE_Receive_Open_Close_ with
the open variant. The run-time library function or other-language routine reads
messages from $RECEIVE by calling CRE_Receive_Read_ and replies to messages
from $RECEIVE by calling CRE_Receive_Write_.
Using System Procedures to Access $RECEIVE
Routines written in any of the languages supported by the CRE can access $RECEIVE
by calling system procedures directly. All HP languages include syntax to call system
procedures. To manage $RECEIVE, routines open it by calling the FILE_OPEN_
system procedure. Routines read and reply to messages from $RECEIVE using the
READUPDATEX and REPLYX system procedures. If you access $RECEIVE using
system procedures, do not use language features that access $RECEIVE for you.
Using a Spooler Collector
You can specify a spooler collector as the device for either standard output or standard
log. The following considerations apply to using spooling with the CRE:
The CRE uses buffered (level-3) spooling for standard output unless you specify
unbuffered spooling.
You cannot use buffered spooling for standard log. (If you did, you might lose
messages if your program terminates abnormally—precisely the case for which
you want to see the last messages written to standard log.)
CRE_File_Open_ does not invoke CRE_Spool_Start_ or the SPOOLSTART
system procedure. However, CRE_File_Output_ invokes CRE_Spool_Start_ if
CRE_File_Open_ opens a file that is a spooler collector.
A TAL routine only needs to call CRE_Spool_Start_ explicitly to specify parameters
to CRE_Spool_Start_ that are not the default parameters. For example,
CRE_Spool_Start_ writes one copy of the specified file to the spooler collector. If
your program requires more than one copy of the output, call CRE_Spool_Start_
after you call CRE_File_Open_ and specify the
number_of_copies parameter.
In the Guardian environment, the CRE performs the tasks described in this subsection.
In the OSS environment, the CRE does not support any of the tasks described in this
subsection because the CRE provides spooling features only to support standard files
and it does not support standard files in the OSS environment.
For more details, see CRE_Spool_Start_
on page 6-27.