Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
– Object operational (*OBJOPR)<br />
– Add (*ADD)<br />
– Update (*UPD)<br />
Copying records into files that use trigger programs<br />
Selecting members to copy<br />
88 <strong>File</strong> <strong>Management</strong> V4R5<br />
A trigger program is a program that contains a set of trigger actions. A trigger<br />
action is a set of actions (high-level language statements, SQL statements, or<br />
AS/400 utilities) that are performed automatically when a specified change<br />
operation (trigger event) occurs on a specified table or file. For more information<br />
on triggers and trigger programs, see the Triggers section of the Database<br />
Programming book.<br />
If records are copied to a physical file that has an *INSERT trigger program<br />
associated with it, the trigger program is called each time a record is copied to the<br />
file. The trigger program is not called if deleted records are copied. If an error<br />
occurs while the trigger program is running, the copy operation fails. However,<br />
records that were successfully copied before the error occurred remain in the<br />
to-file.<br />
If a from-file has a trigger program associated with it, the CPYF and<br />
CPYFRMQRYF commands do not copy the trigger information to the to-file when<br />
the CRTFILE parameter is used.<br />
AS/400 gives you several options for copying file members:<br />
v “Copying all members or labels within a file” on page 89<br />
v “Copying only certain members or labels within a file” on page 90<br />
“Copying file members: overview” gives an explanation of how the system handles<br />
this process.<br />
For more information:<br />
For more details, see the following topics:<br />
v “Specifying the label identifier or member name for the copy operation” on<br />
page 90<br />
v “Special considerations for the Override Database <strong>File</strong> (OVRDBF), Override<br />
Diskette <strong>File</strong> (OVRDKTF), and Override Tape <strong>File</strong> (OVRTAPF) commands” on<br />
page 91<br />
Copying file members: overview<br />
You can copy multiple database members or diskette labels to corresponding<br />
like-named to-file members or labels. They can also be copied and concatenated,<br />
one after another, into a single to-file member or label. If the to-file is a spooled<br />
file, then the copy command copies each member or label to a separate spooled<br />
file. If TOFILE(*PRINT) is specified, then all the members/labels are copied to a<br />
single spooled file, with the records for each member/label starting on a new page.<br />
A single member or label, or multiple members or labels, can be copied to<br />
corresponding like-named to-file members or labels by specifying