File Management - IBM
File Management - IBM File Management - IBM
| | | | | | | | | | | | | | | | | | | | object. This is true unless the user is a member of a group profile and has OWNER(*GRPPRF) specified for the profile. If you specify OWNER(*GRPPRF), the group profile becomes the owner of the to-file. In this case, if the user profile running the copy command does not have authority to add a member or write data to the new file, the copy command fails. The created to-file does not maintain the file capabilities of the from-file. The to-file allows update, delete, read, and write operations, regardless of whether the from-file allowed these operations. Following are special considerations for the new to-file: v If the number of records copied into a member is greater than the maximum size of the created to-file, the to-file is extended without intervention by the system operator. v If the from-file is an SQL table, view, or index, the created to-file will be a physical file that is not an SQL table. However, when the from-file contains LOBs, datalinks, or user-defined types, the created to-file is an SQL table. v If the from-file has a trigger program associated with it, the CPYF and CPYFRMQRYF commands do not copy the trigger information to the to-file when the CRTFILE parameter is used. v If you create a new file (CRTFILE(*YES)) from a file with constraints, the constraint definitions do not copy to the new file. v If you create a new file (CRTFILE(*YES)) from a file with user-defined functions, the user-defined functions do not copy to the new file. Adding, replacing, and updating records (MBROPT parameter) 84 File Management V4R5 On the CPYF, CPYFRMDKT, CPYFRMQRYF, CPYFRMTAP, or CPYSRCF commands, you can add or replace existing data in the to-file by specifying different attributes on the MBROPT parameter. The CPYF command also allows you to update duplicate key records and add non-duplicate key records to a to-file member. You can do these tasks by specifying *REPLACE, specifying *ADD, or specifying *UPDATE on the MBROPT parameter (see page Specifying *REPLACE when copying files). Specifying *REPLACE when copying files By specifying *REPLACE, you essentially clear the member. The copied records are the only records in the member when the operation completes. You must have authority to clear the member in order to specify MBROPT(*REPLACE). For copy commands other than the CPYFRMQRYF command, when you specify *REPLACE, copy command processing fails if the from-file does not contain any records. When you specify *REPLACE on the CPYFRMQRYF command, the to-file member will be cleared even if the open query file contains no records. *REPLACE is the default value for the CPYSRCF command. All other copy commands have the default value of *NONE; however, *NONE is valid only for copying to a device file.
| | | | | | | | | | | | Relative Record Number 1 2 3 4 1 2 3 4 5 6 7 1 2 3 Specifying *ADD when copying files File A ....... ........ ....... .... File B ......... ........ ....... ....... ....... ..... ...... File C ...... ........ ........ When you specify *ADD, each record copied is added to the end of the existing records in the member. It is important to note that this is always true, even for keyed files. However, with keyed files, the added records appear to be merged in key sequence when accessed through a keyed access path. When copying from query files, the relative record numbers of the resulting file may not correspond to those in the original file. When *ADD is specified, the copy completes normally even if the from-file contains no records. When three files are copied with MBROPT(*ADD) to a database file that is not keyed, the resulting to-file would look like Figure 13. Relative Record Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Figure 13. Result of Copies with MBROPT(*ADD) Specified To-File Member File A File B File C RV2H078-0 Chapter 4. Copying files 85
- Page 44 and 45: 34 File Management V4R5 Handling ov
- Page 46 and 47: 36 File Management V4R5 output queu
- Page 48 and 49: 38 File Management V4R5 The followi
- Page 50 and 51: 40 File Management V4R5 application
- Page 52 and 53: 42 File Management V4R5 activation
- Page 54 and 55: Program A (in user default activati
- Page 56 and 57: 46 File Management V4R5 Override 1
- Page 58 and 59: 48 File Management V4R5 same call l
- Page 60 and 61: 50 File Management V4R5 Program A .
- Page 62 and 63: 52 File Management V4R5 Applying OV
- Page 64 and 65: Deleting overrides 54 File Manageme
- Page 66 and 67: Program A (in user default activati
- Page 68 and 69: 58 File Management V4R5 Displaying
- Page 70 and 71: 60 File Management V4R5 Command 7 d
- Page 72 and 73: 62 File Management V4R5 Display All
- Page 74 and 75: Redirecting files 64 File Managemen
- Page 76 and 77: 66 File Management V4R5 Default act
- Page 78 and 79: 68 File Management V4R5 From Databa
- Page 80 and 81: Copying files: overview 70 File Man
- Page 82 and 83: 72 File Management V4R5 Table 9. Co
- Page 84 and 85: Table 10. Summary of Copy Functions
- Page 86 and 87: 76 File Management V4R5 Copying fil
- Page 88 and 89: Resending copy file completion mess
- Page 90 and 91: 80 File Management V4R5 from-file m
- Page 92 and 93: CPYSRCF command support for CCSIDs
- Page 96 and 97: | | | | | | | | | | | | | | | | 86
- Page 98 and 99: | | | | | | | | | | | | | | | | | |
- Page 100 and 101: 90 File Management V4R5 Copying onl
- Page 102 and 103: Selecting the records to copy 92 Fi
- Page 104 and 105: 94 File Management V4R5 Selecting r
- Page 106 and 107: 96 File Management V4R5 Example: bu
- Page 108 and 109: 98 File Management V4R5 When you sp
- Page 110 and 111: 100 File Management V4R5 A field na
- Page 112 and 113: 102 File Management V4R5 v “Null-
- Page 114 and 115: 104 File Management V4R5 - INCCHAR(
- Page 116 and 117: When you specify PRINT(*EXCLD), the
- Page 118 and 119: Note: It is possible for files with
- Page 120 and 121: 110 File Management V4R5 Variable-L
- Page 122 and 123: Table 14 on page 112 outlines the c
- Page 124 and 125: 114 File Management V4R5 in the cur
- Page 126 and 127: 116 File Management V4R5 (including
- Page 128 and 129: | | | | | | | | | | | | | | | | | |
- Page 130 and 131: | | | | | | | | | | | | | | | | | |
- Page 132 and 133: Preventing errors when copying file
- Page 134 and 135: elationship. However, the copy oper
- Page 136 and 137: Preventing allocation errors when c
- Page 138 and 139: 128 File Management V4R5 - A depend
- Page 140 and 141: Year 2000 support: date, time, and
- Page 142 and 143: FLD TYPE DATFMT SPECIFIED FIELD LEN
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
|<br />
Relative<br />
Record<br />
Number<br />
1<br />
2<br />
3<br />
4<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
1<br />
2<br />
3<br />
Specifying *ADD when copying files<br />
<strong>File</strong> A<br />
.......<br />
........<br />
.......<br />
....<br />
<strong>File</strong> B<br />
.........<br />
........<br />
.......<br />
.......<br />
.......<br />
.....<br />
......<br />
<strong>File</strong> C<br />
......<br />
........<br />
........<br />
When you specify *ADD, each record copied is added to the end of the existing<br />
records in the member. It is important to note that this is always true, even for<br />
keyed files. However, with keyed files, the added records appear to be merged in<br />
key sequence when accessed through a keyed access path. When copying from<br />
query files, the relative record numbers of the resulting file may not correspond to<br />
those in the original file.<br />
When *ADD is specified, the copy completes normally even if the from-file<br />
contains no records.<br />
When three files are copied with MBROPT(*ADD) to a database file that is not<br />
keyed, the resulting to-file would look like Figure 13.<br />
Relative<br />
Record<br />
Number<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10<br />
11<br />
12<br />
13<br />
14<br />
Figure 13. Result of Copies with MBROPT(*ADD) Specified<br />
To-<strong>File</strong> Member<br />
<strong>File</strong> A<br />
<strong>File</strong> B<br />
<strong>File</strong> C<br />
RV2H078-0<br />
Chapter 4. Copying files 85