IBM AS/400 ユーザーズマニュアル

ページ / 489
 
Spooling
 
 
¹
If a program sharing an open data path for an externally described file tries to
use a record format that the first program ignored
¹
If a program sharing an open data path for a program described file specifies a
record length that exceeds the length established by the first open.
When several files in one program are overridden to one shared file at run time, the
file opening order is important. In order to control the file opening order, you should
use a programmer-controlled open or use a CL program to open the files before
calling the program.
If a program shares the open data path for a primary or secondary file, the program
must process the detail calculations for the record being processed before calling
another program that shares that open data path. Otherwise, if lookahead is used
or if the call is at total time, sharing the open data path for a primary or secondary
file may cause the called program to read data from the wrong record in the file.
You must make sure that when the shared file is opened for the first time, all of the
open options that are required for subsequent opens of the file are specified. If the
open options specified for subsequent opens of a shared file are not included in
those specified for the first open of a shared file, an error message is sent to the
program.
Table 18 details the system open options allowed for each of the open options you
can specify.
For additional information about sharing an open data path, see the 
DB2 UDB for
AS/400 Database Programming manual. ILE Concepts also contains information
about sharing open data paths and activation group versus job level scope.
Table  18.  System Open Options Allowed with User Open Options
RPG User
Open Options
System
Open Options
INPUT
INPUT
OUTPUT
OUTPUT (program created file)
UPDATE
INPUT, UPDATE, DELETE
ADD
OUTPUT (existing file)
 Spooling
Spooling is a system function that puts data into a storage area to wait for proc-
essing. The AS/400 system provides for the use of input and output spooling func-
tions. Each AS/400 file description contains a spool attribute that determines
whether spooling is used for the file at run time. The RPG program is not aware
that spooling is being used. The actual physical device from which a file is read or
to which a file is written is determined by the spool reader or the spool writer. For
more detailed information on spooling, see the 
Data Management manual.
278
ILE RPG for AS/400 Programmer's Guide