CRE Programmer's Guide
CRE Service Functions
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
6-18
CRE_File_Open_
°
An EDIT file if your program’s main routine is written in C/C++, pTAL, or
TAL, or if your program’s main routine is written in COBOL or FORTRAN
and does not specify that it is to run as a process pair.
°
An entry-sequenced file if your program’s main routine is written in COBOL
or FORTRAN and specifies that it is to run as a process pair (regardless of
whether your program is currently running as a process pair).
•
Spooler collectors
You can specify a spooler collector as the external file for either standard output or
standard log.
Although you specify a spooler collector, the CRE does not call the SPOOLSTART
system procedure during CRE_File_Open_. Your program can call
CRE_Spool_Start_ to establish parameters to the spooler collector (for example,
the number of copies you want printed, or the location at which to print your listing)
after you call CRE_File_Open_ but before you initiate any other CRE I/O function.
If your program specifies a spooler collector for output but does not call
CRE_Spool_Start_ before its first call to a CRE I/O function, the CRE calls
SPOOLSTART if it determines that it needs to do so (for example, if you have
specified buffered spooling but have not called CRE_Spool_Start_ or if you
specified CRE^Undecided^spooling).
If the file referenced by
file_ordinal is a spooler collector, the flags
parameter specifies the type of spooling you want. You can use the following
literals when you call CRE_File_Open_. (The literals are declared in the
CREDECS file.)
The following example shows a call to CRE_File_Open_ that specifies a spooling
literal.
CALL CRE_File_Open_(file_no, CRE^Buffered^spooling,... );
°
Simple Spooling
If you specify CRE^Simple^spooling, the CRE does not allocate a buffer for
spooling and writes output directly to the spooler collector by calling the
WRITEX system procedure. Your program uses level-1 spooling unless it calls
CRE_Spool_Start_, in which case it uses level-2 spooling.
°
Buffered Spooling
If you specify CRE^Buffered^spooling, the call to CRE_File_Open_ fails if:
°
file_ordinal specifies standard log.
Spooling Type Meaning
CRE^Simple^spooling
Unbuffered spooling (level-1 or level-2 spooling)
CRE^Undecided^spooling
Spooling type determined by the CRE
CRE^Buffered^spooling
Buffered spooling (level-3 spooling)