Deferred update feature: Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
(51 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==Overview==
==Overview==
<p>Whenever you change or add a large number of records to a <var class="product">Model&nbsp;204</var> file, the process can be made more efficient, in terms of execution time, disk I/O, and storage utilization, by deferring the changes or additions that update Tables C and D: updates involving KEY, NUMERIC RANGE, ORDERED, and FRV fields. In the <var class="product">Model&nbsp;204</var> deferred update feature, the deferred updates to Tables C and D are stored in deferred update data sets while Tables A and B are updated. The deferred updates are then sorted and applied to Tables C and D.</p>
<p>
<p>This chapter describes</p>
Whenever you change or add a large number of records to a <var class="product">Model&nbsp;204</var> file, the process can be made more efficient, in terms of execution time, disk I/O, and storage utilization, by deferring the changes or additions that update Tables C and D: updates involving KEY, NUMERIC RANGE, ORDERED, and FRV fields. In the <var class="product">Model&nbsp;204</var> deferred update feature, the deferred updates to Tables C and D are stored in deferred update data sets while Tables A and B are updated. The deferred updates are then sorted and applied to Tables C and D.</p>
<p>
This article describes</p>
<ul>
<ul>
<li>Basic <var class="product">Model&nbsp;204</var> deferred update feature</li>
<li>Basic <var class="product">Model&nbsp;204</var> deferred update feature</li>
Line 7: Line 9:
<li>Several different job forms-number of job steps-that the feature can take. </li>
<li>Several different job forms-number of job steps-that the feature can take. </li>
</ul>
</ul>
<p>When a file is opened in deferred update mode, <var class="product">Model&nbsp;204</var> protects the file by making it impossible to free the file in that <var class="product">Model&nbsp;204</var> run. This limitation is necessary to protect the file from being updated before the deferred updates have been applied. All files are closed completely (free) at the end of the <var class="product">Model&nbsp;204</var> job.</p>
<p>
When a file is opened in deferred update mode, <var class="product">Model&nbsp;204</var> protects the file by making it impossible to free the file in that <var class="product">Model&nbsp;204</var> run. This limitation is necessary to protect the file from being updated before the deferred updates have been applied. All files are closed completely (free) at the end of the <var class="product">Model&nbsp;204</var> job.</p>
===<b id="defUpdtX200"></b>Deferred updates and large (FILEORG X'200') files===
<p>The <var>[[FILEORG parameter|FILEORG]]</var> parameter X'200' setting supports large files, allowing files to hold up to <var>[[FILEORG parameter#large_files|48M records]]</var>.</p>
<p>
The deferred index update feature was implemented well before the existence of <var>FILEORG</var> X'200' files, when the maximum number of records possible in a file was 16M. At that time, only three bytes were required to represent record numbers up to 16M - 1, so the format of the deferred index update records optimized record numbers to three bytes. However, if using <var>FILEORG</var> X'200' files, an extra byte is required to represent the record numbers for deferred index updates.
</p>
<p>
This means that when converting a file to <var>FILEORG</var> X'200', you might need to modify reorg jobs to accommodate the longer record numbers. Fortunately, most such changes should work with non-<var>FILEORG</var> X'200' files if common infrastructure is used for files that are a mix of <var>FILEORG</var> X'200' and non-<var>FILEORG</var> X'200'. The rest of this page indicates where values need to be adjusted for <var>FILEORG</var> X'200' files.
</p>
 
===Deferred update phases===
===Deferred update phases===
<p>The two phases of Table updating in a <var class="product">Model&nbsp;204</var> file during the deferred update process are:</p>
<p>
The two phases of Table updating in a <var class="product">Model&nbsp;204</var> file during the deferred update process are:</p>
<ul>
<ul>
<li>Loading Tables A and B and loading the index (Tables C and D) updates into the deferred update data sets</li>
<li>Loading Tables A and B and loading the index (Tables C and D) updates into the deferred update data sets</li>
<li>Loading the deferred index updates into Tables C and D</li>
<li>Loading the deferred index updates into Tables C and D</li>
</ul>
</ul>
===First phase of deferred update===
===First phase of deferred update===
<p>The first phase of the deferred update process involves executing whatever configuration of <var class="product">Model&nbsp;204</var> would be run if updates to the index were not being deferred: BATCH204, ONLINE, IFAM1, or IFAM4. Storing new records or changing existing records proceeds normally until the <var class="product">Model&nbsp;204</var> file is put into deferred update mode by a special form of the OPEN command or the IFOPEN call. Thereafter, only Table A, the internal file dictionary, and Table B, the VISIBLE data, of the file are updated. </p>
<p>
<p>The index information pertaining to FOR EACH VALUE (FRV), KEY, NUMERIC RANGE, and ORDERED retrieval fields is not added directly to Table C and Table D. Instead, it is written to one or two deferred update data sets for processing in later job steps. </p>
The first phase of the deferred update process involves executing whatever configuration of <var class="product">Model&nbsp;204</var> would be run if updates to the index were not being deferred: BATCH204, ONLINE, IFAM1, or IFAM4. Storing new records or changing existing records proceeds normally until the <var class="product">Model&nbsp;204</var> file is put into deferred update mode by a special form of the <var>OPEN</var> command or the <var>IFOPEN</var> call. Thereafter, only Table A, the internal file dictionary, and Table B, the <var>VISIBLE</var> data, of the file are updated. </p>
<p class="note"><b>Note:</b> The index update generated by a FILE RECORDS UNDER statement is never deferred.</p>
<p>
<b>Query results between deferred update phases</b>
The index information pertaining to <var>FOR EACH VALUE</var> (<var>FRV</var>), <var>KEY</var>, <var>NUMERIC RANGE</var>, and <var>ORDERED</var> retrieval fields is not added directly to Table C and Table D. Instead, it is written to one or two deferred update data sets for processing in later job steps. </p>
<p>For example, suppose that you add the field name = value pair NAME = MURRAY to an existing record in file PEOPLE. PEOPLE is in deferred update mode, and the NAME field is KEY and VISIBLE. If the record is retrieved by some other (preexisting) KEY field, a PRINT NAME statement prints MURRAY, because the field is VISIBLE and is, therefore, stored in Table B. However, the statement FIND ALL RECORDS FOR WHICH NAME = MURRAY does not find the record, because the index information NAME = MURRAY has not yet been added to Tables C and D. </p>
<p class="note"><b>Note:</b> The index update generated by a <var>File Records Under</var> statement is never deferred.</p>
 
====Query results between deferred update phases====
<p>
For example, suppose that you add the field name = value pair <code>NAME=MURRAY</code> to an existing record in file <code>PEOPLE</code>. <code>PEOPLE</code> is in deferred update mode, and the <code>NAME</code> field is <var>KEY</var> and <var>VISIBLE</var>. </p>
<p>
If the record is retrieved by some other (preexisting) <var>KEY</var> field, a <code>Print NAME</code> statement prints <code>MURRAY</code>, because the field is <var>VISIBLE</var> and is, therefore, stored in Table B. However, the statement <code>FIND ALL RECORDS FOR WHICH NAME = MURRAY</code> does not find the record, because the index information <code>NAME=MURRAY</code> has not yet been added to Tables C and D. </p>
===Second phase of deferred update===
===Second phase of deferred update===
<p>The second phase of the deferred update process is executed only after the first phase of deferred update process is complete. The second phase of the deferred update process sorts each of the deferred update data sets created in the first phase, then applies the updates to Tables C and D.</p>
<p>
<p>Applying the sorted updates from the deferred update data sets adds the information necessary to perform retrievals based on the new KEY, NUMERIC RANGE, and ORDERED retrieval field values. For instance, after applying the deferred updates, the retrieval statement FIND ALL RECORDS FOR WHICH NAME = MURRAY finds the record in the previous example.  </p>
The second phase of the deferred update process is executed only after the first phase of deferred update process is complete. The second phase of the deferred update process sorts each of the deferred update data sets created in the first phase, then applies the updates to Tables C and D.</p>
<b>Additional job steps in a deferred update</b>
<p>
<p>If the file contains FRV (FOR EACH VALUE) fields, applying the deferred index updates to Tables C and D generates an additional deferred update data set. This additional deferred update data set contains more deferred index updates for fields with the FRV (for-each-value) attribute, which must also be sorted, and the sorted deferred updates applied to Tables C and D.  </p>
Applying the sorted updates from the deferred update data sets adds the information necessary to perform retrievals based on the new <var>KEY</var>, <var>NUMERIC RANGE</var>, and <var>ORDERED</var> retrieval field values. For instance, after applying the deferred updates, the retrieval statement <code>FIND ALL RECORDS FOR WHICH NAME = MURRAY</code> finds the record in the previous example.  </p>
<p>For example, suppose that the NAME field described previously also has the FRV attribute and that MURRAY is a new value of NAME that has never occurred in any record. The statement FOR EACH VALUE OF NAME does not find the value MURRAY until certain information is added to Tables C and D. This information is contained in the additional deferred update data set.</p>
 
<p>The procedure for deferring updates to the index normally requires multiple job steps instead of the one job step required if the updates are not deferred. The deferred update feature can use three, five, or seven job steps, depending on the attributes of the fields being deferred and the number of deferred update data sets specified on the OPEN command or the IFOPEN call. The specific job steps required for deferred update processing are described in detail in the section [[#Job steps|Job steps]].     </p>
====Additional job steps in a deferred update====
<p>
If the file contains <var>FRV</var> (<var>FOR EACH VALUE</var>) fields, applying the deferred index updates to Tables C and D generates an additional deferred update data set. This additional deferred update data set contains more deferred index updates for fields with the <var>FRV</var> attribute, which must also be sorted, and the sorted deferred updates applied to Tables C and D.  </p>
<p>
For example, suppose that the <code>NAME</code> field described previously also has the <var>FRV</var> attribute and that <code>MURRAY</code> is a new value of <code>NAME</code> that has never occurred in any record. The statement <code>For Each Value of NAME</code> does not find the value <code>MURRAY</code> until certain information is added to Tables C and D. This information is contained in the additional deferred update data set.</p>
<p>
The procedure for deferring updates to the index normally requires multiple job steps instead of the one job step required if the updates are not deferred. The deferred update feature can use three, five, or seven job steps, depending on the attributes of the fields being deferred and the number of deferred update data sets specified on the <var>OPEN</var> command or the <var>IFOPEN</var> call. The specific job steps required for deferred update processing are described in detail in the section [[#Job steps|Job steps]]. </p>


==Opening deferred update files==
==Opening deferred update files==
===Types of deferred update data sets===
===Types of deferred update data sets===
<p>There are two forms of deferred update data sets. The OPEN command that places the file in deferred update mode and the attributes of the fields being updated determine whether a fixed-length data set, a variable-length data set, or both are used for the deferred updates.  </p>
<p>
There are two forms of deferred update data sets. The OPEN command that places the file in deferred update mode and the attributes of the fields being updated determine whether a fixed-length data set, a variable-length data set, or both are used for the deferred updates.  </p>
===Deferred update OPEN syntax===
===Deferred update OPEN syntax===
<b>Function</b>
<p>
<p>The OPEN command and the IFOPEN Host Language Interface function have special forms that place the file being opened into deferred update mode. In these forms, you can specify one or two deferred update data sets. </p>
The <var>OPEN</var> command and the <var>IFOPEN</var> [[Host Language Interface (HLI)|Host Language Interface]] function have special forms that place the file being opened into deferred update mode. In these forms, you can specify one or two deferred update data sets. </p>
<p>The OPEN command syntax in this case is: </p>
<p>
<b>Syntax</b>
The <var>OPEN</var> command syntax in this case is: </p>
<p class="code">OPEN [FILE] <var class="term">filename</var>,{[<var class="term">dsname1</var>][,<var class="term">dsname2</var>]}
 
<p class="syntax">OPEN [FILE] <span class="term">filename</span>,{[<span class="term">dsname1</span>][,<span class="term">dsname2</span>]}
</p>
</p>
<p>where:</p>
<p>
<p><var class="term">filename</var> is the name of the <var class="product">Model&nbsp;204</var> file to be opened.</p>
Where:</p>
<p><var class="term">dsname1</var> is the name of the fixed-length deferred update data set. If <var class="term">dsname1</var> is supplied in the OPEN command, deferred updates to KEY and NUMERIC RANGE fields are written to this data set.</p>
<ul>
<p><var class="term">dsname2</var> is the name of the variable-length deferred update data set. If <i>dsname2</i> is supplied in the OPEN command, deferred updates to ORDERED fields are written to this data set. If only <var class="term">dsname2</var> is supplied in the OPEN command, all index updates are written to this data set. If <var class="term">dsname2</var> is not supplied in the OPEN command, updates to ORDERED fields are not deferred.     </p>
<li><var class="term">filename</var> is the name of the <var class="product">Model&nbsp;204</var> file to be opened.</li>
 
<li><var class="term">dsname1</var> is the name of the fixed-length deferred update data set. If <var class="term">dsname1</var> is supplied in the <var>OPEN</var> command, deferred updates to <var>KEY</var> and <var>NUMERIC RANGE</var> fields are written to this data set.</li>
 
<li><var class="term">dsname2</var> is the name of the variable-length deferred update data set. If <var class="term">dsname2</var> is supplied in the <var>OPEN</var> command, deferred updates to <var>ORDERED</var> fields are written to this data set. If only <var class="term">dsname2</var> is supplied in the <var>OPEN</var> command, all index updates are written to this data set. If <var class="term">dsname2</var> is not supplied in the <var>OPEN</var> command, updates to <var>ORDERED</var> fields are not deferred. </li>
</ul>
 
<b>Naming conventions</b>
<b>Naming conventions</b>
<p>A deferred update data set must have a name starting with the letters TAPE. It can be placed on either magnetic tape or a direct access device.</p>
<p>
<p>For example:</p>
A deferred update data set must have a name starting with the letters <code>TAPE</code>. It can be placed on magnetic tape or a direct access device.</p>
<p>
For example:</p>
<p class="code">OPEN PEOPLE,TAPEPEOP
<p class="code">OPEN PEOPLE,TAPEPEOP
</p>
</p>
<p>To which <var class="product">Model&nbsp;204</var> responds:</p>
<p>
To which <var class="product">Model&nbsp;204</var> responds:</p>
<p class="code"><b></b>*** M204.0656: UPDATES DEFERRED TO TAPEPEOP
<p class="code"><b></b>*** M204.0656: UPDATES DEFERRED TO TAPEPEOP
</p>
</p>
<b>Usage</b>
<b>Usage</b>
<p>Use the special form of OPEN only once per main step for a particular file. Subsequent ordinary OPEN commands treat the file as though the already declared deferred update data set(s) were specified.</p>
<p>
<p>The maximum number of deferred update files you can have open in a run is 192. If you try to open any more than 192 files, the OPEN fails and <var class="product">Model&nbsp;204</var> displays the following message:</p>
Use the special form of OPEN only once per main step for a particular file. Subsequent ordinary OPEN commands treat the file as though the already declared deferred update data set(s) were specified.</p>
<p>
The maximum number of deferred update files you can have open in a run is 192. If you try to open any more than 192 files, the OPEN fails and <var class="product">Model&nbsp;204</var> displays the following message:</p>
<p class="code"><b></b>*** M204.1529: MAXIMUM DEFERRED UPDATE FILES ALREADY OPEN
<p class="code"><b></b>*** M204.1529: MAXIMUM DEFERRED UPDATE FILES ALREADY OPEN
</p>
</p>
<p>See the <var class="product">Model&nbsp;204</var> Parameter and Command Reference for a complete description of the OPEN command.</p>
 
<b>Space requirements</b>
<b>Space requirements</b>
<p>The space requirements for the deferred update data sets depend on which type of data set is used and the number of KEY, NUMERIC RANGE, or ORDERED retrieval fields that have their index updates deferred during the first phase of the deferred update process.</p>
<p>
<b>Examples</b>
The space requirements for the deferred update data sets depend on which type of data set is used and the number of KEY, NUMERIC RANGE, or ORDERED retrieval fields that have their index updates deferred during the first phase of the deferred update process.</p>
<b>Example 1: Opening a deferred update file with the first data set specified</b>
<p>
In the following example, the CARS file is placed in deferred update mode by using the OPEN command with only the first update data set name, <var class="term">dsname1</var>, specified. The updates to the Ordered Index-the ORDERED fields-are not deferred. The Ordered Index updates are applied during the first phase of the deferred update process:</p>
<p class="code">OPEN CARS,TAPECARF
</p>


<b>Opening a deferred update file with the first data set specified</b>
<b>Example 2: Opening a deferred update file with the second data set specified</b>
<p>In the following example, the CARS file is placed in deferred update mode by using the OPEN command with only the first update data set name, <var class="term">dsname1</var>, specified. The updates to the Ordered Index-the ORDERED fields-are not deferred. The Ordered Index updates are applied during the first phase of the deferred update process:</p>
<p>
<p class="code">OPEN CARS,TAPECARF
In the following example, the CARS file is placed in deferred update mode by using the OPEN command with only the second update data set name, <var class="term">dsname2</var>, specified. Note the two leading commas before the data set name):</p>
<p class="code">OPEN CARS,,TAPECARV
</p>
</p>
<b>Opening a deferred update file with the second data set specified</b>
<p>
<p>In the following example, the CARS file is placed in deferred update mode by using the OPEN command with only the second update data set name, <var class="term">dsname2</var>, specified. Note the two leading commas before the data set name):</p>
The updates to KEY, NUMERIC RANGE, and ORDERED fields are all deferred to TAPECARV, a variable-length data set.</p>
<p class="code">OPEN CARS,,TAPECARV
 
</p>
<b>Example 3: Opening a deferred update file with both data sets specified</b>
<p>The updates to KEY, NUMERIC RANGE, and ORDERED fields are all deferred to TAPECARV, a variable-length data set.</p>
<p>
<b>Opening a deferred update file with both data sets specified</b>
Deferring all the updates to the variable-length data set is somewhat less efficient than splitting the updates by providing both deferred update data sets, as in the following example:</p>
<p>Deferring all the updates to the variable-length data set is somewhat less efficient than splitting the updates by providing both deferred update data sets, as in the following example:</p>
<p class="code">OPEN CARS,TAPECARF,TAPECARV
<p class="code">OPEN CARS,TAPECARF,TAPECARV
</p>
</p>
<p>The updates to KEY and NUMERIC RANGE fields are written to the fixed-length data set, TAPECARF, and the updates to ORDERED fields are written to the variable-length data set, TAPECARV.</p>
<p>
The updates to KEY and NUMERIC RANGE fields are written to the fixed-length data set, TAPECARF, and the updates to ORDERED fields are written to the variable-length data set, TAPECARV.</p>


===Active-defer in deferred update files===
===Active-defer in deferred update files===
<p>When you open a file in deferred update mode, <var class="product">Model&nbsp;204</var> places the file in active-defer mode, and the file stays in this mode for the life of the run. The file stays in this mode until the first Z step is successfully completed.</p>
<p>
<p>If the file is in active-defer mode, <var class="product">Model&nbsp;204</var> displays the following error message whenever the file is opened:</p>
When you open a file in deferred update mode, <var class="product">Model&nbsp;204</var> places the file in active-defer mode, and the file stays in this mode for the life of the run. The file stays in this mode until the first Z step is successfully completed.</p>
<p>
If the file is in active-defer mode, <var class="product">Model&nbsp;204</var> displays the following error message whenever the file is opened:</p>
<p class="code"><b></b>*** M204.0624: FILE IS IN DEFERRED UPDATE MODE
<p class="code"><b></b>*** M204.0624: FILE IS IN DEFERRED UPDATE MODE
</p>
</p>
<p>However, after the first successful Z step has been run, this message is turned off, whether or not there are still updates to be completed.</p>
<p>
However, after the first successful Z step has been run, this message is turned off, whether or not there are still updates to be completed.</p>
==Deferred updates: Phase 1==
==Deferred updates: Phase 1==
<p>The system parameter DUFILES gives the number of files that have been opened in deferred update mode in the current run.)  </p>
<p>
<p>After the file is placed in deferred update mode, updates to the file that normally update the index structures are deferred to the deferred update data set(s). These updates can be the result of User Language requests, Host Language Interface functions, or file updating commands. </p>
The system parameter DUFILES gives the number of files that have been opened in deferred update mode in the current run.)  </p>
<p>
After the file is placed in deferred update mode, updates to the file that normally update the index structures are deferred to the deferred update data set(s). These updates can be the result of User Language requests, Host Language Interface functions, or file updating commands. </p>
===Number of deferred update data sets required===
===Number of deferred update data sets required===
<p>You must specify at least one deferred update data set in the JCL or FILEDEFs for each file in deferred update mode. If updates are deferred for more than one file in the first phase step, a separate sequence of the remaining second phase steps must be run for each file opened in deferred update mode. (See the seven-, five-, and three-step process descriptions [[#Job steps|Job steps]].)</p>
<p>
You must specify at least one deferred update data set in the JCL or FILEDEFs for each file in deferred update mode. If updates are deferred for more than one file in the first phase step, a separate sequence of the remaining second phase steps must be run for each file opened in deferred update mode. (See the seven-, five-, and three-step process descriptions [[#Job steps|Job steps]].)</p>
 
==Fixed-length deferred update data sets==
==Fixed-length deferred update data sets==
<p>The fixed-length data set name corresponds to <var class="term">dsname1</var> in the OPEN command described in [[#Deferred update OPEN syntax|Deferred update OPEN syntax]]. </p>
<p>
The fixed-length data set name corresponds to <var class="term">dsname1</var> in the OPEN command described in [[#Deferred update OPEN syntax|Deferred update OPEN syntax]]. </p>
===DCB parameters for fixed-length data sets===
===DCB parameters for fixed-length data sets===
<p>The default DCB parameters for the fixed-length data sets are: </p>
<p>
The default DCB parameters for the fixed-length data sets are: </p>
<p class="code">RECFM=FB .
<p class="code">RECFM=FB .
LRECL=24 BLKSIZE=6000 .
LRECL=24 BLKSIZE=6000 .
</p>
</p>
<p>For fixed-length deferred update CMS files, the FILEDEF statement must specify "BLOCK 24" for files stored on disk. This results in a blocking factor of one and prevents errors from occurring during checkpointing.   </p>
<p>
For fixed-length deferred update CMS files, the FILEDEF statement must specify <code>BLOCK 24</code> for files stored on disk. This results in a blocking factor of one, and it prevents errors from occurring during checkpointing. </p>
<p>
For <var>FILEORG</var> X'200' files, the LRECL should be 25 and, in fact, that is the default. The default BLKSIZE works for both <var>FILEORG</var> X'200' and non-<var>FILEORG</var> X'200' files, so it is used for both. Therefore, to eliminate worries about jobs working on files with or without <var>FILEORG</var> X'200', the best approach is to <i>not</i> specify LRECL and BLKSIZE, allowing them to default.
</p>
 
===Deferred KEY and NUMERIC RANGE field space requirements===
===Deferred KEY and NUMERIC RANGE field space requirements===
<p>When the updates to KEY and NUMERIC RANGE fields are deferred to the fixed-length data set, the space requirements for the fixed-length deferred update data set are as follows:    </p>
<p>
When the updates to KEY and NUMERIC RANGE fields are deferred to the fixed-length data set, the space requirements for the fixed-length deferred update data set are as follows:    </p>
<ul>
<ul>
<li>For each occurrence of a KEY field that is added or deleted, one 24-byte record is written to the data set. A changed field counts twice; the old value is deleted and the new one is added.</li>
<li>For each occurrence of a KEY field that is added or deleted, one 24-byte record is written to the data set. A changed field counts twice; the old value is deleted and the new one is added.</li>
<li>For each occurrence of a NUMERIC RANGE retrieval field that is added or deleted, the average number of 24-byte records written is equal to:
<li>For each occurrence of a NUMERIC RANGE retrieval field that is added or deleted, the average number of 24-byte records written is equal to:
<p class="code">4 + (4.5 * the number of digits in the occurrence)  
<p class="code">4 + (4.5 * the number of digits in the occurrence)
</p></li>
</p></li>
</ul>
</ul>
==Variable-length deferred update data sets==
==Variable-length deferred update data sets==
<p>The variable-length data set name corresponds to <var class="term">dsname2</var> discussed in [[#Deferred update OPEN syntax|Deferred update OPEN syntax]]. </p>
<p>
The variable-length data set name corresponds to <var class="term">dsname2</var> discussed in [[#Deferred update OPEN syntax|Deferred update OPEN syntax]]. </p>
===DCB parameters for variable-length data sets===
===DCB parameters for variable-length data sets===
<p>The default DCB parameters for the variable-length data sets are: </p>
<p>
The default DCB parameters for the variable-length data sets for non-<var>FILEORG</var> X'200' files are: </p>
<p class="code">RECFM=VB .
LRECL=270 BLKSIZE=6000 .
</p>
For <var>FILEORG</var> X'200' files, the parameters are:
<p class="code">RECFM=VB .
<p class="code">RECFM=VB .
LRECL=270 BLKSIZE=6000 .
LRECL=271 BLKSIZE=6000 .
</p>
</p>
<p>For z/VSE, set the BLKSIZE parameter with the DEFINE DATASET command. </p>
<p>
<p>You can override the BLKSIZE on the data set or file definition statement. If enough space is available, set BLKSIZE to a full track for most efficient processing. See the description of SPCORE on [[#Setting the SPCORE parameter|Setting the SPCORE parameter]]. </p>
For z/VSE, set the BLKSIZE parameter with the <var>DEFINE DATASET</var> command. </p>
<p>The length of the variable deferred index update entries is 270.</p>
<p>
You can override the BLKSIZE on the data set or file definition statement. If enough space is available, set BLKSIZE to a full track for most efficient processing. See the description of <var>SPCORE</var> on [[#Setting the SPCORE parameter|Setting the SPCORE parameter]]. </p>
<p>
The length of the variable deferred index update entries is 270 for non-<var>FILEORG</var> X'200' files, and it is 271 for <var>FILEORG</var> X'200' files. If using a mix of <var>FILEORG</var> X'200' and non-<var>FILEORG</var> X'200' files, the best strategy is either of these: </p>
<ul>
<li>Do not explicitly specify LRECL, letting it default.</li>
 
<li>Specify <code>LRECL 271</code>, which will work for both <var>FILEORG</var> X'200' and non-<var>FILEORG</var> X'200' files.</li>
</ul>
 
===Deferring updates to ORDERED fields===
===Deferring updates to ORDERED fields===
<p>When the updates to ORDERED fields are deferred to the variable-length data set, the space requirements for the variable-length deferred update data set are one record for each occurrence of an ORDERED field that is added or deleted of a length equal to:</p>
<p>
<p class="code">15 + the length of the ORDERED field value being added or deleted is written to the data set.
When the updates to <var>ORDERED</var> fields are deferred to the variable-length data set, the space requirements for the variable-length deferred update data set are one record for each occurrence of an <var>ORDERED</var> field that is added or deleted of a length equal to the following is written to the data set:</p>
</p>
<p class="code">15 + the length of the ORDERED field value being added or deleted</p>
<p class="note"><b>Note:</b> The length of an ORDERED NUMERIC deferred numeric value is always 8. The numeric values of an ORDERED NUMERIC field are always stored as FLOAT 8 numbers in the Ordered Index, even if the numbers are stored as FLOAT 16 in Table B. The length of an ORDERED NUMERIC deferred nonnumeric value is the length of the value.</p>
<p class="note"><b>Note:</b> The length of an <var>ORDERED NUMERIC</var> deferred numeric value is always 8. The numeric values of an <var>ORDERED NUMERIC</var> field are always stored as <code>FLOAT 8</code> numbers in the Ordered Index, even if the numbers are stored as <code>FLOAT 16</code> in Table B. The length of an <var>ORDERED NUMERIC</var> deferred non-numeric value is the length of the value.</p>
<p>A changed field writes two records: one record to delete the old value and one record to add the new value. </p>
<p>
A changed field writes two records: one record to delete the old value, and one record to add the new value. </p>
 
===Deferring updates to KEY and NUMERIC fields===
===Deferring updates to KEY and NUMERIC fields===
<p>When the updates to KEY and NUMERIC range fields, as well as ORDERED fields, are deferred to the variable-length data set, the additional space required in the variable-length deferred update data set is as follows:</p>
<p>
<table>
When the updates to <var>KEY</var> and <var>NUMERIC RANGE</var> fields, as well as <var>ORDERED</var> fields, are deferred to the variable-length data set, the additional space required in the variable-length deferred update data set is as follows:</p>
<table style="width:80%">
<tr class="head">
<tr class="head">
<th>For each  
<th>For each occurrence of... </th>
occurrence of... </th>
<th>That is added or deleted...</th>
<th>That is added or deleted...</th>
</tr>
</tr>
<tr>
<tr>
<td>KEY field </td>
<td><var>KEY</var> field </td>
<td>One 28-byte record is written to the data set. A changed field writes two records: one record to delete the old value and one record to add the new value.</td>
<td>One 28-byte (non-<var>FILEORG</var> X'200') or 29-byte (<var>FILEORG</var> X'200') record is written to the data set. A changed field writes two records: one record to delete the old value and one record to add the new value.</td>
</tr>
</tr>
<tr>
<tr>
<td>NUMERIC RANGE retrieval field </td>
<td nowrap><var>NUMERIC RANGE</var> field </td>
<td>
<td>
<p>Average number of 28-byte records written is equal to:</p>
<p>
Average number of 28-byte or 29-byte records written is equal to:</p>
<p class="code">4 + (4.5 * the number of digits in the occurrence)
<p class="code">4 + (4.5 * the number of digits in the occurrence)
</p></td>
</p></td>
</tr>
</tr>
</table>
</table>
==Setting the SPCORE parameter==
==Setting the SPCORE parameter==
<p>SPCORE determines how much spare core or unallocated main memory is available after the <var class="product">Model&nbsp;204</var> program has finished initializing itself. When a <var class="product">Model&nbsp;204</var> file is first placed into deferred update mode, there must be enough spare core to open the <var class="product">Model&nbsp;204</var> file and to accommodate the output buffers for each deferred update data set. Each data set requires a spare core of BUFNO*BLKSIZE bytes. </p>
<p>
<p>If more than one deferred update data set is used and/or more than one file goes into deferred update mode, spare core must be large enough to accommodate all the output buffers and associated structures. </p>
<var>[[SPCORE parameter|SPCORE]]</var> determines how much spare core or unallocated main memory is available after the <var class="product">Model&nbsp;204</var> program has finished initializing itself. When a <var class="product">Model&nbsp;204</var> file is first placed into deferred update mode, there must be enough spare core to open the <var class="product">Model&nbsp;204</var> file and to accommodate the output buffers for each deferred update data set. Each data set requires a spare core of <code>BUFNO*BLKSIZE</code> bytes. </p>
<p>
If more than one deferred update data set is used and/or more than one file goes into deferred update mode, spare core must be large enough to accommodate all the output buffers and associated structures. </p>
<ul>
<ul>
<li>Under z/OS, the parameter SPCORE is normally set on User 0's parameter line - the first input line, containing parameter assignments that further define system options and work area sizes. </li>
<li>Under z/OS, the parameter <var>SPCORE</var> is normally set on User 0's parameter line &mdash; the first input line, containing parameter assignments that further define system options and work area sizes. </li>
<li>Under z/VSE, the SIZE parameter is set. </li>
 
<li>Under z/VM, SPCORE is usually set in the CCAIN input. (See the Rocket <var class="product">Model&nbsp;204</var> System Manager's Guide for further explanation.)    </li>
<li>Under z/VSE, the <code>SIZE</code> parameter is set. </li>
 
<li>Under z/VM, <var>SPCORE</var> is usually set in the CCAIN input. See [[Defining the runtime environment (CCAIN)#User 0 parameters|User 0 parameters|]] for further explanation. </li>
</ul>
</ul>
==Phase 1 sample JCL==
==Phase 1 sample JCL==
<p>This section presents z/OS and z/VSE JCL examples for the first phase of the deferred update process. The section that include a single z/VM example begins in [[#z/VM deferred update example|z/VM deferred update example]].</p>
<p>
<p>The following sequence is an example of the first phase in a deferred update procedure. The file PEOPLE is provided with one fixed-length deferred update data set. The file CARS is provided with two deferred update data sets: one fixed-length deferred update data set and one variable-length deferred update data set.</p>
This section presents z/OS and z/VSE JCL examples for the first phase of the deferred update process. The section that include a single z/VM example begins in [[#z/VM deferred update example|z/VM deferred update example]].</p>
<b>z/OS Example, Phase 1</b>
<p>
The following sequence is an example of the first phase in a deferred update procedure. The file <code>PEOPLE</code> is provided with one fixed-length deferred update data set. The file <code>CARS</code> is provided with two deferred update data sets: one fixed-length deferred update data set and one variable-length deferred update data set.</p>
 
<b>z/OS example, Phase 1</b>
<p class="code">//JOB UPDATE FILES CARS AND PEOPLE
<p class="code">//JOB UPDATE FILES CARS AND PEOPLE
// EXEC ...        Include here the basic JCL
// EXEC ...        Include here the basic JCL
Line 155: Line 255:
                   provided by the Model 204 system
                   provided by the Model 204 system
                             manager to run BATCH204.
                             manager to run BATCH204.
//PEOPLE DD DSN=M204.FILE.PEOPLE,DISP=SHR
//PEOPLE   DD DSN=M204.FILE.PEOPLE,DISP=SHR
//TAPEPEOP DD DSN=M204.DEFER.PEOPLE,
//TAPEPEOP DD DSN=M204.DEFER.PEOPLE,DISP=(NEW,CATLG),UNIT=TAPE
DISP=(NEW,CATLG),UNIT=TAPE
//CARS     DD DSN=M204.FILE.CARS,DISP=SHR
//CARS DD DSN=M204.FILE.CARS,DISP=SHR
//TAPECARF DD DSN=M204.DEFER.FIXED.CARS,DISP=(NEW,CATLG),UNIT=TAPE
//TAPECARF DD DSN=M204.DEFER.FIXED.CARS,
//TAPECARV DD DSN=M204.DEFER.VAR.CARS,DISP=(NEW,CATLG),UNIT=TAPE
DISP=(NEW,CATLG),UNIT=TAPE
//CCAIN     DD *
//TAPECARV DD DSN=M204.DEFER.VAR.CARS,
DISP=(NEW,CATLG),UNIT=TAPE
//CCAIN DD *
user zero parameters
user zero parameters
LOGIN userid
LOGIN userid
Line 169: Line 266:
OPEN PEOPLE,TAPEPEOP
OPEN PEOPLE,TAPEPEOP
INCLUDE procedure  Updating for Tables A and B; KEY
INCLUDE procedure  Updating for Tables A and B; KEY
     .              and NUMERIC RANGE deferred updates  
     .              and NUMERIC RANGE deferred updates
     .            written to TAPEPEOP. Any Ordered  
     .            written to TAPEPEOP. Any Ordered
     .            Index updates are not deferred.
     .            Index updates are not deferred.
OPEN CARS,TAPECARF,TAPECARV
OPEN CARS,TAPECARF,TAPECARV
INCLUDE procedure  Updating for Tables A and B; KEY
INCLUDE procedure  Updating for Tables A and B; KEY
     .            and NUMERIC RANGE deferred updates
     .            and NUMERIC RANGE deferred updates
     .            written to TAPECARF. Ordered  
     .            written to TAPECARF. Ordered
     .            Index updates written to TAPECARV.
     .            Index updates written to TAPECARV.
CLOSE ALL
CLOSE ALL
Line 181: Line 278:
/*
/*
</p>
</p>
<b>z/VSE Example, Phase 1</b>
 
<b>z/VSE example, Phase 1</b>
<p class="code">// JOB UPDATE FILES CARS AND PEOPLE
<p class="code">// JOB UPDATE FILES CARS AND PEOPLE
// DLBL PEOPLE,'M204.FILE.PEOPLE',,DA
// DLBL PEOPLE,'M204.FILE.PEOPLE',,DA
Line 206: Line 304:
password
password
OPEN PEOPLE,TAPEPEOP
OPEN PEOPLE,TAPEPEOP
INCLUDE procedure  Updating for Tables A and B;  
INCLUDE procedure  Updating for Tables A and B;
     .          KEY and NUMERIC RANGE deferred updates
     .          KEY and NUMERIC RANGE deferred updates
     .        written to TAPEPEOP. Any Ordered  
     .        written to TAPEPEOP. Any Ordered
     .        Index updates are not deferred.
     .        Index updates are not deferred.
OPEN CARS,TAPECARF,TAPECARV
OPEN CARS,TAPECARF,TAPECARV
INCLUDE procedure  Updating for Tables A and B; KEY
INCLUDE procedure  Updating for Tables A and B; KEY
     .              and NUMERIC RANGE deferred updates  
     .              and NUMERIC RANGE deferred updates
     .            written to TAPECARF. Ordered  
     .            written to TAPECARF. Ordered
     .            Index updates written to TAPECARV.
     .            Index updates written to TAPECARV.
CLOSE ALL
CLOSE ALL
Line 220: Line 318:
/&amp;
/&amp;
</p>
</p>
==Deferred updates: Phase 2==
==Deferred updates: Phase 2==
<p>As many as three data sets might require sorting and application to Tables C and D: </p>
<p>
As many as three data sets might require sorting and application to Tables C and D: </p>
<ul>
<ul>
<li>Fixed-length data set</li>
<li>Fixed-length data set</li>
Line 227: Line 327:
<li>FRV (fixed-length) data set</li>
<li>FRV (fixed-length) data set</li>
</ul>
</ul>
<p>Descriptions of processing each of these data sets follow.       </p>
<p>
Descriptions of processing each of these data sets follow. </p>
 
==Sorting the fixed-length deferred update data set==
==Sorting the fixed-length deferred update data set==
<p>If you use a fixed-length deferred update data set, it must be sorted by some job step after the first phase step. The fixed-length records are 24 bytes long and must be sorted in ascending order by the first 16 bytes using the standard EBCDIC collating sequence.</p>
<p>
<p>Any sort utility can be used to perform the sort of the fixed-length deferred update data set under z/OS, z/VSE, or z/VM. The basic JCL for the IBM SORT Utility is described in the following paragraphs. Refer to the appropriate IBM manual for additional information.     </p>
If you use a fixed-length deferred update data set, it must be sorted by some job step after the first phase step.</p>
<p class="note"><b>Note:</b> The z/VM SORT command is not adequate if large files are involved, because it lacks the required capacity. </p>
<ul>
<li>For non-<var>FILEORG</var> X'200' files, the fixed-length records are 24 bytes long and must be sorted in ascending order by the first 16 bytes, using the standard EBCDIC collating sequence.</li>
 
<li>For <var>FILEORG</var> X'200' files, the fixed-length records are 25 bytes long and must be sorted in ascending order by the first 17 bytes, using the standard EBCDIC collating sequence.</li>
</ul>
<p>
Any sort utility can be used to perform the sort of the fixed-length deferred update data set under z/OS, z/VSE, or z/VM. The basic JCL for the IBM SORT Utility is described in the following paragraphs. Refer to the appropriate IBM manual for additional information. </p>
<p class="note"><b>Note:</b> The z/VM <code>SORT</code> command is not adequate if large files are involved, because it lacks the required capacity. </p>
===SORTIN and SORTOUT data sets===
===SORTIN and SORTOUT data sets===
<p>SORTIN is the fixed-length deferred update data set.   </p>
<p>
<p>Specify the SORTOUT DCB parameters as shown in [[#DCB parameters for fixed-length data sets|DCB parameters for fixed-length data sets]]. In z/OS and z/VM, set DCB subparameters explicitly. </p>
<code>SORTIN</code> is the fixed-length deferred update data set.</p>
<p>
Specify the <code>SORTOUT</code> DCB parameters as shown in [[#DCB parameters for fixed-length data sets|DCB parameters for fixed-length data sets]]. In z/OS and z/VM, set DCB subparameters explicitly.</p>
 
<b>Recommended DCB subparameters</b>
<b>Recommended DCB subparameters</b>
<p>The following DCB subparameters are recommended: </p>
<p>
<p class="code">RECFM=FB .
The following DCB subparameters are recommended for non-<var>FILEORG</var> X'200' files:</p>
LRECL=24 BLKSIZE=15476 (1/3 track on a 3380 disk)  
<p class="code">RECFM=FB
LRECL=24 BLKSIZE=27998  (1/2 track on a 3390 disk)
</p>
The following are recommended for <var>FILEORG</var> X'200' files:
<p class="code">RECFM=FB
LRECL=25 BLKSIZE=27975  (1/2 track on a 3390 disk)
</p>
</p>
<p>In z/VSE, specify the physical record format for the SORTIN data set using the sort program's RECORD statement.</p>
<p>
In z/VSE, specify the physical record format for the <code>SORTIN</code> data set using the sort program's <code>RECORD</code> statement.</p>
 
===SORT control statements===
===SORT control statements===
<p>The following SYSIN control statement sorts fixed-length deferred update records in z/OS: </p>
<p>
The following <code>SYSIN</code> control statement sorts fixed-length deferred update records in z/OS for non-<var>FILEORG</var> X'200' files: </p>
<p class="code">SORT FIELDS=(1,16,CH,A)
<p class="code">SORT FIELDS=(1,16,CH,A)
</p>
</p>
<p>The effect of this statement is to sort the records in ascending order by the first 16 bytes.   </p>
<p>
<p>For z/VSE, the SYSIPT control statement is as follows: </p>
The effect of this statement is to sort the records in ascending order by the first 16 bytes. </p>
<p>
The following statement sorts fixed-length deferred update records for <var>FILEORG</var> X'200' files: </p>
<p class="code">SORT FIELDS=(1,17,CH,A)
</p>
<p class="note"><b>Note:</b> The <var>FILEORG</var> X'200' file <code>SORT FIELD</code> statement also works for non-<var>FILEORG</var> X'200' files. </p>
<p>
For z/VSE, the <code>SYSIPT</code> control statement is as follows for non-<var>FILEORG</var> X'200' files: </p>
<p class="code">SORT FIELDS=(1,16,CH,A)
<p class="code">SORT FIELDS=(1,16,CH,A)
RECORD TYPE=F,LENGTH=24
RECORD TYPE=F,LENGTH=24
Line 252: Line 380:
OUTFIL BLKSIZE=blocksize of SORTOUT
OUTFIL BLKSIZE=blocksize of SORTOUT
</p>
</p>
The statement for <var>FILEORG</var> X'200' files is:
<p class="code">SORT FIELDS=(1,17,CH,A)
RECORD TYPE=F,LENGTH=25
INPFIL BLKSIZE=blocksize of SORTIN
OUTFIL BLKSIZE=blocksize of SORTOUT
</p>
===Sort work data sets for the fixed-length deferred update data set===
===Sort work data sets for the fixed-length deferred update data set===
<p>The amount of space needed for the sort work data sets depends on the number of records in the fixed-length deferred update data set. In general, set the total amount of space in all the SORTWK<var class="term">xx</var> data sets to about twice the number of bytes in the fixed-length deferred update data set that you are sorting.  </p>
<p>
<p>For example, suppose that there are 100,000 records in the fixed-length deferred update data set. This is 2,400,000 bytes or about 4 cylinders (rounding up) of a 3380 disk. If you use three sort work data sets for sorting the fixed-length deferred update data set, space parameters of three cylinders apiece yield a total of nine cylinders, or slightly more than twice the size of the fixed-length deferred update data set.</p>
The amount of space needed for the sort work data sets depends on the number of records in the fixed-length deferred update data set. In general, set the total amount of space in all the SORTWK<i>xx</i> data sets to about twice the number of bytes in the fixed-length deferred update data set that you are sorting.  </p>
<p>
For example, suppose that there are 100,000 records in the fixed-length deferred update data set. This is 2,400,000 bytes or about 4 cylinders (rounding up) of a 3380 disk. If you use three sort work data sets for sorting the fixed-length deferred update data set, space parameters of three cylinders apiece yield a total of nine cylinders, or slightly more than twice the size of the fixed-length deferred update data set.</p>
===Sorting the fixed-length deferred update data set===
===Sorting the fixed-length deferred update data set===
<b>z/OS JCL</b>
<b>z/OS JCL</b>
<p>The following z/OS JCL sorts the fixed-length deferred update data set:</p>
<p>
The following z/OS JCL sorts the fixed-length deferred update data set:</p>
<p class="code">//SORT EXEC PGM=SORT,TIME=60,
<p class="code">//SORT EXEC PGM=SORT,TIME=60,
// REGION=200K,
//             REGION=6M,
// PARM'MSG=AP,CORE=150000'
//             PARM='MSG=AP,CORE=150000'
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTLIB   DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTMSGS DD SYSOUT=A
//SORTMSGS DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SYSOUT   DD SYSOUT=A
//SORTIN DD DSN=M204.DEFER.FIXED.CARS,
//SORTIN   DD DSN=M204.DEFER.FIXED.CARS,
// DISP=(OLD,DELETE,KEEP)
//             DISP=(OLD,DELETE,KEEP)
//SORTOUT DD DSN=M204.SORTOUT.FIXED.CARS,
//SORTOUT   DD DSN=M204.SORTOUT.FIXED.CARS,
// DISP=(NEW,CATLG,DELETE),UNIT=TAPE,
//             DISP=(NEW,CATLG,DELETE),UNIT=TAPE,
// DCB=(RECFM=FB,LRECL=24,BLKSIZE=15476)
//             DCB=(RECFM=FB,LRECL=24,BLKSIZE=32760)
//SORTWK01 DD SPACE=(CYL,3,,CONTIG),
//SORTWK01 DD SPACE=(CYL,3,,CONTIG),
// UNIT=3380
//             UNIT=3390
//SORTWK02 DD SPACE=(CYL,3,,CONTIG),
//SORTWK02 DD SPACE=(CYL,3,,CONTIG),
// UNIT=(3380,SEP=SORTWK01)
//             UNIT=(3390,SEP=SORTWK01)
//SORTWK03 DD SPACE=(CYL,3,,CONTIG),
//SORTWK03 DD SPACE=(CYL,3,,CONTIG),
// UNIT=(3380,(SEP=SORTWK01,SORTWK02))
//             UNIT=(3390,(SEP=SORTWK01,SORTWK02))
//SYSIN DD *
//SYSIN DD *
  SORT FIELDS=(1,16,CH,A)
  SORT FIELDS=(1,16,CH,A)
/*
/*
</p>
</p>
<p>Many installations provide cataloged procedures that contain most of the previous JCL. </p>
<p>
Many installations provide cataloged procedures that contain most of the previous JCL. </p>
 
<b>z/VSE JCL</b>
<b>z/VSE JCL</b>
<p>Following is an example of z/VSE JCL to sort the fixed-length deferred update data set:</p>
<p>
Following is an example of z/VSE JCL to sort the fixed-length deferred update data set:</p>
<p class="code">// TLBL SORTIN1,'M204.DEFERF.CARS'
<p class="code">// TLBL SORTIN1,'M204.DEFERF.CARS'
// ASSGN SYS002,TAPE
// ASSGN SYS002,TAPE
// TLBL SORTOUT,'M204.SORTFIX.CARS'
// TLBL SORTOUT,'M204.SORTFIX.CARS'
// ASSGN SYS001,TAPE
// ASSGN SYS001,TAPE
sort work statements          Specify SORTWK1  
sort work statements          Specify SORTWK1
.                              through SORTWKn for
.                              through SORTWKn for
.                                    sort work data sets  
.                                    sort work data sets
.
.
.
.
Line 297: Line 439:
   OUTFIL BLKSIZE=1680
   OUTFIL BLKSIZE=1680
/*
/*
/&amp;  
/&amp;
</p>
</p>
==Applying the fixed-length deferred updates==
==Applying the fixed-length deferred updates==
<p>To apply the fixed-length deferred updates, use the following Z command. The Z command processes the sorted output from the sort of the fixed-length deferred update data set and adds the KEY and NUMERIC RANGE retrieval index information to Tables C and D. If any of the KEY fields updated also have the FRV attribute, the Z command creates an additional deferred update data set, an FRV data set, that is processed in later job steps. For more information about the FRV deferred update data set, see [[#Applying the FRV deferred updates|Applying the FRV deferred updates]].      </p>
<p>
To apply the fixed-length deferred updates, use the following Z command. The Z command processes the sorted output from the sort of the fixed-length deferred update data set and adds the <var>KEY</var> and <var>NUMERIC RANGE</var> retrieval index information to Tables C and D. If any of the <var>KEY</var> fields updated also have the <var>FRV</var> attribute, the <var>Z</var> command creates an additional deferred update data set, an <var>FRV</var> data set, that is processed in later job steps.  
 
For more information about the <var>FRV</var> deferred update data set, see [[#Applying the FRV deferred updates|Applying the FRV deferred updates]].      </p>
===Z command===
===Z command===
<p>The Z command has no arguments. It does the following:</p>
<p>
The <var>Z</var> command has no arguments. It does the following:</p>
<ul>
<ul>
<li>Reads records from the data set pointed to by the SORT5 data set or file definition statement</li>
<li>Reads records from the data set pointed to by the <code>SORT5</code> data set or file definition statement</li>
 
<li>Updates Tables C and D of the currently open <var class="product">Model&nbsp;204</var> file.</li>
<li>Updates Tables C and D of the currently open <var class="product">Model&nbsp;204</var> file.</li>
<li>Writes FRV deferred update records to the data set pointed to by the TAPE5 data set or file definition statement. </li>
 
<li>Writes <var>FRV</var> deferred update records to the data set pointed to by the <code>TAPE5</code> data set or file definition statement. </li>
</ul>
</ul>
<p>When Z command processing is complete, the following statistics are printed, which reflect the changes that occurred during processing:</p>
<p>
<table>
When <var>Z</var> command processing is complete, the following statistics are printed, which reflect the changes that occurred during processing:</p>
<table style="width:80%">
<tr class="head">
<tr class="head">
<th>Statistic</th>
<th>Statistic</th>
<th>Number of...</th>
<th>Number of...</th>
</tr>
</tr>
<tr>
<tr>
<td> ADDED </td>
<td>ADDED</td>
<td>Field name=value pairs added to the hashed index.  </td>
<td>Field name=value pairs added to the hashed index.  </td>
</tr>
</tr>
<tr>
<tr>
<td> DISTINCT </td>
<td>DISTINCT</td>
<td>New field name = value pairs added to hashed index fields; or, when processing the FRV deferred update data set, the number of FRV fields updated.</td>
<td>New field name = value pairs added to hashed index fields; or, when processing the FRV deferred update data set, the number of FRV fields updated.</td>
</tr>
</tr>
<tr>
<tr>
<td> DELETED </td>
<td>DELETED</td>
<td>Field name = value pairs deleted from the hashed index.</td>
<td>Field name = value pairs deleted from the hashed index.</td>
</tr>
</tr>
<tr>
<tr>
<td> FRV </td>
<td>FRV</td>
<td>FRV deferred update records written out to the data set pointed to by the TAPE5 data set or file definition statement.</td>
<td><var>FRV</var> deferred update records written out to the data set pointed to by the <code>TAPE5</code> data set or file definition statement.</td>
</tr>
</tr>
<tr>
<tr>
<td> OI ADDED </td>
<td>OI ADDED</td>
<td>Entries added to the Ordered Index.</td>
<td>Entries added to the Ordered Index.</td>
</tr>
</tr>
<tr>
<tr>
<td nowrap> OI DELETED </td>
<td nowrap>OI DELETED</td>
<td>Entries deleted from the Ordered Index.</td>
<td>Entries deleted from the Ordered Index.</td>
</tr>
</tr>
Line 341: Line 498:


===SPCORE parameter===
===SPCORE parameter===
<p>The SPCORE parameter must be set large enough to open the <var class="product">Model&nbsp;204</var> file and to accommodate both the input buffer for SORT5 and the output buffer for TAPE5 as well as other associated structures.  </p>
<p>
The <var>SPCORE</var> parameter must be set large enough to open the <var class="product">Model&nbsp;204</var> file and to accommodate both the input buffer for <code>SORT5</code> and the output buffer for <code>TAPE5</code>, as well as other associated structures.  </p>
 
==Fixed-length data set examples==
==Fixed-length data set examples==
<b>z/OS JCL</b>
<b>z/OS JCL</b>
<p>Applying the fixed-length deferred index updates for z/OS follows:</p>
<p>
Applying the fixed-length deferred index updates for z/OS follows:</p>
<p class="code">// EXEC ...  Include the basic JCL or cataloged
<p class="code">// EXEC ...  Include the basic JCL or cataloged
            procedure call provided by the
              procedure call provided by the
          Model 204 system manager to run BATCH204
              Model 204 system manager to run BATCH204
//CARS DD DSN=M204.FILE.CARS,DISP=SHR
//CARS     DD DSN=M204.FILE.CARS,DISP=SHR
//SORT5 DD DSN=M204.SORTOUT.FIXED.CARS,
//SORT5     DD DSN=M204.SORTOUT.FIXED.CARS,
// DISP=(OLD,DELETE,KEEP)
//             DISP=(OLD,DELETE,KEEP)
// TAPE5 DD DSN=M204.TAPE5.CARS,
//TAPE5     DD DSN=M204.TAPE5.CARS,
// DISP=(NEW,CATLG,DELETE),
//             DISP=(NEW,CATLG,DELETE),
// UNIT=3380,SPACE=(TRK,(5,2)),
//             UNIT=3390,SPACE=(TRK,(5,2)),
// DCB=BLKSIZE=15476
//             DCB=BLKSIZE=27998
//CCAIN DD *
//CCAIN     DD *
user zero parameters
user zero parameters
LOGIN userid
LOGIN userid
Line 365: Line 525:
/*
/*
</p>
</p>
<b>z/VSE JCL</b>
<b>z/VSE JCL</b>
<p>Applying the fixed-length deferred index updates for z/VSE follows:</p>
<p>
Applying the fixed-length deferred index updates for z/VSE follows:</p>
<p class="code">// DLBL CARS,'M204.FILE.CARS',,DA
<p class="code">// DLBL CARS,'M204.FILE.CARS',,DA
// EXTENT SYSnnn,volser
// EXTENT SYSnnn,volser
Line 388: Line 550:
/&amp;
/&amp;
</p>
</p>
==Sorting the variable-length deferred update data set==
==Sorting the variable-length deferred update data set==
===Variable-length sort keys===
===Variable-length sort keys===
<p>When you use a variable-length deferred update data set, it must be sorted by a job step after the deferred data set first phase. The variable-length records can vary in length from 16 to 270 and must be sorted into ascending order. Unlike fixed-length deferred update records, which contain a fixed-length sort key, variable-length deferred update records for ORDERED fields contain a variable-length sort key. </p>
<p>
<p>Because no standard sort program supports variable-length sort keys, two sort exits are provided to transform the variable-length sort keys into fixed-length sort keys. Transforming variable-length sort keys is done in the E15 sort exit. The E15 sort exit expands variable-length ORDERED deferred update records into fixed-length records. </p>
When you use a variable-length deferred update data set, it must be sorted by a job step after the deferred data set first phase. The variable-length records can vary in length from 16 to 270 (or 271, for <var>FILEORG</var> X'200' files), and they must be sorted into ascending order. Unlike fixed-length deferred update records, which contain a fixed-length sort key, variable-length deferred update records for <var>ORDERED</var> fields contain a variable-length sort key. </p>
<p>This process produces longer sort records, which can increase the time and resources required to produce sorted output. Because sorting performance is quite sensitive to record length, be sure to set the expanded length as part of setting up sort control statements (see [[#SORT control statements|SORT control statements]]).</p>
<p>
Because no standard sort program supports variable-length sort keys, two sort exits are provided to transform the variable-length sort keys into fixed-length sort keys. Transforming variable-length sort keys is done in the E15 sort exit. The E15 sort exit expands variable-length <var>ORDERED</var> deferred update records into fixed-length records. </p>
<p>
This process produces longer sort records, which can increase the time and resources required to produce sorted output. Because sorting performance is quite sensitive to record length, be sure to set the expanded length as part of setting up [[#SORT control statements|SORT control statements]].</p>
===Sort utilities===
===Sort utilities===
<p>Any sort utility that supports sorting variable-length records and the use of the E15 and E35 sort exits can be used to perform the sort. The basic JCL for the IBM SORT Utility is described in the following paragraphs. Refer to the appropriate sort utility manual for additional information.       </p>
<p>
<p>The z/VM SORT command cannot be used, because it cannot accommodate sort exits. </p>
Any sort utility that supports sorting variable-length records and the use of the E15 and E35 sort exits can be used to perform the sort. The basic JCL for the IBM SORT Utility is described in the following paragraphs. Refer to the appropriate sort utility manual for additional information. </p>
<p>
The z/VM <code>SORT</code> command cannot be used, because it cannot accommodate sort exits. </p>
===Required sort JCL and EXEC statements===
===Required sort JCL and EXEC statements===
<p>When writing JCL or z/VM EXECs for sorting, use the following statements:</p>
<p>
When writing JCL or z/VM EXECs for sorting, use the following statements:</p>
<ul>
<ul>
<li>SORTIN is the variable-length deferred update data set.</li>
<li><code>SORTIN</code> is the variable-length deferred update data set.</li>
<li>Specify the SORTOUT DCB parameters as shown in the first phase step on [[#DCB parameters for variable-length data sets|DCB parameters for variable-length data sets]]. In z/OS and z/VM, set DCB subparameters explicitly. </li>
 
<li>Use the following DCB subparameters:  
<li>Specify the <code>SORTOUT</code> DCB parameters as shown in the first phase step on [[#DCB parameters for variable-length data sets|DCB parameters for variable-length data sets]]. In z/OS and z/VM, set DCB subparameters explicitly. </li>
<p class="code">RECFM=VB .
 
LRECL=270 BLKSIZE=15476 (1/3 track on a 3380 disk)  
<li>Use the following DCB subparameters for non-<var>FILEORG</var> X'200' files:
<p class="code">RECFM=VB
LRECL=270 BLKSIZE=27998 (1/2 track on a 3390 disk)
</p>
Use the following for <var>FILEORG</var> X'200' files:
<p class="code">RECFM=VB
LRECL=271 BLKSIZE=27975 (1/2 track on a 3390 disk)
</p>
</p>
<p>In z/VSE, specify the physical record format for the SORTIN data set using the SORT program's RECORD statement.   </p>
Or better still, don't specify the DCB subparameters and let them default.
<p>
In z/VSE, specify the physical record format for the <code>SORTIN</code> data set using the SORT program's RECORD statement. </p>
</li>
</li>
<li>Specify CCAPRINT (SYSLST in z/VSE) in the step that sorts the variable-length deferred update data set. CCAPRINT is the <var class="term">ddname</var>, FILEDEF, or DLBL that points to the sort error message output data set.  </li>
 
<li>Specify CCAIN in the step that sorts the variable-length deferred update data set. CCAIN must contain the sort control statements. SYSIN and CCAIN must point to copies of the same sort control statements.  
<li>Specify <code>CCAPRINT</code> (<code>SYSLST</code> in z/VSE) in the step that sorts the variable-length deferred update data set. <code>CCAPRINT</code> is the <var class="term">ddname</var>, FILEDEF, or DLBL that points to the sort error message output data set.  </li>
<p>In z/VSE, the CCAIN DLBL is not needed when sorting the variable-length deferred update data set.</p>
 
<li>Specify <code>CCAIN</code> in the step that sorts the variable-length deferred update data set. CCAIN must contain the sort control statements. SYSIN and CCAIN must point to copies of the same sort control statements.
<p>
In z/VSE, the CCAIN DLBL is not needed when sorting the variable-length deferred update data set.</p>
</li>
</li>
<li>CCAEXITS, the <var class="term">ddname</var> of the library containing the sort exits, is used only in the z/OS environment. For information on installing the sort exits, see the Rocket <var>Model&nbsp;204 installation guide</var> for your operating system.</li>
 
<li><code>CCAEXITS</code>, the <var class="term">ddname</var> of the library containing the sort exits, is used only in the z/OS environment. For information on installing the sort exits, see [[Model 204 installation on IBM z/OS#Link the Model 204 utility load modules|Link the Model 204 utility load modules]].</li>
</ul>
</ul>
===SORT control statements===
===SORT control statements===
<b>For z/OS and z/VM</b>
<p>
<p>The syntax of SORT control statements is sort-package and operating-system specific, the following example of a SYSIN control statement is applicable for z/OS and z/VM:</p>
The syntax of SORT control statements is sort-package and operating-system specific, the following example of a <code>SYSIN</code> control statement is applicable for z/OS and z/VM:</p>
 
<b>Syntax for z/OS and z/VM</b>
<b>Syntax for z/OS and z/VM</b>
<p class="code">SORT FIELDS=(5,<var class="term">aa</var>,CH,A)
<p class="syntax">SORT FIELDS=(5,<span class="term">aa</span>,CH,A)
RECORD TYPE=V,LENGTH=(270,<var class="term">vl</var>,270,<var class="term">vl</var>)
RECORD TYPE=V,LENGTH=(271,<span class="term">vl</span>,271,<span class="term">vl</span>)
MODS E15=(OI15<var class="term">xxx</var>,1800),E35=(OI35<var class="term">xxx</var>,1300)
MODS E15=(OI15<span class="term">xxx</span>,1800),E35=(OI35<span class="term">xxx</span>,1300)
END
END
</p>
</p>
<b>Where</b>
 
Where:
<ul>
<ul>
<li><var class="term">aa</var> is the sort field length, the value of (<var class="term">vl</var> - 5). It represents the length of the entire data portion of the expanded sort record.</li>
<li><var class="term">aa</var> is the sort field length, the value of (<var class="term">vl</var> - 5). It represents the length of the entire data portion of the expanded sort record.</li>
<li><var class="term">vl</var> is a length parameter. See [[#Setting the variable-length sort parameter (vl)|Setting the variable-length sort parameter (vl)]]. The length of the variable deferred index update entries is 270.</li>
 
<li><var class="term">vl</var> is a length parameter. See [[#Setting the variable-length sort parameter (vl)|Setting the variable-length sort parameter (vl)]]. The length of the variable deferred index update entries is 270 for non-<var>FILEORG</var> X'200' files and 271 for <var>FILEORG</var> X'200' files, but 271 can be used for either.</li>
 
<li><var class="term">xxx</var> is OS for z/OS or CMS for z/VM, depending on the operating system.</li>
<li><var class="term">xxx</var> is OS for z/OS or CMS for z/VM, depending on the operating system.</li>
</ul>
</ul>
<p>The exact syntax for the MODS statement is operating-system and sort-package dependent.</p>
<p>
<b>For z/VSE</b>
The exact syntax for the <code>MODS</code> statement is operating-system and sort-package dependent.</p>
 
<b>Syntax for z/VSE</b>
<b>Syntax for z/VSE</b>
<p class="code">SORT FIELDS=(5,<var class="term">aa</var>,CH,A)
<p class="syntax">SORT FIELDS=(5,<span class="term">aa</span>,CH,A)
RECORD TYPE=V,LENGTH=(270,<var class="term">vl</var>,270,<var class="term">vl</var>)
RECORD TYPE=V,LENGTH=(271,<span class="term">vl</span>,271,<span class="term">vl</span>)
MODS PH1=(OI15,1800),PH3=(OI35,1300)
MODS PH1=(OI15,1800),PH3=(OI35,1300)
END
END
Line 439: Line 628:


==Setting the variable-length sort parameter (vl)==
==Setting the variable-length sort parameter (vl)==
<p>Because deferred update records of unequal length cannot be properly compared, the sort exit adjusts the variable-length deferred update records to a specified length. That length is the variable-length sort parameter, vl.      </p>
<p>
<p>The vl setting determines the number of records in the deferred update data set that are optimally ordered by the sort for loading ordered fields by the Z command. A record whose length is less than the specified setting for vl is sorted into an optimum loading order. Records whose length is greater than or equal to vl are placed in the sorted deferred update data set but not in an optimum loading order.</p>
Because deferred update records of unequal length cannot be properly compared, the sort exit adjusts the variable-length deferred update records to a specified length. That length is the variable-length sort parameter, <var class="term">vl</var>.      </p>
<p>
The <var class="term">vl</var> setting determines the number of records in the deferred update data set that are optimally ordered by the sort for loading ordered fields by the <var>Z</var> command. A record whose length is less than the specified setting for vl is sorted into an optimum loading order. Records whose length is greater than or equal to <var class="term">vl</var> are placed in the sorted deferred update data set but not in an optimum loading order.</p>
===Finding the optimum loading order===
===Finding the optimum loading order===
<p>It is usually best to place all deferred update records in optimum loading order. If ORDERED fields and either KEY or NUMERIC RANGE fields exist on the same deferred update data set, specify vl as:</p>
<p>
<p class="code"><var class="term">vl</var> = <var>A</var> or <var>B</var>, whichever is greater
It is usually best to place all deferred update records in optimum loading order. If <var>ORDERED</var> fields and either <var>KEY</var> or <var>NUMERIC RANGE</var> fields exist on the same deferred update data set, specify <var class="term">vl</var> as:</p>
<p class="syntax"><span class="term">vl</span> = <span class="literal">A</span> or <span class="literal">B</span>, whichever is greater.
</p>
</p>
<p>where:</p>
<p>
where:</p>
<table>
<table>
<tr class="head">
<tr class="head">
Line 451: Line 645:
<th>Equals...</th>
<th>Equals...</th>
</tr>
</tr>
<tr>
<tr>
<td>A </td>
<td>A </td>
<td>Length of the longest Ordered Index deferred update record + 1. Estimate this as the length of the longest ORDERED field + 16 bytes overhead.</td>
<td>Length of the longest Ordered Index deferred update record + 1. Estimate this as the length of the longest <var>ORDERED</var> field + 16 or 17 (non-<var>FILEORG</var> X'200' or <var>FILEORG</var> X'200', respectively) bytes overhead.  
<p>
If you are using a mix of <var>FILEORG</var> X'200' and non-<var>FILEORG</var> X'200' files, you do not have to concern yourself with the type of the file in calculations if you use the 17 as a more conservative value &mdash; it will work fine for <var>FILEORG</var> X'200' and non-<var>FILEORG</var> X'200' files.</p></td>
</tr>
</tr>
<tr>
<tr>
<td>B </td>
<td>B </td>
<td>28 bytes for Hashed Index (KEY or NUMERIC RANGE fields) deferred update records.</td>
<td>28 or 29 (non-<var>FILEORG</var> X'200' or <var>FILEORG</var> X'200', respectively) bytes for Hashed Index (<var>KEY</var> or <var>NUMERIC RANGE</var> fields) deferred update records.</td>
</tr>
</tr>
</table>
</table>
<b>Measuring the longest record</b>
 
<p>Determining the exact length of the longest deferred update record requires examining the contents of the variable-length deferred update data sets. This examination is done for you if the File Load utility is being used, as the FILELOAD and FLOD commands print statistics that list the lengths of the deferred update records in the form of a histogram. Record lengths can also be obtained through a user-written program or a utility such as SYNCSORT's HISTOGRAM to read the records in the deferred update data set and determine the longest record.  </p>
====Measuring the longest record====
<p>
Determining the exact length of the longest deferred update record requires examining the contents of the variable-length deferred update data sets. This examination is done for you if the File Load utility is being used, as the <var>FILELOAD</var> and <var>FLOD</var> commands print statistics that list the lengths of the deferred update records in the form of a histogram. Record lengths can also be obtained through a user-written program or a utility such as SYNCSORT's HISTOGRAM to read the records in the deferred update data set and determine the longest record.  </p>
 
===Setting vl for extreme cases===
===Setting vl for extreme cases===
<p>Specifying vl as described in the previous section results in a sorted deferred update data set that is completely ordered for the most efficient loading by the Z command. In some extreme cases, sorting to completely order all deferred update records places excessive demands on the sorting process because of the way the length is increased for the records to be sorted. </p>
<p>
<p>Typically these cases involve very large files with unusual distributions of record lengths in the deferred update data set as shown in [[#Setting vl example|Setting vl example]]. In these cases, a smaller setting of the vl parameter than previously recommended might be desired, even though this results in a less than complete ordering of the data set. The consequent slowing of the Z command processing must be weighed against the benefit to the sort performance.</p>
Specifying <var class="term">vl</var> as described in the previous section results in a sorted deferred update data set that is completely ordered for the most efficient loading by the <var>Z</var> command. In some extreme cases, sorting to completely order all deferred update records places excessive demands on the sorting process because of the way the length is increased for the records to be sorted. </p>
<p class="note"><b>Note:</b> In all cases, if a KEY or NUMERIC RANGE field is deferred in the variable-length deferred update data set, vl must be greater than 28. Rocket Software suggests that you reorganize any file that was loaded with a vl of less than 28.</p>
<p>
Typically these cases involve very large files with unusual distributions of record lengths in the deferred update data set as shown in [[#Setting vl example|Setting vl example]]. In these cases, a smaller setting of the <var class="term">vl</var> parameter than previously recommended might be desired, even though this results in a less than complete ordering of the data set. The consequent slowing of the <var>Z</var> command processing must be weighed against the benefit to the sort performance.</p>
 
<p class="note"><b>Note:</b> In all cases, if a <var>KEY</var> or <var>NUMERIC RANGE</var> field is deferred in the variable-length deferred update data set, <var class="term">vl</var> must be greater than 28 for non-<var>FILEORG</var> X'200' files, and greater than 29 for <var>FILEORG</var> X'200' files. Using the minimum allowed values is a bad idea, in any case, and you probably want to use a value significantly greater than the minimum allowed (for example, 40 or more).</p>
 
===Setting vl to optimize performance===
===Setting vl to optimize performance===
<p>Sort performance is sensitive to the effective length (approximately, the product of the number of records and the vl parameter) of the data set to be sorted, falling as the effective length increases. The vl setting that optimizes sort performance minimizes the data set's effective length. Simply lowering vl to minimize effective length might not succeed, however.  </p>
<p>
<p>Setting vl greater than or equal to the longest deferred update record length causes each update record to be lengthened to this setting. Sort performance is hampered, because the effective length of the sort data set is increased. </p>
Sort performance is sensitive to the effective length (approximately, the product of the number of records and the <var class="term">vl</var> parameter) of the data set to be sorted, falling as the effective length increases. The <var class="term">vl</var> setting that optimizes sort performance minimizes the data set's effective length. Simply lowering <var class="term">vl</var> to minimize effective length might not succeed, however.  </p>
<p>Setting vl less than the longest deferred update record length causes records whose length is greater than or equal to vl to be spanned: broken into multiple sort records of length vl by the E15 sort exit. These additional sort records are added to the "number of records" factor of the effective length of the sort data set, and might offset the reduction to the effective length from a lower vl. Furthermore, after a record is spanned, it sorts to the end of the sorted data set, reducing the efficiency of the subsequent index loading by the Z command. </p>
<p>
Setting <var class="term">vl</var> greater than or equal to the longest deferred update record length causes each update record to be lengthened to this setting. Sort performance is hampered, because the effective length of the sort data set is increased. </p>
<p>
Setting <var class="term">vl</var> less than the longest deferred update record length causes records whose length is greater than or equal to <var class="term">vl</var> to be spanned: broken into multiple sort records of length <var class="term">vl</var> by the E15 sort exit. These additional sort records are added to the "number of records" factor of the effective length of the sort data set, and might offset the reduction to the effective length from a lower <var class="term">vl</var>. Furthermore, after a record is spanned, it sorts to the end of the sorted data set, reducing the efficiency of the subsequent index loading by the Z command. </p>
===Setting vl example===
===Setting vl example===
<p>The goal in setting vl, therefore, is to make vl as small as possible while spanning as few records as possible. For example, suppose that the variable-length deferred update data set containing ORDERED field updates consists of the following distribution of record lengths and records by the histogram produced by the FLOD command:</p>
<p>
The goal in setting <var class="term">vl</var>, therefore, is to make <var class="term">vl</var> as small as possible while spanning as few records as possible. For example, suppose that the variable-length deferred update data set containing ORDERED field updates consists of the following distribution of record lengths and records by the histogram produced by the FLOD command:</p>
<p class="code">LONGEST DEFERRED UPDATE LRECL=190
<p class="code">LONGEST DEFERRED UPDATE LRECL=190
RANGE OF LRECL NUMBER OF RECORDS
RANGE OF LRECL NUMBER OF RECORDS
Line 491: Line 701:
1-  31 0
1-  31 0
</p>
</p>
<p>The size of the longest record is 190, but this is not a very satisfactory choice for the vl parameter. The distribution is such that choosing a lower vl produces a significant decrease in the data set's effective length without adding a significant number of spanned records. The most efficient choice for vl here is 64. A large gain in sort performance is purchased at the expense of the relatively few records in the data set that do not get ordered.</p>
<p>
The size of the longest record is 190, but this is not a very satisfactory choice for the <var class="term">vl</var> parameter. The distribution is such that choosing a lower <var class="term">vl</var> produces a significant decrease in the data set's effective length without adding a significant number of spanned records. The most efficient choice for <var class="term">vl</var> here is 64. A large gain in sort performance is purchased at the expense of the relatively few records in the data set that do not get ordered.</p>
 
==Sort work data sets==
==Sort work data sets==
<p>The space needed for the sort work data sets depends on:</p>
<p>
The space needed for the sort work data sets depends on:</p>
<ul>
<ul>
<li>Sort program used</li>
<li>Sort program used</li>
<li>Number of records in the variable-length deferred update data set</li>
<li>Number of records in the variable-length deferred update data set</li>
<li>Value of vl. </li>
<li>Value of <var class="term">vl</var>. </li>
</ul>
</ul>
<p>For example, for IBM's DFSORT the recommended sum of the sizes of all the SORTWK<var class="term">xx</var> data sets is:</p>
<p>
<p class="code">2 * (number of records to be sorted) * vl
For example, for IBM's DFSORT the recommended sum of the sizes of all the SORTWK<var class="term">xx</var> data sets is:</p>
<p class="code">2 * (<i>number of records to be sorted</i>) * <i>vl</i>
</p>
</p>
<p>or:</p>
<p>
<p class="code">2 * (effective length of sort data set)  
or:</p>
<p class="code">2 * (<i>effective length of sort data set</i>)
</p>
</p>
<p>The number of records to be sorted is approximately the number of records in the variable-length deferred update data set plus the number of spanned records.</p>
<p>
<p>In the example above, with 2,800,100 records in the variable-length deferred update data set, if vl is set to 64, the effective length of the data set to be sorted is: </p>
The number of records to be sorted is approximately the number of records in the variable-length deferred update data set plus the number of spanned records.</p>
<p>
In the example above, with 2,800,100 records in the variable-length deferred update data set, if <var class="term">vl</var> is set to 64, the effective length of the data set to be sorted is: </p>
<p class="code">(2800000 + (2.&#x2217;80) + (2&#x2217;15) + (3&#x2217;5)).&#x2217; 64 = 123,215,040
<p class="code">(2800000 + (2.&#x2217;80) + (2&#x2217;15) + (3&#x2217;5)).&#x2217; 64 = 123,215,040
</p>
</p>
<p>This is about 174 cylinders (rounding up) of a 3380 disk. If you use 3 sort work data sets for sorting the variable-length deferred update data set, space parameters of 116 cylinders apiece yield a total of 348 cylinders, two times the effective length of the sort data set. </p>
<p>
This is about 174 cylinders (rounding up) of a 3380 disk. If you use 3 sort work data sets for sorting the variable-length deferred update data set, space parameters of 116 cylinders apiece yield a total of 348 cylinders, two times the effective length of the sort data set. </p>
===Installing sort exits===
===Installing sort exits===
<p>For a detailed discussion of the installation and use of sort exits, consult the sort manuals for the sort program to be used, and also see the Rocket <var class="product">Model&nbsp;204</var> installation guide for your operating system.</p>
<p>
For a detailed discussion of the installation and use of sort exits, consult the sort manuals for the sort program to be used, and also see the M204wiki [[Model 204 installation|installation page]] for your operating system.</p>
 
==Variable-length data set examples==
==Variable-length data set examples==
<p>The following examples assume that the sort exit modules or z/VM TEXT files have been given the names OI15<var class="term">xxx</var> and OI35<var class="term">xxx</var>, where <var class="term">xxx</var> is either OS for z/OS or CMS for z/VM, depending on the operating system.     </p>
<p>
The following examples assume that the sort exit modules or z/VM TEXT files have been given the names OI15<var class="term">xxx</var> and OI35<var class="term">xxx</var>, where <var class="term">xxx</var> is either OS for z/OS or CMS for z/VM, depending on the operating system. </p>
 
<b>z/OS JCL</b>
<b>z/OS JCL</b>
<p>The following z/OS JCL sorts the variable-length deferred update data set:</p>
<p>The following z/OS JCL sorts the variable-length deferred update data set:</p>
<p class="code">//SORT EXEC PGM=SORT,TIME=60,
<p class="code">//SORT EXEC PGM=SORT,TIME=60,
// REGION=200K,
//             REGION=7M,
// PARM'MSG=AP,CORE=150000'
//             PARM='MSG=AP,CORE=150000'
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTLIB   DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTMSGS DD SYSOUT=A
//SORTMSGS DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SYSOUT   DD SYSOUT=A
//CCAPRINT DD SYSOUT=A
//CCAPRINT DD SYSOUT=A
//CCAEXITS DD DSN=M204.LINKLIB,DISP=SHR
//CCAEXITS DD DSN=M204.LINKLIB,DISP=SHR
//SORTIN DD DSN=M204.DEFER.VAR.CARS,
//SORTIN   DD DSN=M204.DEFER.VAR.CARS,
// DISP=(OLD,DELETE,KEEP)
//             DISP=(OLD,DELETE,KEEP)
//SORTOUT DD DSN=M204.SORTOUT.VAR.CARS,
//SORTOUT   DD DSN=M204.SORTOUT.VAR.CARS,
// DISP=(NEW,CATLG,DELETE),UNIT=TAPE,
//             DISP=(NEW,CATLG,DELETE),UNIT=TAPE,
// DCB=(RECFM=VB,LRECL=270,BLKSIZE=15476)
//             DCB=(RECFM=VB,LRECL=270,BLKSIZE=15476)
//SORTWK01 DD SPACE=(CYL,3,,CONTIG),
//SORTWK01 DD SPACE=(CYL,3,,CONTIG),
// UNIT=3380
//             UNIT=3380
//SORTWK02 DD SPACE=(CYL,3,,CONTIG),
//SORTWK02 DD SPACE=(CYL,3,,CONTIG),
// UNIT=(3380,SEP=SORTWK01)
//             UNIT=(3380,SEP=SORTWK01)
//SORTWK03 DD SPACE=(CYL,3,,CONTIG),
//SORTWK03 DD SPACE=(CYL,3,,CONTIG),
// UNIT=(3380,(SEP=SORTWK01,SORTWK02))
//             UNIT=(3380,(SEP=SORTWK01,SORTWK02))
//CCAIN DD *
//CCAIN     DD *
  SORT FIELDS=(5,75,CH,A)
  SORT FIELDS=(5,75,CH,A)
  RECORD TYPE=V,LENGTH=(270,80,270,80)
  RECORD TYPE=V,LENGTH=(270,80,270,80)
  MODS E15=(OI15OS,1800,CCAEXITS,N),E35=(OI35OS,1300,
  MODS E15=(OI15OS,1800,CCAEXITS,N),E35=(OI35OS,1300,CCAEXITS,N)
            CCAEXITS,N)
  END
END
/*
/*
//SYSIN DD *
//SYSIN     DD *
  SORT FIELDS=(5,75,CH,A)
  SORT FIELDS=(5,75,CH,A)
  RECORD TYPE=V,LENGTH=(270,80,270,80)
  RECORD TYPE=V,LENGTH=(270,80,270,80)
  MODS E15=(OI15OS,1800,CCAEXITS,N),E35=(OI35OS,1300,
  MODS E15=(OI15OS,1800,CCAEXITS,N),E35=(OI35OS,1300,CCAEXITS,N)
            CCAEXITS,N)
  END
END
/*
/*
</p>
</p>
<p>Many installations provide cataloged procedures that contain most of the above JCL. Check the sort package documentation for the definitive forms of the sort control statements necessary at your installation.</p>
<p>
Many installations provide cataloged procedures that contain most of the above JCL. Check the sort package documentation for the definitive forms of the sort control statements necessary at your installation.</p>
 
<b>z/VSE JCL</b>
<b>z/VSE JCL</b>
<p>The following z/VSE JCL sorts the variable-length deferred update data set:</p>
<p>
The following z/VSE JCL sorts the variable-length deferred update data set:</p>
<p class="code">// TLBL SORTIN1,'M204.DEFERV.CARS'
<p class="code">// TLBL SORTIN1,'M204.DEFERV.CARS'
// ASSGN SYS002,TAPE
// ASSGN SYS002,TAPE
// TLBL SORTOUT,'M204.SORTVAR.CARS'
// TLBL SORTOUT,'M204.SORTVAR.CARS'
// ASSGN SYS001,TAPE
// ASSGN SYS001,TAPE
sort work statements                Specify SORTWK1 through  
sort work statements                Specify SORTWK1 through
.                                    SORTWKn for sort work
.                                    SORTWKn for sort work
.                                    data sets
.                                    data sets
Line 573: Line 797:
/&amp;
/&amp;
</p>
</p>
==Applying the variable-length deferred updates==
==Applying the variable-length deferred updates==
<p>Apply the variable-length deferred updates, using the [[#Z command|Z command]].  
<p>
Apply the variable-length deferred updates, using the [[#Z command|Z command]].
The <var>Z</var> command:</p>
<ul>
<li>Processes the sorted output from the sort of the variable-length deferred update data set.</li>


The Z command:</p>
<ul>
<li>Processes the sorted output from the sort of the variable-length deferred update data set</li>
<li>Adds the Ordered Index information to Table D. </li>
<li>Adds the Ordered Index information to Table D. </li>
<li>If any KEY and/or NUMERIC RANGE deferred update records are also in the variable-length deferred update data set, the Z command adds this KEY and/or NUMERIC RANGE retrieval index information to Tables C and D. </li>
 
<li>If there are KEY field updates in the variable-length deferred update data set, and any of the KEY fields updated also have the FRV attribute, the Z command creates an additional deferred update data set, an FRV data set, that is processed in later job steps. </li>
<li>If any <var>KEY</var> and/or <var>NUMERIC RANGE</var> deferred update records are also in the variable-length deferred update data set, the <var>Z</var> command adds this <var>KEY</var> and/or <var>NUMERIC RANGE</var> retrieval index information to Tables C and D. </li>
 
<li>If there are <var>KEY</var> field updates in the variable-length deferred update data set, and any of the <var>KEY</var> fields updated also have the <var>FRV</var> attribute, the <var>Z</var> command creates an additional deferred update data set, an <var>FRV</var> data set, that is processed in later job steps. </li>
</ul>
</ul>
<p>For more information on the FRV deferred update data set, see [[#Applying the FRV deferred updates|Applying the FRV deferred updates]].         </p>
<p>
For more information on the <var>FRV</var> deferred update data set, see [[#Applying the FRV deferred updates|Applying the FRV deferred updates]]. </p>
 
<b>z/OS JCL</b>
<b>z/OS JCL</b>
<p>The JCL to apply the variable-length deferred index updates for z/OS follows:</p>
<p>The JCL to apply the variable-length deferred index updates for z/OS follows:</p>
Line 590: Line 821:
                   provided by the Model 204
                   provided by the Model 204
                   system manager to run BATCH204.
                   system manager to run BATCH204.
//CARS DD DSN=M204.FILE.CARS,DISP=SHR
//CARS     DD DSN=M204.FILE.CARS,DISP=SHR
//SORT5 DD DSN=M204.SORTOUT.VAR.CARS,
//SORT5     DD DSN=M204.SORTOUT.VAR.CARS,
// DISP=(OLD,DELETE,KEEP)
//             DISP=(OLD,DELETE,KEEP)
//TAPE5 DD DUMMY,DCB=BLKSIZE=24
//TAPE5     DD DUMMY,DCB=BLKSIZE=24
//CCAIN DD *
//CCAIN     DD *
user zero parameters
user zero parameters
LOGIN userid
LOGIN userid
Line 604: Line 835:
/*
/*
</p>
</p>
<p>If both a fixed- and a variable-length data set are supplied for the deferred updates, then TAPE5 is not used when applying the variable-length updates and should point to a dummy data set when applying the variable-length updates.</p>
<p>
If both a fixed- and a variable-length data set are supplied for the deferred updates, then TAPE5 is not used when applying the variable-length updates and should point to a dummy data set when applying the variable-length updates.</p>
<p>If a fixed-length deferred update data set exists, the FRV deferred updates are generated when the fixed-length deferred updates are applied. </p>
<p>If a fixed-length deferred update data set exists, the FRV deferred updates are generated when the fixed-length deferred updates are applied. </p>
<p>If only a variable-length data set is supplied for the deferred updates, and any FRV fields are updated during the first phase step, then an FRV deferred update data set must be provided with the TAPE5 <var class="term">ddname</var> so that <var class="product">Model&nbsp;204</var> can write out the FRV deferred updates to this data set.</p>
<p>
If only a variable-length data set is supplied for the deferred updates, and any FRV fields are updated during the first phase step, then an FRV deferred update data set must be provided with the TAPE5 <var class="term">ddname</var> so that <var class="product">Model&nbsp;204</var> can write out the FRV deferred updates to this data set.</p>
 
<b>z/VSE JCL</b>
<b>z/VSE JCL</b>
<p>The JCL to apply the variable-length deferred index updates for z/VSE follows:</p>
<p>
The JCL to apply the variable-length deferred index updates for z/VSE follows:</p>
<p class="code">// DLBL CARS,'M204.FILE.CARS',,DA
<p class="code">// DLBL CARS,'M204.FILE.CARS',,DA
// EXTENT SYSnnn,volser
// EXTENT SYSnnn,volser
Line 632: Line 867:


==FRV deferred update data set==
==FRV deferred update data set==
<p>The FRV (For Each Value) deferred update data set is very similar to a fixed-length deferred update data set. One 24-byte record is written to the FRV deferred update data set for every new value of an FRV field that is stored in Tables C and D during the Z command processing. Unless the <var class="product">Model&nbsp;204</var> file being updated has many FRV fields or an FRV field is also MANY-VALUED, the FRV deferred update data set is fairly small. </p>
<p>
The FRV (For Each Value) deferred update data set is very similar to a fixed-length deferred update data set. One 24-byte record is written to the FRV deferred update data set for every new value of an FRV field that is stored in Tables C and D during the Z command processing. Unless the <var class="product">Model&nbsp;204</var> file being updated has many FRV fields or an FRV field is also MANY-VALUED, the FRV deferred update data set is fairly small. </p>
===Determining the FRV step===
===Determining the FRV step===
<p>The number and type of deferred update data sets specified in the OPEN command or IFOPEN call in the first phase of deferred data set processing determines when the FRV defined data set is generated.</p>
<p>
<p>If a fixed-length deferred update data set was specified on the OPEN command or IFOPEN call in the first phase step, and an FRV field was updated, the FRV deferred update data set is generated when the fixed-length deferred updates are applied (in other words, during the execution of the Z command that applies the fixed-length deferred updates). </p>
The number and type of deferred update data sets specified in the OPEN command or IFOPEN call in the first phase of deferred data set processing determines when the FRV defined data set is generated.</p>
<p>If no fixed-length deferred update data set was specified in the OPEN command or IFOPEN call, but a variable-length deferred update data set was specified, and an FRV field was updated, the FRV deferred update data set is generated when the variable-length deferred updates are applied-in other words, during the execution of the Z command that applies the variable-length deferred updates. </p>
<p>
If a fixed-length deferred update data set was specified on the OPEN command or IFOPEN call in the first phase step, and an FRV field was updated, the FRV deferred update data set is generated when the fixed-length deferred updates are applied (in other words, during the execution of the Z command that applies the fixed-length deferred updates). </p>
<p>
If no fixed-length deferred update data set was specified in the OPEN command or IFOPEN call, but a variable-length deferred update data set was specified, and an FRV field was updated, the FRV deferred update data set is generated when the variable-length deferred updates are applied-in other words, during the execution of the Z command that applies the variable-length deferred updates. </p>
===Creating the FRV deferred update data set===
===Creating the FRV deferred update data set===
<p>The FRV deferred update data set is always named TAPE5. It can be placed either on magnetic tape or on a direct access device.</p>
<p>
The FRV deferred update data set is always named TAPE5. It can be placed either on magnetic tape or on a direct access device.</p>
 
<b>DCB parameters</b>
<b>DCB parameters</b>
<p>The default parameters are:</p>
<p>
The default parameters are:</p>
<p class="code">RECFM=FB
<p class="code">RECFM=FB
LRECL=24
LRECL=24
BLKSIZE=6000  
BLKSIZE=6000
</p>
</p>
<p>For z/VSE installations, TAPE5 must be allocated (see [[File size calculation]] ). Under z/OS, no additional action regarding TAPE5 need be taken.</p>
<p>
<p>You can specify the BLKSIZE subparameter explicitly. A full disk track is recommended. z/VSE users can specify TAPE5's block size using the DEFINE DATASET command. </p>
For z/VSE installations, TAPE5 must be allocated. Under z/OS, no additional action regarding TAPE5 need be taken.</p>
<p>
You can specify the BLKSIZE subparameter explicitly. A full disk track is recommended. z/VSE users can specify TAPE5's block size using the DEFINE DATASET command. </p>
===Sorting the FRV deferred update data set===
===Sorting the FRV deferred update data set===
<p>The FRV deferred update data set is sorted after the step that created the FRV deferred update data set. The FRV deferred update records are 24 bytes long and must be sorted in ascending order by the first 16 bytes using the standard EBCDIC collating sequence.</p>
<p>
<p>Determine the number of records in the FRV deferred update data set by checking statistics of the Z command that created the FRV deferred update data set. The FRV statistic records the number of FRV deferred update records written to the FRV deferred update data set. </p>
The FRV deferred update data set is sorted after the step that created the FRV deferred update data set. The FRV deferred update records are 24 bytes long and must be sorted in ascending order by the first 16 bytes using the standard EBCDIC collating sequence.</p>
<p>Any sort utility can be used to perform the sort of the FRV deferred update data set. The basic JCL for the IBM SORT Utility follows. Refer to the appropriate IBM manual for additional information.</p>
<p>
Determine the number of records in the FRV deferred update data set by checking statistics of the Z command that created the FRV deferred update data set. The FRV statistic records the number of FRV deferred update records written to the FRV deferred update data set. </p>
<p>
Any sort utility can be used to perform the sort of the FRV deferred update data set. The basic JCL for the IBM SORT Utility follows. Refer to the appropriate IBM manual for additional information.</p>
===SORTIN and SORTOUT===
===SORTIN and SORTOUT===
<p>SORTIN is the FRV deferred update data set.</p>
<p>
<p>Specify SORTOUT in the same way as in the step in which it was created. In z/OS and z/VM, set DCB subparameters explicitly. The following DCB subparameters are recommended:   </p>
SORTIN is the FRV deferred update data set.</p>
<p>Specify SORTOUT in the same way as in the step in which it was created. In z/OS and z/VM, set DCB subparameters explicitly. The following DCB subparameters are recommended:</p>
<p class="code">RECFM=FB
<p class="code">RECFM=FB
LRECL=24  
LRECL=24
BLKSIZE=15476 (1/3 track on a 3380 disk)  
BLKSIZE=27998 (1/2 track on a 3390 disk)
</p>
</p>
<p>In z/VSE, the physical record format for the SORTIN data set is specified using the SORT program's RECORD statement.</p>
<p>
In z/VSE, the physical record format for the SORTIN data set is specified using the SORT program's RECORD statement.</p>
 
===SORT control statement examples===
===SORT control statement examples===
<p>The following SYSIN control statement example sorts FRV deferred update records in z/OS: </p>
<p>
The following SYSIN control statement example sorts FRV deferred update records in z/OS: </p>
 
<b>z/OS</b>
<b>z/OS</b>
<p class="code">SORT FIELDS=(1,16,CH,A),SIZE=E<var class="term">n</var>
<p class="code">SORT FIELDS=(1,16,CH,A),SIZE=E<var class="term">n</var>
</p>
</p>
<p>where:</p>
<p>
<p><var class="term">n</var> is the value of the FRV statistic taken from the output of the Z command that created the FRV deferred update data set. </p>
Where:</p>
<p>
<var class="term">n</var> is the value of the FRV statistic taken from the output of the Z command that created the FRV deferred update data set. </p>
<b>z/VSE</b>
<b>z/VSE</b>
<p>For z/VSE, the SYSIPT control statement is as follows: </p>
<p>
<p class="code">SORT FIELDS=(1,16,CH,A),SIZE=En  
For z/VSE, the SYSIPT control statement is as follows: </p>
<p class="code">SORT FIELDS=(1,16,CH,A),SIZE=En
RECORD TYPE=F,LENGTH=24
RECORD TYPE=F,LENGTH=24
INPFIL BLKSIZE=blocksize of SORTIN
INPFIL BLKSIZE=blocksize of SORTIN
OUTFIL BLKSIZE=blocksize of SORTOUT
OUTFIL BLKSIZE=blocksize of SORTOUT
</p>
</p>
===Sort work data sets for the FRV deferred update data set===
===Sort work data sets for the FRV deferred update data set===
<p>The amount of space needed for the sort work data sets for the FRV deferred update data set is calculated in the same way as for the sort work data sets for the fixed-length deferred update data set. See [[#Sort work data sets for the fixed-length deferred update data set|Sort work data sets for the fixed-length deferred update data set]].  </p>
<p>
The amount of space needed for the sort work data sets for the FRV deferred update data set is calculated in the same way as for the sort work data sets for the fixed-length deferred update data set. See [[#Sort work data sets for the fixed-length deferred update data set|Sort work data sets for the fixed-length deferred update data set]].  </p>
 
<b>z/OS JCL</b>
<b>z/OS JCL</b>
<p>The following z/OS JCL sorts the FRV deferred update data set:</p>
<p>The following z/OS JCL sorts the FRV deferred update data set:</p>
<p class="code">//SORT EXEC PGM=SORT,TIME=60,
<p class="code">//SORT EXEC PGM=SORT,TIME=60,
// REGION=200K,
// REGION=7M,
// PARM'MSG=AP,CORE=150000'
// PARM='MSG=AP,CORE=150000'
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTLIB   DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTMSGS DD SYSOUT=A
//SORTMSGS DD SYSOUT=A
//SYSOUT DD SYSOUT=A
//SYSOUT   DD SYSOUT=A
//SORTIN DD DSN=M204.TAPE5.CARS,
//SORTIN   DD DSN=M204.TAPE5.CARS,
// DISP=(OLD,DELETE,KEEP)
//             DISP=(OLD,DELETE,KEEP)
//SORTOUT DD DSN=M204.SORTOUT.FRV.CARS,
//SORTOUT   DD DSN=M204.SORTOUT.FRV.CARS,
// DISP=(NEW,CATLG,DELETE),UNIT=TAPE,
//             DISP=(NEW,CATLG,DELETE),UNIT=TAPE,
// DCB=(RECFM=FB,LRECL=24,BLKSIZE=15476)
//             DCB=(RECFM=FB,LRECL=24,BLKSIZE=15476)
//SORTWK01 DD SPACE=(CYL,1),
//SORTWK01 DD SPACE=(CYL,1),
// UNIT=3380
//             UNIT=3380
//SORTWK02 DD SPACE=(CYL,1),
//SORTWK02 DD SPACE=(CYL,1),
// UNIT=(3380,SEP=SORTWK01)
//             UNIT=(3380,SEP=SORTWK01)
//SORTWK03 DD SPACE=(CYL,1),
//SORTWK03 DD SPACE=(CYL,1),
// UNIT=(3380,(SEP=SORTWK01,SORTWK02))
//             UNIT=(3380,(SEP=SORTWK01,SORTWK02))
//SYSIN DD *
//SYSIN     DD *
  SORT FIELDS=(1,16,CH,A),SIZE=E100
  SORT FIELDS=(1,16,CH,A),SIZE=E100
/*
/*
</p>
</p>
<p>Many sites provide cataloged procedures that contain most of the above JCL.</p>
<p>
Many sites provide cataloged procedures that contain most of the above JCL.</p>
 
<b>z/VSE JCL</b>
<b>z/VSE JCL</b>
<p>The following z/VSE JCL sorts the FRV deferred update data set:</p>
<p>
The following z/VSE JCL sorts the FRV deferred update data set:</p>
<p class="code">// TLBL SORTIN1,'M204.TAPE5.CARS'
<p class="code">// TLBL SORTIN1,'M204.TAPE5.CARS'
// ASSGN SYS002,TAPE
// ASSGN SYS002,TAPE
Line 709: Line 974:
.                              <i>data sets</i>
.                              <i>data sets</i>
.
.
// EXEC SORT,SIZE=100K
// EXEC SORT,SIZE=1M
  SORT FIELDS=(1,16,CH,A),WORK=n        <i>n is number of</i>  
  SORT FIELDS=(1,16,CH,A),WORK=n        <i>n is number of</i>
                                       <i>sort work data sets</i>
                                       <i>sort work data sets</i>
  RECORD TYPE=F,LENGTH=24
  RECORD TYPE=F,LENGTH=24
Line 716: Line 981:
  OUTFIL BLKSIZE=1680
  OUTFIL BLKSIZE=1680
/*
/*
/&amp;
</p>
</p>


==Applying the FRV deferred updates==
==Applying the FRV deferred updates==
<p>To apply the FRV deferred updates, use the [[#Z command|Z command]].  
<p>
To apply the FRV deferred updates, use the [[#Z command|Z command]].
The Z command:</p>
The Z command:</p>
<ul>
<ul>
<li>Processes the sorted output from the sort of the FRV deferred update data set</li>
<li>Processes the sorted output from the sort of the FRV deferred update data set</li>
<li>Adds the FRV retrieval index information to Tables C and D. </li>
<li>Adds the FRV retrieval index information to Tables C and D. </li>
</ul>
</ul>
<p>Applying the FRV deferred updates is much like applying the fixed-length deferred updates, except that:</p>
<p>
Applying the FRV deferred updates is much like applying the fixed-length deferred updates, except that:</p>
<ul>
<ul>
<li>SORT5 points to the sorted FRV deferred update data set.</li>
<li>SORT5 points to the sorted FRV deferred update data set.</li>
<li>TAPE5, under z/OS, points to a dummy data set that has DCB=BLKSIZE=24. Under z/VM, TAPE5 is a dummy file; under z/VSE, it must not be a dummy file.   </li>
 
<li>TAPE5, under z/OS, points to a dummy data set that has DCB=BLKSIZE=24. Under z/VM, TAPE5 is a dummy file; under z/VSE, it must not be a dummy file. </li>
</ul>
</ul>
<b>SPCORE</b>
<b>SPCORE</b>
<p>Set the SPCORE parameter large enough to open the <var class="product">Model&nbsp;204</var> file and to accommodate both the input buffer for SORT5 and the output buffer for TAPE5 along with other structures. See [[#Setting the SPCORE parameter|Setting the SPCORE parameter]].</p>
<p>
Set the SPCORE parameter large enough to open the <var class="product">Model&nbsp;204</var> file and to accommodate both the input buffer for SORT5 and the output buffer for TAPE5 along with other structures. See [[#Setting the SPCORE parameter|Setting the SPCORE parameter]].</p>
 
<b>z/OS JCL</b>
<b>z/OS JCL</b>
<p>The z/OS JCL to apply the FRV deferred updates for z/OS follows:</p>
<p>The z/OS JCL to apply the FRV deferred updates for z/OS follows:</p>
Line 739: Line 1,010:
                                   <i>provided by the Model 204</i>
                                   <i>provided by the Model 204</i>
                               <i>system manager to run BATCH204.</i>
                               <i>system manager to run BATCH204.</i>
//CARS DD DSN=M204.FILE.CARS,DISP=SHR
//CARS     DD DSN=M204.FILE.CARS,DISP=SHR
//SORT5 DD DSN=M204.SORTOUT.FRV.CARS,
//SORT5     DD DSN=M204.SORTOUT.FRV.CARS,
// DISP=(OLD,DELETE,KEEP)
//             DISP=(OLD,DELETE,KEEP)
//TAPE5 DD DUMMY,DCB=BLKSIZE=24
//TAPE5     DD DUMMY,DCB=BLKSIZE=24
                               <i>TAPE5 points to a dummy data set</i>
                               <i>TAPE5 points to a dummy data set</i>
                                 <i>because no new FRV deferred</i>
                                 <i>because no new FRV deferred</i>
                                   <i>updates will be created.</i>
                                   <i>updates will be created.</i>
//CCAIN DD *
//CCAIN     DD *
user zero parameters
user zero parameters
LOGIN userid
LOGIN userid
Line 756: Line 1,027:
/*
/*
</p>
</p>
<b>z/VSE JCL</b>
<b>z/VSE JCL</b>
<p>The z/VSE JCL to apply the FRV deferred updates for z/VSE follows:</p>
<p>
The z/VSE JCL to apply the FRV deferred updates for z/VSE follows:</p>
<p class="code">// DLBL CARS,'M204.FILE.CARS',,DA
<p class="code">// DLBL CARS,'M204.FILE.CARS',,DA
// EXTENT SYSnnn,volser
// EXTENT SYSnnn,volser
Line 784: Line 1,057:


==z/VM deferred update example==
==z/VM deferred update example==
===Using deferred updates with FASTLOAD to load files===
===Using deferred updates with FASTLOAD to load files===
<p>The most common use of the deferred update feature is to load files. The z/VM FASTLOAD driver EXEC, distributed with the <var class="product">Model&nbsp;204</var> installation, incorporates the deferred update procedure into the file loading process. The FASTLOAD EXEC can initiate a multistep deferred update procedure that is as many job-steps (seven, five, three, or one) as required.  </p>
<p>
<p>The FASTLOAD EXEC accepts as parameters the name of another EXEC, such as DEFUPD in the following example, and the type (number of deferred update procedure job steps) of FASTLOAD to execute. DEFUPD EXEC is used by the driver to define the files to be used for each FASTLOAD step and to invoke <var class="product">Model&nbsp;204</var> when necessary. </p>
The most common use of the deferred update feature is to load files. The z/VM FASTLOAD driver EXEC, distributed with the <var class="product">Model&nbsp;204</var> installation, incorporates the deferred update procedure into the file loading process. The FASTLOAD EXEC can initiate a multistep deferred update procedure that is as many job-steps (seven, five, three, or one) as required.  </p>
<p>
The FASTLOAD EXEC accepts as parameters the name of another EXEC, such as DEFUPD in the following example, and the type (number of deferred update procedure job steps) of FASTLOAD to execute. DEFUPD EXEC is used by the driver to define the files to be used for each FASTLOAD step and to invoke <var class="product">Model&nbsp;204</var> when necessary. </p>
===FASTLOAD EXEC format===
===FASTLOAD EXEC format===
<p>The format of the FASTLOAD command is:</p>
<p>
The format of the FASTLOAD command is:</p>
 
<b>Syntax</b>
<b>Syntax</b>
<p class="code">FASTLOAD [TEST] [NODCSS] <var class="term">EXECname</var> [NUM] [(<var class="term">option</var>[)]]
<p class="syntax">FASTLOAD [TEST] [NODCSS] <span class="term">EXECname</span> [NUM] [(<span class="term">option</span>[)]]
</p>
</p>
<p>If no option is specified, 5STEP is the default.</p>
<p>
<p>where:</p>
If no option is specified, 5STEP is the default.</p>
<p>TEST specifies a test version of the <var class="product">Model&nbsp;204</var> ONLINE module or shared segment-that is, T204. If TEST is not specified, the production version-that is, M204 is invoked.</p>
<p>
<p>NODCSS specifies that shared segments are not to be used, even though they exist.</p>
where:</p>
<p><var class="term">EXECname</var> specifies the name of an EXEC procedure that provides the file definitions and other logic required to prepare a deferred update or File Load utility job. The EXEC procedure is invoked once before each step of the deferred update process, and during FASTLOAD command initialization.</p>
<ul>
<p>NUM specifies the number, from 1 through 7, of the step to begin with in case of a restart.</p>
<li>TEST specifies a test version of the <var class="product">Model&nbsp;204</var> ONLINE module or shared segment-that is, T204. If TEST is not specified, the production version-that is, M204 is invoked.</li>
<p><var class="term">option</var> is one of the following:</p>
 
<li>NODCSS specifies that shared segments are not to be used, even though they exist.</li>
 
<li><var class="term">EXECname</var> specifies the name of an EXEC procedure that provides the file definitions and other logic required to prepare a deferred update or File Load utility job. The EXEC procedure is invoked once before each step of the deferred update process, and during FASTLOAD command initialization.</li>
 
<li>NUM specifies the number, from 1 through 7, of the step to begin with in case of a restart.</li>
 
<li><var class="term">option</var> is one of the following:
<table>
<table>
<tr class="head">
<tr class="head">
Line 804: Line 1,090:
<th>Indicates...</th>
<th>Indicates...</th>
</tr>
</tr>
<tr>
<tr>
<td>7STEP </td>
<td>7STEP </td>
<td>Seven-step job </td>
<td>Seven-step job </td>
</tr>
</tr>
<tr>
<tr>
<td>5STEP</td>
<td>5STEP</td>
<td>Five-step job</td>
<td>Five-step job</td>
</tr>
</tr>
<tr>
<tr>
<td>3STEP</td>
<td>3STEP</td>
<td>Three-step job</td>
<td>Three-step job</td>
</tr>
</tr>
<tr>
<tr>
<td>1STEP</td>
<td>1STEP</td>
<td>One-step job</td>
<td>One-step job</td>
</tr>
</tr>
</table>
</table></li>
</ul>
 
<b>Setting parameters in the FASTLOAD EXEC</b>
<b>Setting parameters in the FASTLOAD EXEC</b>
<p>Parameters required to invoke <var class="product">Model&nbsp;204</var> are set in the EXEC procedure called by the FASTLOAD EXEC. These parameters must be placed in the stack using the &amp;STACK command as keyword-value pairs, separated by blanks, during Steps 1, 3, 5, and 7. The only operand provided to the EXEC called by the FASTLOAD EXEC is the step number.</p>
<p>
Parameters required to invoke <var class="product">Model&nbsp;204</var> are set in the EXEC procedure called by the FASTLOAD EXEC. These parameters must be placed in the stack using the &amp;STACK command as keyword-value pairs, separated by blanks, during Steps 1, 3, 5, and 7. The only operand provided to the EXEC called by the FASTLOAD EXEC is the step number.</p>
===FASTLOAD EXEC example===
<p>
In the following example, the FASTLOAD EXEC calls DEFUPD and passes it the parameter for the step number to be executed. The DEFUPD EXEC concatenates the passed parameter (&amp;1, for example) with the step name (FLOAD) in a &amp;GOTO statement. This numbering and consequent program flow simulate the job steps in the previous z/OS and z/VSE examples.</p>


===FASTLOAD EXEC example===
<p>In the following example, the FASTLOAD EXEC calls DEFUPD and passes it the parameter for the step number to be executed. The DEFUPD EXEC concatenates the passed parameter (&amp;1, for example) with the step name (FLOAD) in a &amp;GOTO statement. This numbering and consequent program flow simulate the job steps in the previous z/OS and z/VSE examples.</p>
<b>z/VM EXEC</b>
<b>z/VM EXEC</b>
<p>Enter the following command to run the example:</p>
<p>
Enter the following command to run the example:</p>
<p class="code">FASTLOAD DEFUPD (7STEP
<p class="code">FASTLOAD DEFUPD (7STEP
</p>
</p>
<p>The DEFUPD EXEC appears below, followed by a step-by-step explanation of the EXEC and the files defined in each step.</p>
<p>
The DEFUPD EXEC appears below, followed by a step-by-step explanation of the EXEC and the files defined in each step.</p>
<p class="code">&amp;CONTROL OFF
<p class="code">&amp;CONTROL OFF
&amp;ERROR &amp;EXIT &amp;RETCODE
&amp;ERROR &amp;EXIT &amp;RETCODE
 
&amp;IF &amp;1 EQ 0 &amp;GOTO -ACCESS
&amp;IF &amp;1 EQ 0 &amp;GOTO -ACCESS
FILEDEF * CLEAR
FILEDEF * CLEAR
&amp;GOTO -FLOAD&amp;1
&amp;GOTO -FLOAD&amp;1
 
<b></b>-ACCESS
<b></b>-ACCESS
RELEASE M
RELEASE M
ACCESS 201 M
ACCESS 201 M
&amp;EXIT
&amp;EXIT
 
<b></b>-FLOAD1
<b></b>-FLOAD1
FILEDEF TAPECARF TAP1 SL ( BLOCK 2400 LRECL 24 RECFM FB
FILEDEF TAPECARF TAP1 SL ( BLOCK 2400 LRECL 24 RECFM FB
Line 850: Line 1,147:
FILEDEF CCAIN DISK DEFUPD CCAIN1 *
FILEDEF CCAIN DISK DEFUPD CCAIN1 *
&amp;GOTO -COMMON
&amp;GOTO -COMMON
 
<b></b>-FLOAD2
<b></b>-FLOAD2
LABELDEF SORTIN1 VOLID 123456
LABELDEF SORTIN1 VOLID 123456
SSORT TAP1 CARS DEFSORT W DEFUPDF SORTCTRL B
SSORT TAP1 CARS DEFSORT W DEFUPDF SORTCTRL B
&amp;EXIT &amp;RC
&amp;EXIT &amp;RC
 
<b></b>-FLOAD3
<b></b>-FLOAD3
FILEDEF SORT5 DISK CARS DEFSORT W
FILEDEF SORT5 DISK CARS DEFSORT W
Line 862: Line 1,159:
FILEDEF CARS M DSN M204DB CARS
FILEDEF CARS M DSN M204DB CARS
&amp;GOTO -COMMON
&amp;GOTO -COMMON
 
<b></b>-FLOAD4
<b></b>-FLOAD4
FILEDEF CCAIN DISK DEFUPDV SORTCTRL B
FILEDEF CCAIN DISK DEFUPDV SORTCTRL B
Line 868: Line 1,165:
SSORT CARS DEFV W CARS SORTVAR W DEFUPDV SORTCTRL B
SSORT CARS DEFV W CARS SORTVAR W DEFUPDV SORTCTRL B
&amp;EXIT &amp;RC
&amp;EXIT &amp;RC
 
<b></b>-FLOAD5
<b></b>-FLOAD5
FILEDEF SORT5 DISK CARS SORTVAR W
FILEDEF SORT5 DISK CARS SORTVAR W
Line 875: Line 1,172:
FILEDEF CARS M DSN M204DB CARS
FILEDEF CARS M DSN M204DB CARS
&amp;GOTO -COMMON
&amp;GOTO -COMMON
 
  -FLOAD6
  -FLOAD6
SSORT CARS FRV W CARS FRVSORT W FASTLOAD SORTCTRL C
SSORT CARS FRV W CARS FRVSORT W FASTLOAD SORTCTRL C
&amp;EXIT &amp;RC
&amp;EXIT &amp;RC
 
<b></b>-FLOAD7
<b></b>-FLOAD7
FILEDEF SORT5 DISK CARS FRVSORT W
FILEDEF SORT5 DISK CARS FRVSORT W
Line 887: Line 1,184:
&amp;GOTO -COMMON
&amp;GOTO -COMMON
&amp;EXIT
&amp;EXIT
 
<b></b>-COMMON
<b></b>-COMMON
 
FILEDEF CCAPRINT DISK DEFUPD&amp;1 CCAPRINT A
FILEDEF CCAPRINT DISK DEFUPD&amp;1 CCAPRINT A
FILEDEF CCAAUDIT DISK DEFUPD&amp;1 CCAAUDIT A
FILEDEF CCAAUDIT DISK DEFUPD&amp;1 CCAAUDIT A
Line 898: Line 1,195:
&amp;EXIT
&amp;EXIT
</p>
</p>
===Description of steps===
===Description of steps===
<p>The task performed and the files defined in each step are as follows.</p>
<p>
The task performed and the files defined in each step are as follows.</p>
<b>Step 1</b>
<b>Step 1</b>
<p>Update database file CARS in deferred update mode. The files defined are:</p>
<p>
<table>
Update database file CARS in deferred update mode. The files defined are:</p>
<table style="width:80%">
<tr>
<tr>
<td>TAPECARF</td>
<td>TAPECARF</td>
<td>
<td>
Fixed-length deferred update data set, defined to go to a standard label tape. A LABELDEF command defines the volume serial number.  
Fixed-length deferred update data set, defined to go to a standard label tape. A LABELDEF command defines the volume serial number.
<p>When <var class="product">Model&nbsp;204</var> uses a tape, it executes the M204MOUN EXEC to tell an operator to mount the volume label specified in the LABELDEF. The M204UNLD EXEC is executed at the end of tape processing to issue the appropriate z/VM TAPE command function. The version of M204UNLD distributed has a TAPE RUN command. Change this to TAPE REW to run this example.</p>
<p>
When <var class="product">Model&nbsp;204</var> uses a tape, it executes the M204MOUN EXEC to tell an operator to mount the volume label specified in the LABELDEF. The M204UNLD EXEC is executed at the end of tape processing to issue the appropriate z/VM TAPE command function. The version of M204UNLD distributed has a TAPE RUN command. Change this to TAPE REW to run this example.</p>
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>TAPECARV</td>
<td>TAPECARV</td>
<td>Variable-length deferred update data set.</td>
<td>Variable-length deferred update data set.</td>
</tr>
</tr>
<tr>
<tr>
<td>CARS</td>
<td>CARS</td>
<td><var class="product">Model&nbsp;204</var> database file being updated. The file is defined on a z/OS minidisk.</td>
<td><var class="product">Model&nbsp;204</var> database file being updated. The file is defined on a z/OS minidisk.</td>
</tr>
</tr>
<tr>
<tr>
<td>CCAIN</td>
<td>CCAIN</td>
Line 923: Line 1,228:
</tr>
</tr>
</table>
</table>
<b>Step 2</b>
<b>Step 2</b>
<p>Sort the fixed-length deferred update file that has been written in Step 1. This example uses SYNCSORT, which is able to read tape input. A LABELDEF is needed to define the volume serial number.</p>
<p>
<p>The SYSIN file to the sort is DEFUPDF SORTCTRL. See the DEFUPD EXEC for the control statement format.  </p>
Sort the fixed-length deferred update file that has been written in Step 1. This example uses SYNCSORT, which is able to read tape input. A LABELDEF is needed to define the volume serial number.</p>
<p>
The SYSIN file to the sort is DEFUPDF SORTCTRL. See the DEFUPD EXEC for the control statement format.  </p>
 
<b>Step 3</b>
<b>Step 3</b>
<p>Execute the first Z command to apply the fixed-length deferred updates. The files defined are:</p>
<p>
<table>
Execute the first Z command to apply the fixed-length deferred updates. The files defined are:</p>
 
<table style="width:80%">  
<tr>
<tr>
<td>SORT5</td>
<td>SORT5</td>
<td>Sorted fixed-length deferred update data set.</td>
<td>Sorted fixed-length deferred update data set.</td>
</tr>
</tr>
<tr>
<tr>
<td>TAPE5</td>
<td>TAPE5</td>
<td>FRV deferred update data set.</td>
<td>FRV deferred update data set.</td>
</tr>
</tr>
<tr>
<tr>
<td>CCAIN</td>
<td>CCAIN</td>
<td>z/VM disk file, DEFUPD CCAIN3,containing the commands to open and update the file CARS. A file listing follows the EXEC.</td>
<td>z/VM disk file, DEFUPD CCAIN3,containing the commands to open and update the file CARS. A file listing follows the EXEC.</td>
</tr>
</tr>
<tr>
<tr>
<td>CARS </td>
<td>CARS </td>
Line 946: Line 1,260:
</tr>
</tr>
</table>
</table>
<b>Step 4</b>
<b>Step 4</b>
<p>Sort the variable-length deferred update data set. This example uses SYNCSORT and the sort exits OI15CMS and OI35CMS. These sort exits are provided with the installation. Typically, the sort exits are either placed in a TXTLIB or reside on an accessed disk with a filetype of TEXT.</p>
<p>
<p>The SYSIN file to the sort is DEFUPDV SORTCTRL. See the DEFUPD EXEC for the control statement format.:</p>
Sort the variable-length deferred update data set. This example uses SYNCSORT and the sort exits <code>OI15CMS</code> and <code>OI35CMS</code>. These sort exits are provided with the installation. Typically, the sort exits are either placed in a TXTLIB or reside on an accessed disk with a filetype of TEXT.</p>
<p>
The SYSIN file to the sort is DEFUPDV SORTCTRL. See the DEFUPD EXEC for the control statement format.:</p>
 
<table>
<table>
<tr>
<tr>
Line 954: Line 1,272:
<td>Sort control statements (same as SYSIN).</td>
<td>Sort control statements (same as SYSIN).</td>
</tr>
</tr>
<tr>
<tr>
<td>CCAPRINT</td>
<td>CCAPRINT</td>
Line 959: Line 1,278:
</tr>
</tr>
</table>
</table>
<b>Step 5</b>
<b>Step 5</b>
<p>Execute the second Z command to apply the variable-length deferred updates:</p>
<p>
<table>
Execute the second Z command to apply the variable-length deferred updates:</p>
 
<table style="width:80%">  
<tr>
<tr>
<td>SORT5</td>
<td>SORT5</td>
<td>Sorted data set of variable-length deferred update entries.</td>
<td>Sorted data set of variable-length deferred update entries.</td>
</tr>
</tr>
<tr>
<tr>
<td>TAPE5</td>
<td>TAPE5</td>
<td>Dummy file. If both a fixed-length deferred update data set and a variable-length deferred update data set are used, the FRV deferred update data set is generated during the processing of the fixed-length deferred update data set (Step 3).</td>
<td>Dummy file. If both a fixed-length deferred update data set and a variable-length deferred update data set are used, the FRV deferred update data set is generated during the processing of the fixed-length deferred update data set (Step 3).</td>
</tr>
</tr>
<tr>
<tr>
<td>CCAIN</td>
<td>CCAIN</td>
<td>z/VM disk file, DEFUPD CCAIN5, containing the commands to open and update the file CARS. A file listing follows the EXEC.</td>
<td>z/VM disk file, DEFUPD CCAIN5, containing the commands to open and update the file CARS. A file listing follows the EXEC.</td>
</tr>
</tr>
<tr>
<tr>
<td>CARS</td>
<td>CARS</td>
Line 979: Line 1,304:
</tr>
</tr>
</table>
</table>
<b>Step 6</b>
<b>Step 6</b>
<p>Sort the FRV index file that has been written in Step 3. This example uses SYNCSORT.</p>
<p>
<p>The SYSIN file to the sort is FASTLOAD SORTCTRL. This file is provided with the installation. See the DEFUPD EXEC for the control statement format.</p>
Sort the FRV index file that has been written in Step 3. This example uses SYNCSORT.</p>
<p>
The SYSIN file to the sort is FASTLOAD SORTCTRL. This file is provided with the installation. See the DEFUPD EXEC for the control statement format.</p>
 
<b>Step 7</b>
<b>Step 7</b>
<p>Apply the FRV deferred updates using the Z command: </p>
<p>
<table>
Apply the FRV deferred updates using the Z command: </p>
 
<table style="width:80%">  
<tr>
<tr>
<td>SORT5</td>
<td>SORT5</td>
<td>Sorted data set of FRV deferred updates.</td>
<td>Sorted data set of FRV deferred updates.</td>
</tr>
</tr>
<tr>
<tr>
<td>TAPE5</td>
<td>TAPE5</td>
<td>Dummy file.</td>
<td>Dummy file.</td>
</tr>
</tr>
<tr>
<tr>
<td>CCAIN</td>
<td>CCAIN</td>
<td>z/VM disk file, DEFUPD CCAIN7, that contains the commands to open and update the file CARS. A file listing follows the EXEC.</td>
<td>z/VM disk file, DEFUPD CCAIN7, that contains the commands to open and update the file CARS. A file listing follows the EXEC.</td>
</tr>
</tr>
<tr>
<tr>
<td>CARS</td>
<td>CARS</td>
Line 1,002: Line 1,336:
</tr>
</tr>
</table>
</table>
<b>Step COMMON</b>
<b>Step COMMON</b>
<p>Define files common to each step. </p>
<p>
<p>COMMON is executed with Steps 1, 3, 5, and 7. The files defined are:</p>
Define files common to each step. </p>
<table>
<p>
COMMON is executed with Steps 1, 3, 5, and 7. The files defined are:</p>
 
<table>  
<tr>
<tr>
<td>CCAAUDIT</td>
<td>CCAAUDIT</td>
<td>Step number is concatenated to the filename to have a separate file for each step.</td>
<td>Step number is concatenated to the filename to have a separate file for each step.</td>
</tr>
</tr>
<tr>
<tr>
<td>CCAPRINT</td>
<td>CCAPRINT</td>
<td>Step number is concatenated to the filename to have a separate file for each step.</td>
<td>Step number is concatenated to the filename to have a separate file for each step.</td>
</tr>
</tr>
<tr>
<tr>
<td>CCASTAT</td>
<td>CCASTAT</td>
<td>Previously defined file on a z/OS minidisk.</td>
<td>Previously defined file on a z/OS minidisk.</td>
</tr>
</tr>
<tr>
<tr>
<td>CCATEMP</td>
<td>CCATEMP</td>
<td>Previously defined file on a z/OS minidisk.</td>
<td>Previously defined file on a z/OS minidisk.</td>
</tr>
</tr>
<tr>
<tr>
<td>CCASNAP</td>
<td>CCASNAP</td>
<td>Set to PRINTER to save disk space.</td>
<td>Set to PRINTER to save disk space.</td>
</tr>
</tr>
<tr>
<tr>
<td>&amp;STACK</td>
<td>&amp;STACK</td>
Line 1,033: Line 1,376:


===DEFUPD EXEC===
===DEFUPD EXEC===
<p>The DEFUPD EXEC input files are:</p>
<p>
The DEFUPD EXEC input files are:</p>
<p class="code"><b>DEFUPD CCAIN1</b>
<p class="code"><b>DEFUPD CCAIN1</b>
SPCORE=50000
SPCORE=50000
Line 1,040: Line 1,384:
CLOSE CARS
CLOSE CARS
EOJ
EOJ
 
<b>DEFUPD CCAIN3</b>
<b>DEFUPD CCAIN3</b>
SPCORE=30000
SPCORE=30000
Line 1,046: Line 1,390:
Z
Z
EOJ
EOJ
 
<b>DEFUPD CCAIN5</b>  
<b>DEFUPD CCAIN5</b>
SPCORE=30000
SPCORE=30000
OPEN CARS
OPEN CARS
Z
Z
EOJ
EOJ
 
<b>DEFUPD CCAIN7</b>  
<b>DEFUPD CCAIN7</b>
SPCORE=27000
SPCORE=27000
OPEN CARS
OPEN CARS
Z
Z
EOJ
EOJ
 
<b>DEFUPDF SORTCTRL</b>
<b>DEFUPDF SORTCTRL</b>
SORT FIELDS=(1,16,CH,A),SIZE=500
SORT FIELDS=(1,16,CH,A),SIZE=500
Line 1,065: Line 1,409:
OPTION PRINT=ALL
OPTION PRINT=ALL
END
END
 
<b>DEFUPDV SORTCTRL</b>  
<b>DEFUPDV SORTCTRL</b>
SORT FIELDS=(5,75,CH,A)
SORT FIELDS=(5,75,CH,A)
RECORD TYPE=V,LENGTH=(270,80,270,80)
RECORD TYPE=V,LENGTH=(270,80,270,80)
MODS E15 = (OI15CMS,1500),E35=(OI35CMS,800)
MODS E15 = (OI15CMS,1500),E35=(OI35CMS,800)
END
END
 
<b>FASTLOAD SORTCTRL</b>  
<b>FASTLOAD SORTCTRL</b>
SORT FIELDS=(1,16,CH,A)  
SORT FIELDS=(1,16,CH,A)
</p>
</p>
==Job steps==
<p>
The first phase of the deferred update process is performed in one job step. The second phase can involve many separate job steps: two job steps for each deferred update data set generated in the first phase and two job steps for the FRV deferred update data set, if one is generated.</p>


==Job steps==
<p>The first phase of the deferred update process is performed in one job step. The second phase can involve many separate job steps: two job steps for each deferred update data set generated in the first phase and two job steps for the FRV deferred update data set, if one is generated.</p>
<b>Two basic job steps</b>
<b>Two basic job steps</b>
<p>The two job steps for processing each deferred update data set are:</p>
<p>
The two job steps for processing each deferred update data set are:</p>
<ul>
<ul>
<li>First job step executes a sort program, such as IBM SORT, to sort the deferred update data set for efficient processing in the next job step.</li>
<li>First job step executes a sort program, such as IBM SORT, to sort the deferred update data set for efficient processing in the next job step.</li>
<li>Second job step executes the BATCH204 load module to process the sorted deferred index information and to update Tables C and D.  </li>
<li>Second job step executes the BATCH204 load module to process the sorted deferred index information and to update Tables C and D.  </li>
</ul>
</ul>
===Total number of job steps===
===Total number of job steps===
<p>The number of job steps in the entire deferred update process depends on the attributes of the fields being updated and the number of deferred index update data sets specified on the OPEN command or IFOPEN call. </p>
<p>
<p>The deferred update process can have three, five, or seven steps. Each type of deferred update process is explained in detail in the following sections. </p>
The number of job steps in the entire deferred update process depends on the attributes of the fields being updated and the number of deferred index update data sets specified on the OPEN command or IFOPEN call. </p>
<p>[[#Total number of job steps|Determining deferred update process steps]] is a quick reference chart for determining the number of job steps needed, including the first phase job step, for each file placed in deferred update mode.  </p>
<p>
The deferred update process can have three, five, or seven steps. Each type of deferred update process is explained in detail in the following sections. </p>
<p>
[[#Total number of job steps|Determining deferred update process steps]] is a quick reference chart for determining the number of job steps needed, including the first phase job step, for each file placed in deferred update mode.  </p>
 
<table>
<table>
<caption>Determining deferred update process steps</caption>
<caption>Determining deferred update process steps</caption>
<tr class="head">
<tr class="head">
<th>
<th>File attributes for all deferred fields in file<br>&nbsp;</th>
File attributes for all deferred fields in file</th>
<th>No. of <br>deferred update <br>data sets in <br>OPEN command</th>
<th>No. of deferred update data sets in OPEN command</th>
<th>No. of <br>sort files <br>required</th>
<th>
<th>No. of <br>steps<br>&nbsp;</th>
No. of sort files required</th>
<th>
 
No. of steps</th>
</tr>
</tr>
<tr>
<tr>
<td>KEY</td>
<td>KEY</td>
<td align="right">1</td>
<td>1</td>
<td align="right">1</td>
<td>1</td>
<td align="right">3</td>
<td>3</td>
</tr>
</tr>
<tr>
<tr>
<td>KEY and FRV</td>
<td>KEY and FRV</td>
<td align="right">1</td>
<td>1</td>
<td align="right">2</td>
<td>2</td>
<td align="right">5</td>
<td>5</td>
</tr>
</tr>
<tr>
<tr>
<td>KEY and NUMERIC RANGE</td>
<td>KEY and NUMERIC RANGE</td>
<td align="right">1</td>
<td>1</td>
<td align="right">1</td>
<td>1</td>
<td align="right">3</td>
<td>3</td>
</tr>
</tr>
<tr>
<tr>
<td>KEY and ORDERED</td>
<td>KEY and ORDERED</td>
<td align="right">1<br />
<td>1<br />2</td>
2</td>
<td>1<br />2</td>
<td align="right">1<br />
<td>3<br />5</td>
2</td>
<td align="right">3<br />
5</td>
</tr>
</tr>
<tr>
<tr>
<td>KEY, FRV, and NUMERIC RANGE</td>
<td>KEY, FRV, and NUMERIC RANGE</td>
<td align="right">1
<td>1</td>
</td>
<td>2</td>
<td align="right">2</td>
<td>5</td>
<td align="right">5</td>
</tr>
</tr>
<tr>
<tr>
<td>KEY, FRV, and ORDERED</td>
<td>KEY, FRV, and ORDERED</td>
<td align="right">1<br />
<td>1<br />2</td>
2</td>
<td>2<br />3</td>
<td align="right">2<br />
<td>5<br />7</td>
3</td>
<td align="right">5<br />
7</td>
</tr>
</tr>
<tr>
<tr>
<td>KEY, FRV, NUMERIC RANGE, and ORDERED</td>
<td>KEY, FRV, NUMERIC RANGE, and ORDERED</td>
<td align="right">1<br />
<td>1<br />2</td>
2</td>
<td>2<br />3</td>
<td align="right">2<br />
<td>5<br />7</td>
3</td>
<td align="right">5<br />
7</td>
</tr>
</tr>
<tr>
<tr>
<td>KEY, NUMERIC RANGE, and ORDERED</td>
<td>KEY, NUMERIC RANGE, and ORDERED</td>
<td align="right">1<br />
<td>1<br />2</td>
2</td>
<td>1<br />2</td>
<td align="right">1<br />
<td>3<br />5</td>
2</td>
<td align="right">3<br />
5</td>
</tr>
</tr>
<tr>
<tr>
<td>NUMERIC RANGE</td>
<td>NUMERIC RANGE</td>
<td align="right">1</td>
<td>1</td>
<td align="right">1</td>
<td>1</td>
<td align="right">3</td>
<td>3</td>
</tr>
</tr>
<tr>
<tr>
<td>NUMERIC RANGE and ORDERED</td>
<td>NUMERIC RANGE and ORDERED</td>
<td align="right">1<br />
<td>1<br />2</td>
2</td>
<td>1<br />2</td>
<td align="right">1<br />
<td>3<br />5</td>
2</td>
<td align="right">3<br />
5</td>
</tr>
</tr>
<tr>
<tr>
<td>ORDERED</td>
<td>ORDERED</td>
<td align="right">1</td>
<td>1</td>
<td align="right">1</td>
<td>1</td>
<td align="right">3</td>
<td>3</td>
</tr>
</tr>
</table>
</table>
 
==Seven-step deferred update process==
==Seven-step deferred update process==
<p>A seven-step deferred update process is needed when the following conditions occur:</p>
<p>
<table>
A seven-step deferred update process is needed when the following conditions occur:</p>
<table style="width:80%">
<tr class="head">
<tr class="head">
<th>Condition</th>
<th>Condition</th>
<th>Description</th>
<th>Description</th>
</tr>
</tr>
<tr>
<tr>
<td>Deferred update mode</td>
<td nowrap>Deferred update mode</td>
<td>
<td>File was put in deferred update mode by specifying two deferred update data sets on the OPEN command or IFOPEN call:  
<p>File was put in deferred update mode by specifying two deferred update data sets on the OPEN command or IFOPEN call: </p>
<ul>
<ul>
<li>One fixed-length deferred update data set</li>
<li>One fixed-length deferred update data set</li>
Line 1,201: Line 1,546:
</td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>Hashed index fields</td>
<td>Hashed index fields</td>
<td>Fields with the KEY and/or NUMERIC RANGE attribute are updated and the index updates are deferred to the fixed-length data set. </td>
<td>Fields with the KEY and/or NUMERIC RANGE attribute are updated and the index updates are deferred to the fixed-length data set. </td>
</tr>
</tr>
<tr>
<tr>
<td>Ordered Index fields</td>
<td>Ordered Index fields</td>
<td>ORDERED CHARACTER and/or ORDERED NUMERIC are updated and the index updates are deferred to the variable-length data set.</td>
<td>ORDERED CHARACTER and/or ORDERED NUMERIC are updated and the index updates are deferred to the variable-length data set.</td>
</tr>
</tr>
<tr>
<tr>
<td>Key fields</td>
<td>Key fields</td>
Line 1,214: Line 1,562:
</tr>
</tr>
</table>
</table>
<b>Seven-step job steps</b>
<b>Seven-step job steps</b>
<p>Follow these steps in the seven-step deferred update process:</p>
<p>
Follow these steps in the seven-step deferred update process:</p>
<ol>
<ol>
<li>The first phase step, generate two deferred update data sets: one fixed-length and one variable-length.</li>
<li>The first phase step, generate two deferred update data sets: one fixed-length and one variable-length.</li>
<li>Sort the variable-length deferred update data set. (It is not necessary to sort the variable-length data set before the fixed-length data set. Steps 4 and 5 can be switched with steps 2 and 3.)</li>
<li>Sort the variable-length deferred update data set. (It is not necessary to sort the variable-length data set before the fixed-length data set. Steps 4 and 5 can be switched with steps 2 and 3.)</li>
<li>Apply the updates from the sorted variable-length deferred update data set.</li>
<li>Apply the updates from the sorted variable-length deferred update data set.</li>
<li>Sort the fixed-length deferred update data set</li>
<li>Sort the fixed-length deferred update data set</li>
<li>Apply the updates from the sorted fixed-length deferred update data set, which generates an additional fixed-length deferred update data set (for FRV fields).</li>
<li>Apply the updates from the sorted fixed-length deferred update data set, which generates an additional fixed-length deferred update data set (for FRV fields).</li>
<li>Sort the additional fixed-length deferred update data set.</li>
<li>Sort the additional fixed-length deferred update data set.</li>
<li>Apply the updates for the additional sorted fixed-length deferred update data set.  </li>
<li>Apply the updates for the additional sorted fixed-length deferred update data set.  </li>
</ol>
</ol>
==Five-step deferred update process==
==Five-step deferred update process==
<p>Three combinations of field attributes and specified deferred update data sets require five job steps to complete the deferred update process: </p>
<p>
<table>
Three combinations of field attributes and specified deferred update data sets require five job steps to complete the deferred update process: </p>
 
<table style="width:80%">
<tr class="head">
<tr class="head">
<th>This type...</th>
<th>This type...</th>
<th>Does...</th>
<th>Does...</th>
</tr>
</tr>
<tr>
<tr>
<td>Fixed-length data set with FRV field</td>
<td>Fixed-length data set with FRV field</td>
<td>Fixed-length deferred update processing for KEY and/or NUMERIC RANGE and FRV fields. </td>
<td>Fixed-length deferred update processing for KEY and/or NUMERIC RANGE and FRV fields. </td>
</tr>
</tr>
<tr>
<tr>
<td>Fixed-length and Variable-length data set </td>
<td nowrap>Fixed-length and Variable-length data set </td>
<td>Fixed- and variable-length deferred update processing for KEY and/or NUMERIC RANGE and ORDERED fields. </td>
<td>Fixed- and variable-length deferred update processing for KEY and/or NUMERIC RANGE and ORDERED fields. </td>
</tr>
</tr>
<tr>
<tr>
<td>Variable-length data set and FRV field</td>
<td>Variable-length data set and FRV field</td>
Line 1,245: Line 1,607:
</tr>
</tr>
</table>
</table>
===When to use Fixed/FRV===
===When to use Fixed/FRV===
<p>The Fixed/FRV type of five-step process is needed when the following conditions occur:</p>
<p>
The Fixed/FRV type of five-step process is needed when the following conditions occur:</p>
<ul>
<ul>
<li>File was put in deferred update mode by specifying one fixed-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>File was put in deferred update mode by specifying one fixed-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>Hashed index fields (KEY and/or NUMERIC RANGE) are updated and the index updates are deferred to the fixed-length data set.</li>
<li>Hashed index fields (KEY and/or NUMERIC RANGE) are updated and the index updates are deferred to the fixed-length data set.</li>
<li>One or more of the KEY fields updated and deferred also has the FRV attribute. </li>
<li>One or more of the KEY fields updated and deferred also has the FRV attribute. </li>
</ul>
</ul>
<p>In this case, either no ORDERED fields are updated or the variable-length deferred update data set is intentionally omitted. This omission forces updates to the Ordered Index (ORDERED fields) to be updated immediately, and no Ordered Index updates are deferred. </p>
<p>
In this case, either no ORDERED fields are updated or the variable-length deferred update data set is intentionally omitted. This omission forces updates to the Ordered Index (ORDERED fields) to be updated immediately, and no Ordered Index updates are deferred. </p>
 
<b>Fixed/FRV five-step process</b>
<b>Fixed/FRV five-step process</b>
<ol>
<ol>
Line 1,261: Line 1,629:
<li>Apply the updates for the additional sorted fixed-length deferred update data set. </li>
<li>Apply the updates for the additional sorted fixed-length deferred update data set. </li>
</ol>
</ol>
===When to use Fixed/Variable===
===When to use Fixed/Variable===
<p>The Fixed/Variable type of five-step process is needed when the following conditions occur:</p>
<p>
The Fixed/Variable type of five-step process is needed when the following conditions occur:</p>
<ul>
<ul>
<li>File was put in deferred update mode by specifying one fixed-length and one variable-length deferred update data sets on the OPEN command or IFOPEN call.</li>
<li>File was put in deferred update mode by specifying one fixed-length and one variable-length deferred update data sets on the OPEN command or IFOPEN call.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE-are updated and the index updates are deferred to the fixed-length data set.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE-are updated and the index updates are deferred to the fixed-length data set.</li>
<li>Ordered Index fields-ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.</li>
<li>Ordered Index fields-ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.</li>
<li>None of the KEY fields updated and deferred has the FRV attribute. </li>
<li>None of the KEY fields updated and deferred has the FRV attribute. </li>
</ul>
</ul>
<b>Fixed/Variable five-step process</b>
<b>Fixed/Variable five-step process</b>
<ol>
<ol>
<li>The first-phase step, generates one fixed-length and one variable-length deferred update data set.</li>
<li>The first-phase step, generates one fixed-length and one variable-length deferred update data set.</li>
<li>Sort the variable-length deferred update data set. It is not necessary to sort the variable-length data set before the fixed-length data set. Steps 4 and 5 can be switched with steps 2 and 3.</li>
<li>Sort the variable-length deferred update data set. It is not necessary to sort the variable-length data set before the fixed-length data set. Steps 4 and 5 can be switched with steps 2 and 3.</li>
<li>Apply the updates from the sorted variable-length deferred update data set.</li>
<li>Apply the updates from the sorted variable-length deferred update data set.</li>
<li>Sort the fixed-length deferred update data set.</li>
<li>Sort the fixed-length deferred update data set.</li>
<li>Apply the updates from the sorted fixed-length deferred update data set. This does not generate an additional fixed-length deferred update data set, because there are no FRV fields involved.</li>
<li>Apply the updates from the sorted fixed-length deferred update data set. This does not generate an additional fixed-length deferred update data set, because there are no FRV fields involved.</li>
</ol>
</ol>
===When to use Variable/FRV===
===When to use Variable/FRV===
<p>The Variable/FRV type of five-step deferred update process is used when the following conditions occur:</p>
<p>
The Variable/FRV type of five-step deferred update process is used when the following conditions occur:</p>
<ul>
<ul>
<li>File was put in deferred update mode by specifying one variable-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>File was put in deferred update mode by specifying one variable-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE) and/or Ordered Index fields (ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE) and/or Ordered Index fields (ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.</li>
<li>One or more of the KEY fields updated and deferred also has the FRV attribute. </li>
<li>One or more of the KEY fields updated and deferred also has the FRV attribute. </li>
</ul>
</ul>
<p>In other words, no fixed-length deferred update data set is supplied, so all the deferred updates generated by the first phase are sent to the variable-length data set.</p>
<p>
In other words, no fixed-length deferred update data set is supplied, so all the deferred updates generated by the first phase are sent to the variable-length data set.</p>
 
<b>Variable/FRV five-step process</b>
<b>Variable/FRV five-step process</b>
<ol>
<ol>
Line 1,291: Line 1,675:
<li>Apply the updates from the sorted variable-length deferred update data set, which generates an additional fixed-length deferred update data set (for FRV fields).</li>
<li>Apply the updates from the sorted variable-length deferred update data set, which generates an additional fixed-length deferred update data set (for FRV fields).</li>
<li>Sort the additional fixed-length deferred update data set.</li>
<li>Sort the additional fixed-length deferred update data set.</li>
<li>Apply the updates for the additional sorted fixed-length deferred update data set.   </li>
<li>Apply the updates for the additional sorted fixed-length deferred update data set. </li>
</ol>
</ol>
==Three-step deferred update process==
==Three-step deferred update process==
<p>The two types of three-step deferred update processes are:</p>
<p>
The two types of three-step deferred update processes are:</p>
<ul>
<ul>
<li>Fixed type</li>
<li>Fixed type</li>
<li>Variable type</li>
<li>Variable type</li>
</ul>
</ul>
===When to use the Fixed three-step process===
===When to use the Fixed three-step process===
<p>The Fixed type of three-step process is used when the following conditions occur:</p>
<p>
The Fixed type of three-step process is used when the following conditions occur:</p>
<ul>
<ul>
<li>File was put in deferred update mode by specifying one fixed-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>File was put in deferred update mode by specifying one fixed-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE-are updated and the index updates are deferred to the fixed-length data set.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE-are updated and the index updates are deferred to the fixed-length data set.</li>
<li>None of the KEY fields updated and deferred has the FRV attribute. </li>
<li>None of the KEY fields updated and deferred has the FRV attribute. </li>
</ul>
</ul>
<p>Either no ORDERED fields are updated or the variable-length deferred update data set is intentionally omitted. This omission forces immediate updates to the Ordered Index (ORDERED fields) and no Ordered Index updates are deferred.</p>
<p>
Either no ORDERED fields are updated or the variable-length deferred update data set is intentionally omitted. This omission forces immediate updates to the Ordered Index (ORDERED fields) and no Ordered Index updates are deferred.</p>
 
<b>Fixed three-step process</b>
<b>Fixed three-step process</b>
<ol>
<ol>
Line 1,313: Line 1,705:
<li>Apply the updates from the sorted fixed-length deferred update data set. (This does not generate an additional fixed-length deferred update data set, because there are no FRV fields involved.) </li>
<li>Apply the updates from the sorted fixed-length deferred update data set. (This does not generate an additional fixed-length deferred update data set, because there are no FRV fields involved.) </li>
</ol>
</ol>
===When to use the Variable three-step process===
===When to use the Variable three-step process===
<p>The Variable type of three-step deferred update process is used when the following conditions occur:</p>
<p>
The Variable type of three-step deferred update process is used when the following conditions occur:</p>
<ul>
<ul>
<li>File was put in deferred update mode by specifying one variable-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>File was put in deferred update mode by specifying one variable-length deferred update data set on the OPEN command or IFOPEN call.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE-and/or Ordered Index fields-ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.</li>
<li>Hashed index fields-KEY and/or NUMERIC RANGE-and/or Ordered Index fields-ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.</li>
<li>None of the KEY fields updated and deferred has the FRV attribute. </li>
<li>None of the KEY fields updated and deferred has the FRV attribute. </li>
</ul>
</ul>
<p>In other words, no fixed-length deferred update data set is supplied, so all the deferred updates generated by the first phase are sent to the variable-length data set. </p>
<p>
In other words, no fixed-length deferred update data set is supplied, so all the deferred updates generated by the first phase are sent to the variable-length data set. </p>
 
<b>Variable three-step process</b>
<b>Variable three-step process</b>
<p>In this case the following steps are necessary in the deferred update process:</p>
<p>
In this case the following steps are necessary in the deferred update process:</p>
<ol>
<ol>
<li>First-phase step, generate one variable-length deferred update data set.</li>
<li>First-phase step, generate one variable-length deferred update data set.</li>
<li>Sort the variable-length deferred update data set.</li>
<li>Sort the variable-length deferred update data set.</li>
<li>Apply the updates from the sorted variable-length deferred update data set.         </li>
<li>Apply the updates from the sorted variable-length deferred update data set.</li>
</ol>
</ol>
==Merging deferred updates==
==Merging deferred updates==
<p>It is possible to merge the fixed-length deferred update data sets of many first-phase steps into a single sorted data set. This can be useful when many jobs are used to update one file, and each job produces its own fixed-length deferred update data set. The following restrictions apply to merging deferred update data sets:</p>
<p>
It is possible to merge the fixed-length deferred update data sets of many first-phase steps into a single sorted data set. This can be useful when many jobs are used to update one file, and each job produces its own fixed-length deferred update data set. The following restrictions apply to merging deferred update data sets:</p>
<ul>
<ul>
<li>No KEY or NUMERIC RANGE deferred update records can be deferred to the variable-length deferred update data set.</li>
<li>No KEY or NUMERIC RANGE deferred update records can be deferred to the variable-length deferred update data set.</li>
<li>No variable-length deferred update data sets can be merged. </li>
<li>No variable-length deferred update data sets can be merged. </li>
</ul>
</ul>
<p>The merged fixed-length deferred update sort output is used as input for a single index step. A single index step can handle a maximum of 2,147,483,648 (or 2<sup>31</sup>) deferred update records. </p>
<p>
<p>The variable-length deferred update data set cannot be merged. If the fixed-length deferred update data sets produced in the same first-phase steps as the variable-length data sets are merged, the variable-length deferred update data sets must still be processed separately and in chronological order.</p>
The merged fixed-length deferred update sort output is used as input for a single index step. A single index step can handle a maximum of 2,147,483,648 (or 2<sup>31</sup>) deferred update records. </p>
<p>Although merging several deferred update data sets can produce a cost reduction in the next step, other considerations, such as error recovery, can make merging undesirable. </p>
<p>
 
The variable-length deferred update data set cannot be merged. If the fixed-length deferred update data sets produced in the same first-phase steps as the variable-length data sets are merged, the variable-length deferred update data sets must still be processed separately and in chronological order.</p>
<p>
Although merging several deferred update data sets can produce a cost reduction in the next step, other considerations, such as error recovery, can make merging undesirable. </p>
==Overriding deferred updates==
==Overriding deferred updates==
<p>Consider the following type of update situation: new records are to be added to an automobile file in which each record has a unique SERIAL NUMBER field, which is KEY. Before a record is added, the user issues a FIND statement to see if any other record already exists with the same value of SERIAL NUMBER. If one is found, the new record is not added.</p>
<p>
<p>If updates to the index are deferred, the FIND fails to locate duplicate records that already have been added in the same main step. In order to avoid this situation, define the field SERIAL NUMBER with the NON-DEFERRABLE attribute.</p>
Consider the following type of update situation: new records are to be added to an automobile file in which each record has a unique <code>SERIAL NUMBER</code> field, which is <var>KEY</var>. Before a record is added, the user issues a <var>Find</var> statement to see if any other record already exists with the same value of <code>SERIAL NUMBER</code>. If one is found, the new record is not added.</p>
<p>
If updates to the index are deferred, the <var>Find</var> fails to locate duplicate records that already have been added in the same main step. In order to avoid this situation, define the field <code>SERIAL NUMBER</code> with the <var>NON-DEFERRABLE</var> attribute.</p>
===Deferring updates in single-user runs===
===Deferring updates in single-user runs===
<p>In single-user runs, however, there is usually no reason not to defer updates. Consequently, in single-user runs, if a file is in deferred update mode, the NON-DEFERRABLE attribute is ignored by <var class="product">Model&nbsp;204</var>. If you must prevent updates to a field from being deferred in a single user environment, use the following technique to simulate a multiuser environment and thereby force the NON-DEFERRABLE fields to be updated immediately:  </p>
<p>
In single-user runs, however, there is usually no reason not to defer updates. Consequently, in single-user runs, if a file is in deferred update mode, the NON-DEFERRABLE attribute is ignored by <var class="product">Model&nbsp;204</var>. If you must prevent updates to a field from being deferred in a single user environment, use the following technique to simulate a multiuser environment and thereby force the NON-DEFERRABLE fields to be updated immediately:  </p>
<ul>
<ul>
<li>On User 0's parameter line in the main job step, set NUSERS = 2. </li>
<li>On User 0's parameter line in the main job step, set <var>NUSERS</var> to 2. </li>
 
<li>Follow User 0's parameter line with a second parameter line that contains IODEV=3, INPUT=T03U001I, and OUTPUT=T03U001O. </li>
<li>Follow User 0's parameter line with a second parameter line that contains IODEV=3, INPUT=T03U001I, and OUTPUT=T03U001O. </li>
<li>Include these three statements in the JCL for the main step:
<li>Include these three statements in the JCL for the main step:
<p class="code">//T03U001I  DD  *
<p class="code">//T03U001I  DD  *
/*
/*
//T03U001O  DD  SYSOUT=A  
//T03U001O  DD  SYSOUT=A
</p></li>
</p></li>
</ul>
</ul>
<p>For z/VSE, specify the IODEV=3 input and output file names using z/VSE system logical names that are assigned to "IGN" in the JCL.</p>
<p>
For z/VSE, specify the IODEV=3 input and output file names using z/VSE system logical names that are assigned to "IGN" in the JCL.</p>
===Handling a deferred update override===
===Handling a deferred update override===
<p>If you override the deferred update feature, you must manually turn off the [[File_Load_Utility:_FLOD_and_FILELOAD_commands#Internal_file_load_optimization_feature|file load optimization feature]]. To turn this feature off, specify a read-and-load-a-field statement with the delete mode bit, and then include a branch before the statement so that it never executes.  </p>
<p>
<p>For example:</p>
If you override the deferred update feature, you must manually turn off the [[File Load utility: FLOD and FILELOAD commands#Internal file load optimization feature|file load optimization feature]]. To turn this feature off, specify a read-and-load-a-field statement with the delete mode bit, and then include a branch before the statement so that it never executes.  </p>
<p>
For example:</p>
<p class="code">DEFINE FIELD DUMMY            <i>Define a dummy field before</i>
<p class="code">DEFINE FIELD DUMMY            <i>Define a dummy field before</i>
   .                            <i>the FILELOAD statement.</i>
   .                            <i>the FILELOAD statement.</i>
Line 1,367: Line 1,781:
   .
   .
</p>
</p>
===Deferred updates for NON-DEFERRABLE fields===
<p>
There are times in <var class="product">Model&nbsp;204</var> in which updates are deferred for NON-DEFERRABLE fields. Some NON-DEFERRABLE fields are deferred if the file is opened in deferred update mode and NUSERS=1 (that is, the file is opened in single user mode).</p>
<p>
The following table describes the conditions under which the updates are deferred for NON-DEFERRABLE fields. </p>


===Deferred updates for NON-DEFERRABLE fields===
<p>There are times in <var class="product">Model&nbsp;204</var> in which updates are deferred for NON-DEFERRABLE fields. Some NON-DEFERRABLE fields are deferred if the file is opened in deferred update mode and NUSERS=1 (that is, the file is opened in single user mode).</p>
<p>The following table describes the conditions under which the updates are deferred for NON-DEFERRABLE fields. </p>
<table>
<table>
<caption>Deferring NON-DEFERRABLE fields</caption>
<caption>Deferring NON-DEFERRABLE fields</caption>
Line 1,379: Line 1,796:
<th>Fixed- and variable-length* data sets</th>
<th>Fixed- and variable-length* data sets</th>
</tr>
</tr>
<tr>
<tr>
<td>UNIQUE through FLOD</td>
<td>UNIQUE through FLOD</td>
Line 1,386: Line 1,804:
ORD deferred to Variable</td>
ORD deferred to Variable</td>
</tr>
</tr>
<tr>
<tr>
<td>UNIQUE without FLOD</td>
<td>UNIQUE without FLOD</td>
Line 1,392: Line 1,811:
<td>No updates deferred</td>
<td>No updates deferred</td>
</tr>
</tr>
<tr>
<tr>
<td>NON-UNIQUE through FLOD</td>
<td>NON-UNIQUE through FLOD</td>
Line 1,399: Line 1,819:
ORD deferred to Variable</td>
ORD deferred to Variable</td>
</tr>
</tr>
<tr>
<tr>
<td>NON-UNIQUE without FLOD</td>
<td>NON-UNIQUE without FLOD</td>
Line 1,406: Line 1,827:
ORD deferred to Variable</td>
ORD deferred to Variable</td>
</tr>
</tr>
<tr>
<tr>
<td colspan="4">*A variable-length data set is required for ORDERED fields loaded through FLOD.</td>
<td colspan="4">*A variable-length data set is required for ORDERED fields loaded through FLOD.</td>
</tr>
</tr>
</table>
</table>
<p class="note"><b>Note:</b> If new fieldname=value pairs are created (for example COLOR=BLUE, where BLUE is a new property entry) you can generate and defer FRV index updates during the Z-step of a KEY index.</p>
<p class="note"><b>Note:</b> If new fieldname=value pairs are created (for example <code>COLOR=BLUE</code>, where <code>BLUE</code> is a new property entry) you can generate and defer <var>FRV</var> index updates during the Z-step of a <var>KEY</var> index.</p>
===Deferred updates and Reuse Record Number files===
<p>
Do not use deferred update mode with Reuse Record Number (RRN) files except where you are performing simple record adds, such as reorganizing files. Using deferred update mode with RRN files might cause you to lose updates without any warning. For more information, see [[File design#RRN files and deferred update mode|RRN files and deferred update mode]].</p>


===Deferred updates and Reuse Record Number files===
[[Category:Model 204 files]]
<p>Do not use deferred update mode with Reuse Record Number (RRN) files except where you are performing simple record adds, such as reorganizing files. Using deferred update mode with RRN files might cause you to lose updates without any warning. For more information, see [[File design (File management)#RRN files and deferred update mode|RRN files and deferred update mode]].</p>
[[Category:File management]]

Latest revision as of 18:45, 18 March 2022

Overview

Whenever you change or add a large number of records to a Model 204 file, the process can be made more efficient, in terms of execution time, disk I/O, and storage utilization, by deferring the changes or additions that update Tables C and D: updates involving KEY, NUMERIC RANGE, ORDERED, and FRV fields. In the Model 204 deferred update feature, the deferred updates to Tables C and D are stored in deferred update data sets while Tables A and B are updated. The deferred updates are then sorted and applied to Tables C and D.

This article describes

  • Basic Model 204 deferred update feature
  • How the feature is implemented
  • Several different job forms-number of job steps-that the feature can take.

When a file is opened in deferred update mode, Model 204 protects the file by making it impossible to free the file in that Model 204 run. This limitation is necessary to protect the file from being updated before the deferred updates have been applied. All files are closed completely (free) at the end of the Model 204 job.

Deferred updates and large (FILEORG X'200') files

The FILEORG parameter X'200' setting supports large files, allowing files to hold up to 48M records.

The deferred index update feature was implemented well before the existence of FILEORG X'200' files, when the maximum number of records possible in a file was 16M. At that time, only three bytes were required to represent record numbers up to 16M - 1, so the format of the deferred index update records optimized record numbers to three bytes. However, if using FILEORG X'200' files, an extra byte is required to represent the record numbers for deferred index updates.

This means that when converting a file to FILEORG X'200', you might need to modify reorg jobs to accommodate the longer record numbers. Fortunately, most such changes should work with non-FILEORG X'200' files if common infrastructure is used for files that are a mix of FILEORG X'200' and non-FILEORG X'200'. The rest of this page indicates where values need to be adjusted for FILEORG X'200' files.

Deferred update phases

The two phases of Table updating in a Model 204 file during the deferred update process are:

  • Loading Tables A and B and loading the index (Tables C and D) updates into the deferred update data sets
  • Loading the deferred index updates into Tables C and D

First phase of deferred update

The first phase of the deferred update process involves executing whatever configuration of Model 204 would be run if updates to the index were not being deferred: BATCH204, ONLINE, IFAM1, or IFAM4. Storing new records or changing existing records proceeds normally until the Model 204 file is put into deferred update mode by a special form of the OPEN command or the IFOPEN call. Thereafter, only Table A, the internal file dictionary, and Table B, the VISIBLE data, of the file are updated.

The index information pertaining to FOR EACH VALUE (FRV), KEY, NUMERIC RANGE, and ORDERED retrieval fields is not added directly to Table C and Table D. Instead, it is written to one or two deferred update data sets for processing in later job steps.

Note: The index update generated by a File Records Under statement is never deferred.

Query results between deferred update phases

For example, suppose that you add the field name = value pair NAME=MURRAY to an existing record in file PEOPLE. PEOPLE is in deferred update mode, and the NAME field is KEY and VISIBLE.

If the record is retrieved by some other (preexisting) KEY field, a Print NAME statement prints MURRAY, because the field is VISIBLE and is, therefore, stored in Table B. However, the statement FIND ALL RECORDS FOR WHICH NAME = MURRAY does not find the record, because the index information NAME=MURRAY has not yet been added to Tables C and D.

Second phase of deferred update

The second phase of the deferred update process is executed only after the first phase of deferred update process is complete. The second phase of the deferred update process sorts each of the deferred update data sets created in the first phase, then applies the updates to Tables C and D.

Applying the sorted updates from the deferred update data sets adds the information necessary to perform retrievals based on the new KEY, NUMERIC RANGE, and ORDERED retrieval field values. For instance, after applying the deferred updates, the retrieval statement FIND ALL RECORDS FOR WHICH NAME = MURRAY finds the record in the previous example.

Additional job steps in a deferred update

If the file contains FRV (FOR EACH VALUE) fields, applying the deferred index updates to Tables C and D generates an additional deferred update data set. This additional deferred update data set contains more deferred index updates for fields with the FRV attribute, which must also be sorted, and the sorted deferred updates applied to Tables C and D.

For example, suppose that the NAME field described previously also has the FRV attribute and that MURRAY is a new value of NAME that has never occurred in any record. The statement For Each Value of NAME does not find the value MURRAY until certain information is added to Tables C and D. This information is contained in the additional deferred update data set.

The procedure for deferring updates to the index normally requires multiple job steps instead of the one job step required if the updates are not deferred. The deferred update feature can use three, five, or seven job steps, depending on the attributes of the fields being deferred and the number of deferred update data sets specified on the OPEN command or the IFOPEN call. The specific job steps required for deferred update processing are described in detail in the section Job steps.

Opening deferred update files

Types of deferred update data sets

There are two forms of deferred update data sets. The OPEN command that places the file in deferred update mode and the attributes of the fields being updated determine whether a fixed-length data set, a variable-length data set, or both are used for the deferred updates.

Deferred update OPEN syntax

The OPEN command and the IFOPEN Host Language Interface function have special forms that place the file being opened into deferred update mode. In these forms, you can specify one or two deferred update data sets.

The OPEN command syntax in this case is:

OPEN [FILE] filename,{[dsname1][,dsname2]}

Where:

  • filename is the name of the Model 204 file to be opened.
  • dsname1 is the name of the fixed-length deferred update data set. If dsname1 is supplied in the OPEN command, deferred updates to KEY and NUMERIC RANGE fields are written to this data set.
  • dsname2 is the name of the variable-length deferred update data set. If dsname2 is supplied in the OPEN command, deferred updates to ORDERED fields are written to this data set. If only dsname2 is supplied in the OPEN command, all index updates are written to this data set. If dsname2 is not supplied in the OPEN command, updates to ORDERED fields are not deferred.

Naming conventions

A deferred update data set must have a name starting with the letters TAPE. It can be placed on magnetic tape or a direct access device.

For example:

OPEN PEOPLE,TAPEPEOP

To which Model 204 responds:

*** M204.0656: UPDATES DEFERRED TO TAPEPEOP

Usage

Use the special form of OPEN only once per main step for a particular file. Subsequent ordinary OPEN commands treat the file as though the already declared deferred update data set(s) were specified.

The maximum number of deferred update files you can have open in a run is 192. If you try to open any more than 192 files, the OPEN fails and Model 204 displays the following message:

*** M204.1529: MAXIMUM DEFERRED UPDATE FILES ALREADY OPEN

Space requirements

The space requirements for the deferred update data sets depend on which type of data set is used and the number of KEY, NUMERIC RANGE, or ORDERED retrieval fields that have their index updates deferred during the first phase of the deferred update process.

Example 1: Opening a deferred update file with the first data set specified

In the following example, the CARS file is placed in deferred update mode by using the OPEN command with only the first update data set name, dsname1, specified. The updates to the Ordered Index-the ORDERED fields-are not deferred. The Ordered Index updates are applied during the first phase of the deferred update process:

OPEN CARS,TAPECARF

Example 2: Opening a deferred update file with the second data set specified

In the following example, the CARS file is placed in deferred update mode by using the OPEN command with only the second update data set name, dsname2, specified. Note the two leading commas before the data set name):

OPEN CARS,,TAPECARV

The updates to KEY, NUMERIC RANGE, and ORDERED fields are all deferred to TAPECARV, a variable-length data set.

Example 3: Opening a deferred update file with both data sets specified

Deferring all the updates to the variable-length data set is somewhat less efficient than splitting the updates by providing both deferred update data sets, as in the following example:

OPEN CARS,TAPECARF,TAPECARV

The updates to KEY and NUMERIC RANGE fields are written to the fixed-length data set, TAPECARF, and the updates to ORDERED fields are written to the variable-length data set, TAPECARV.

Active-defer in deferred update files

When you open a file in deferred update mode, Model 204 places the file in active-defer mode, and the file stays in this mode for the life of the run. The file stays in this mode until the first Z step is successfully completed.

If the file is in active-defer mode, Model 204 displays the following error message whenever the file is opened:

*** M204.0624: FILE IS IN DEFERRED UPDATE MODE

However, after the first successful Z step has been run, this message is turned off, whether or not there are still updates to be completed.

Deferred updates: Phase 1

The system parameter DUFILES gives the number of files that have been opened in deferred update mode in the current run.)

After the file is placed in deferred update mode, updates to the file that normally update the index structures are deferred to the deferred update data set(s). These updates can be the result of User Language requests, Host Language Interface functions, or file updating commands.

Number of deferred update data sets required

You must specify at least one deferred update data set in the JCL or FILEDEFs for each file in deferred update mode. If updates are deferred for more than one file in the first phase step, a separate sequence of the remaining second phase steps must be run for each file opened in deferred update mode. (See the seven-, five-, and three-step process descriptions Job steps.)

Fixed-length deferred update data sets

The fixed-length data set name corresponds to dsname1 in the OPEN command described in Deferred update OPEN syntax.

DCB parameters for fixed-length data sets

The default DCB parameters for the fixed-length data sets are:

RECFM=FB . LRECL=24 BLKSIZE=6000 .

For fixed-length deferred update CMS files, the FILEDEF statement must specify BLOCK 24 for files stored on disk. This results in a blocking factor of one, and it prevents errors from occurring during checkpointing.

For FILEORG X'200' files, the LRECL should be 25 and, in fact, that is the default. The default BLKSIZE works for both FILEORG X'200' and non-FILEORG X'200' files, so it is used for both. Therefore, to eliminate worries about jobs working on files with or without FILEORG X'200', the best approach is to not specify LRECL and BLKSIZE, allowing them to default.

Deferred KEY and NUMERIC RANGE field space requirements

When the updates to KEY and NUMERIC RANGE fields are deferred to the fixed-length data set, the space requirements for the fixed-length deferred update data set are as follows:

  • For each occurrence of a KEY field that is added or deleted, one 24-byte record is written to the data set. A changed field counts twice; the old value is deleted and the new one is added.
  • For each occurrence of a NUMERIC RANGE retrieval field that is added or deleted, the average number of 24-byte records written is equal to:

    4 + (4.5 * the number of digits in the occurrence)

Variable-length deferred update data sets

The variable-length data set name corresponds to dsname2 discussed in Deferred update OPEN syntax.

DCB parameters for variable-length data sets

The default DCB parameters for the variable-length data sets for non-FILEORG X'200' files are:

RECFM=VB . LRECL=270 BLKSIZE=6000 .

For FILEORG X'200' files, the parameters are:

RECFM=VB . LRECL=271 BLKSIZE=6000 .

For z/VSE, set the BLKSIZE parameter with the DEFINE DATASET command.

You can override the BLKSIZE on the data set or file definition statement. If enough space is available, set BLKSIZE to a full track for most efficient processing. See the description of SPCORE on Setting the SPCORE parameter.

The length of the variable deferred index update entries is 270 for non-FILEORG X'200' files, and it is 271 for FILEORG X'200' files. If using a mix of FILEORG X'200' and non-FILEORG X'200' files, the best strategy is either of these:

  • Do not explicitly specify LRECL, letting it default.
  • Specify LRECL 271, which will work for both FILEORG X'200' and non-FILEORG X'200' files.

Deferring updates to ORDERED fields

When the updates to ORDERED fields are deferred to the variable-length data set, the space requirements for the variable-length deferred update data set are one record for each occurrence of an ORDERED field that is added or deleted of a length equal to the following is written to the data set:

15 + the length of the ORDERED field value being added or deleted

Note: The length of an ORDERED NUMERIC deferred numeric value is always 8. The numeric values of an ORDERED NUMERIC field are always stored as FLOAT 8 numbers in the Ordered Index, even if the numbers are stored as FLOAT 16 in Table B. The length of an ORDERED NUMERIC deferred non-numeric value is the length of the value.

A changed field writes two records: one record to delete the old value, and one record to add the new value.

Deferring updates to KEY and NUMERIC fields

When the updates to KEY and NUMERIC RANGE fields, as well as ORDERED fields, are deferred to the variable-length data set, the additional space required in the variable-length deferred update data set is as follows:

For each occurrence of... That is added or deleted...
KEY field One 28-byte (non-FILEORG X'200') or 29-byte (FILEORG X'200') record is written to the data set. A changed field writes two records: one record to delete the old value and one record to add the new value.
NUMERIC RANGE field

Average number of 28-byte or 29-byte records written is equal to:

4 + (4.5 * the number of digits in the occurrence)

Setting the SPCORE parameter

SPCORE determines how much spare core or unallocated main memory is available after the Model 204 program has finished initializing itself. When a Model 204 file is first placed into deferred update mode, there must be enough spare core to open the Model 204 file and to accommodate the output buffers for each deferred update data set. Each data set requires a spare core of BUFNO*BLKSIZE bytes.

If more than one deferred update data set is used and/or more than one file goes into deferred update mode, spare core must be large enough to accommodate all the output buffers and associated structures.

  • Under z/OS, the parameter SPCORE is normally set on User 0's parameter line — the first input line, containing parameter assignments that further define system options and work area sizes.
  • Under z/VSE, the SIZE parameter is set.
  • Under z/VM, SPCORE is usually set in the CCAIN input. See User 0 parameters| for further explanation.

Phase 1 sample JCL

This section presents z/OS and z/VSE JCL examples for the first phase of the deferred update process. The section that include a single z/VM example begins in z/VM deferred update example.

The following sequence is an example of the first phase in a deferred update procedure. The file PEOPLE is provided with one fixed-length deferred update data set. The file CARS is provided with two deferred update data sets: one fixed-length deferred update data set and one variable-length deferred update data set.

z/OS example, Phase 1

//JOB UPDATE FILES CARS AND PEOPLE // EXEC ... Include here the basic JCL or cataloged procedure invocation provided by the Model 204 system manager to run BATCH204. //PEOPLE DD DSN=M204.FILE.PEOPLE,DISP=SHR //TAPEPEOP DD DSN=M204.DEFER.PEOPLE,DISP=(NEW,CATLG),UNIT=TAPE //CARS DD DSN=M204.FILE.CARS,DISP=SHR //TAPECARF DD DSN=M204.DEFER.FIXED.CARS,DISP=(NEW,CATLG),UNIT=TAPE //TAPECARV DD DSN=M204.DEFER.VAR.CARS,DISP=(NEW,CATLG),UNIT=TAPE //CCAIN DD * user zero parameters LOGIN userid password OPEN PEOPLE,TAPEPEOP INCLUDE procedure Updating for Tables A and B; KEY . and NUMERIC RANGE deferred updates . written to TAPEPEOP. Any Ordered . Index updates are not deferred. OPEN CARS,TAPECARF,TAPECARV INCLUDE procedure Updating for Tables A and B; KEY . and NUMERIC RANGE deferred updates . written to TAPECARF. Ordered . Index updates written to TAPECARV. CLOSE ALL EOJ /*

z/VSE example, Phase 1

// JOB UPDATE FILES CARS AND PEOPLE // DLBL PEOPLE,'M204.FILE.PEOPLE',,DA // EXTENT SYSnnn,volser // TLBL SYS015,'M204.DEFER.PEOPLE' // ASSGN SYS015,TAPE // DLBL CARS,'M204.FILE.CARS' // EXTENT SYSnnn,volser // TLBL SYS016,'M204.DEFERF.CARS' // ASSGN SYS016,TAPE // TLBL SYS017,'M204.DEFERV.CARS' // ASSGN SYS017,TAPE // EXEC BATCH204,SIZE=AUTO user zero parameters DEFINE DATASET TAPEPEOP WITH SCOPE=SYSTEM DDNAME=SYS015 - RECFM=FB LRECL=24 BLKSIZE=6000 DEFINE DATASET TAPECARF LIKE TAPEPEOP WITH DDNAME=SYS016 DEFINE DATASET TAPECARV WITH SCOPE=SYSTEM DDNAME=SYS017 - RECFM=VB LRECL=270 BLKSIZE=6000 . . . LOGIN userid password OPEN PEOPLE,TAPEPEOP INCLUDE procedure Updating for Tables A and B; . KEY and NUMERIC RANGE deferred updates . written to TAPEPEOP. Any Ordered . Index updates are not deferred. OPEN CARS,TAPECARF,TAPECARV INCLUDE procedure Updating for Tables A and B; KEY . and NUMERIC RANGE deferred updates . written to TAPECARF. Ordered . Index updates written to TAPECARV. CLOSE ALL EOJ /* /&

Deferred updates: Phase 2

As many as three data sets might require sorting and application to Tables C and D:

  • Fixed-length data set
  • Variable-length data set
  • FRV (fixed-length) data set

Descriptions of processing each of these data sets follow.

Sorting the fixed-length deferred update data set

If you use a fixed-length deferred update data set, it must be sorted by some job step after the first phase step.

  • For non-FILEORG X'200' files, the fixed-length records are 24 bytes long and must be sorted in ascending order by the first 16 bytes, using the standard EBCDIC collating sequence.
  • For FILEORG X'200' files, the fixed-length records are 25 bytes long and must be sorted in ascending order by the first 17 bytes, using the standard EBCDIC collating sequence.

Any sort utility can be used to perform the sort of the fixed-length deferred update data set under z/OS, z/VSE, or z/VM. The basic JCL for the IBM SORT Utility is described in the following paragraphs. Refer to the appropriate IBM manual for additional information.

Note: The z/VM SORT command is not adequate if large files are involved, because it lacks the required capacity.

SORTIN and SORTOUT data sets

SORTIN is the fixed-length deferred update data set.

Specify the SORTOUT DCB parameters as shown in DCB parameters for fixed-length data sets. In z/OS and z/VM, set DCB subparameters explicitly.

Recommended DCB subparameters

The following DCB subparameters are recommended for non-FILEORG X'200' files:

RECFM=FB LRECL=24 BLKSIZE=27998 (1/2 track on a 3390 disk)

The following are recommended for FILEORG X'200' files:

RECFM=FB LRECL=25 BLKSIZE=27975 (1/2 track on a 3390 disk)

In z/VSE, specify the physical record format for the SORTIN data set using the sort program's RECORD statement.

SORT control statements

The following SYSIN control statement sorts fixed-length deferred update records in z/OS for non-FILEORG X'200' files:

SORT FIELDS=(1,16,CH,A)

The effect of this statement is to sort the records in ascending order by the first 16 bytes.

The following statement sorts fixed-length deferred update records for FILEORG X'200' files:

SORT FIELDS=(1,17,CH,A)

Note: The FILEORG X'200' file SORT FIELD statement also works for non-FILEORG X'200' files.

For z/VSE, the SYSIPT control statement is as follows for non-FILEORG X'200' files:

SORT FIELDS=(1,16,CH,A) RECORD TYPE=F,LENGTH=24 INPFIL BLKSIZE=blocksize of SORTIN OUTFIL BLKSIZE=blocksize of SORTOUT

The statement for FILEORG X'200' files is:

SORT FIELDS=(1,17,CH,A) RECORD TYPE=F,LENGTH=25 INPFIL BLKSIZE=blocksize of SORTIN OUTFIL BLKSIZE=blocksize of SORTOUT

Sort work data sets for the fixed-length deferred update data set

The amount of space needed for the sort work data sets depends on the number of records in the fixed-length deferred update data set. In general, set the total amount of space in all the SORTWKxx data sets to about twice the number of bytes in the fixed-length deferred update data set that you are sorting.

For example, suppose that there are 100,000 records in the fixed-length deferred update data set. This is 2,400,000 bytes or about 4 cylinders (rounding up) of a 3380 disk. If you use three sort work data sets for sorting the fixed-length deferred update data set, space parameters of three cylinders apiece yield a total of nine cylinders, or slightly more than twice the size of the fixed-length deferred update data set.

Sorting the fixed-length deferred update data set

z/OS JCL

The following z/OS JCL sorts the fixed-length deferred update data set:

//SORT EXEC PGM=SORT,TIME=60, // REGION=6M, // PARM='MSG=AP,CORE=150000' //SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR //SORTMSGS DD SYSOUT=A //SYSOUT DD SYSOUT=A //SORTIN DD DSN=M204.DEFER.FIXED.CARS, // DISP=(OLD,DELETE,KEEP) //SORTOUT DD DSN=M204.SORTOUT.FIXED.CARS, // DISP=(NEW,CATLG,DELETE),UNIT=TAPE, // DCB=(RECFM=FB,LRECL=24,BLKSIZE=32760) //SORTWK01 DD SPACE=(CYL,3,,CONTIG), // UNIT=3390 //SORTWK02 DD SPACE=(CYL,3,,CONTIG), // UNIT=(3390,SEP=SORTWK01) //SORTWK03 DD SPACE=(CYL,3,,CONTIG), // UNIT=(3390,(SEP=SORTWK01,SORTWK02)) //SYSIN DD * SORT FIELDS=(1,16,CH,A) /*

Many installations provide cataloged procedures that contain most of the previous JCL.

z/VSE JCL

Following is an example of z/VSE JCL to sort the fixed-length deferred update data set:

// TLBL SORTIN1,'M204.DEFERF.CARS' // ASSGN SYS002,TAPE // TLBL SORTOUT,'M204.SORTFIX.CARS' // ASSGN SYS001,TAPE sort work statements Specify SORTWK1 . through SORTWKn for . sort work data sets . . // EXEC SORT,SIZE=100K SORT FIELDS=(1,16,CH,A),WORK=n n is number of RECORD TYPE=F,LENGTH=24 sort work data sets INPFIL BLKSIZE=1680 OUTFIL BLKSIZE=1680 /* /&

Applying the fixed-length deferred updates

To apply the fixed-length deferred updates, use the following Z command. The Z command processes the sorted output from the sort of the fixed-length deferred update data set and adds the KEY and NUMERIC RANGE retrieval index information to Tables C and D. If any of the KEY fields updated also have the FRV attribute, the Z command creates an additional deferred update data set, an FRV data set, that is processed in later job steps. For more information about the FRV deferred update data set, see Applying the FRV deferred updates.

Z command

The Z command has no arguments. It does the following:

  • Reads records from the data set pointed to by the SORT5 data set or file definition statement
  • Updates Tables C and D of the currently open Model 204 file.
  • Writes FRV deferred update records to the data set pointed to by the TAPE5 data set or file definition statement.

When Z command processing is complete, the following statistics are printed, which reflect the changes that occurred during processing:

Statistic Number of...
ADDED Field name=value pairs added to the hashed index.
DISTINCT New field name = value pairs added to hashed index fields; or, when processing the FRV deferred update data set, the number of FRV fields updated.
DELETED Field name = value pairs deleted from the hashed index.
FRV FRV deferred update records written out to the data set pointed to by the TAPE5 data set or file definition statement.
OI ADDED Entries added to the Ordered Index.
OI DELETED Entries deleted from the Ordered Index.

SPCORE parameter

The SPCORE parameter must be set large enough to open the Model 204 file and to accommodate both the input buffer for SORT5 and the output buffer for TAPE5, as well as other associated structures.

Fixed-length data set examples

z/OS JCL

Applying the fixed-length deferred index updates for z/OS follows:

// EXEC ... Include the basic JCL or cataloged procedure call provided by the Model 204 system manager to run BATCH204 //CARS DD DSN=M204.FILE.CARS,DISP=SHR //SORT5 DD DSN=M204.SORTOUT.FIXED.CARS, // DISP=(OLD,DELETE,KEEP) //TAPE5 DD DSN=M204.TAPE5.CARS, // DISP=(NEW,CATLG,DELETE), // UNIT=3390,SPACE=(TRK,(5,2)), // DCB=BLKSIZE=27998 //CCAIN DD * user zero parameters LOGIN userid password OPEN CARS Z CLOSE ALL EOJ /*

z/VSE JCL

Applying the fixed-length deferred index updates for z/VSE follows:

// DLBL CARS,'M204.FILE.CARS',,DA // EXTENT SYSnnn,volser // TLBL SYS015,'M204.SORTFIX.CARS' // ASSGN SYS015,TAPE // DLBL TAPE5,'M204.TAPE5.CARS',0 // EXTENT SYSnnn,volser // EXEC BATCH204,SIZE=AUTO PAGESZ=6184,MAXBUF=20 DEFINE DATASET TAPE5 WITH SCOPE=SYSTEM - RECFM=FB LRECL=24 BLKSIZE=1680 DEFINE DATASET SORT5 WITH SCOPE=SYSTEM - DDNAME=SYS015 RECFM=FB LRECL=24 BLKSIZE=1680 LOGIN userid password OPEN CARS Z CLOSE ALL EOJ /* /&

Sorting the variable-length deferred update data set

Variable-length sort keys

When you use a variable-length deferred update data set, it must be sorted by a job step after the deferred data set first phase. The variable-length records can vary in length from 16 to 270 (or 271, for FILEORG X'200' files), and they must be sorted into ascending order. Unlike fixed-length deferred update records, which contain a fixed-length sort key, variable-length deferred update records for ORDERED fields contain a variable-length sort key.

Because no standard sort program supports variable-length sort keys, two sort exits are provided to transform the variable-length sort keys into fixed-length sort keys. Transforming variable-length sort keys is done in the E15 sort exit. The E15 sort exit expands variable-length ORDERED deferred update records into fixed-length records.

This process produces longer sort records, which can increase the time and resources required to produce sorted output. Because sorting performance is quite sensitive to record length, be sure to set the expanded length as part of setting up SORT control statements.

Sort utilities

Any sort utility that supports sorting variable-length records and the use of the E15 and E35 sort exits can be used to perform the sort. The basic JCL for the IBM SORT Utility is described in the following paragraphs. Refer to the appropriate sort utility manual for additional information.

The z/VM SORT command cannot be used, because it cannot accommodate sort exits.

Required sort JCL and EXEC statements

When writing JCL or z/VM EXECs for sorting, use the following statements:

  • SORTIN is the variable-length deferred update data set.
  • Specify the SORTOUT DCB parameters as shown in the first phase step on DCB parameters for variable-length data sets. In z/OS and z/VM, set DCB subparameters explicitly.
  • Use the following DCB subparameters for non-FILEORG X'200' files:

    RECFM=VB LRECL=270 BLKSIZE=27998 (1/2 track on a 3390 disk)

    Use the following for FILEORG X'200' files:

    RECFM=VB LRECL=271 BLKSIZE=27975 (1/2 track on a 3390 disk)

    Or better still, don't specify the DCB subparameters and let them default.

    In z/VSE, specify the physical record format for the SORTIN data set using the SORT program's RECORD statement.

  • Specify CCAPRINT (SYSLST in z/VSE) in the step that sorts the variable-length deferred update data set. CCAPRINT is the ddname, FILEDEF, or DLBL that points to the sort error message output data set.
  • Specify CCAIN in the step that sorts the variable-length deferred update data set. CCAIN must contain the sort control statements. SYSIN and CCAIN must point to copies of the same sort control statements.

    In z/VSE, the CCAIN DLBL is not needed when sorting the variable-length deferred update data set.

  • CCAEXITS, the ddname of the library containing the sort exits, is used only in the z/OS environment. For information on installing the sort exits, see Link the Model 204 utility load modules.

SORT control statements

The syntax of SORT control statements is sort-package and operating-system specific, the following example of a SYSIN control statement is applicable for z/OS and z/VM:

Syntax for z/OS and z/VM

SORT FIELDS=(5,aa,CH,A) RECORD TYPE=V,LENGTH=(271,vl,271,vl) MODS E15=(OI15xxx,1800),E35=(OI35xxx,1300) END

Where:

  • aa is the sort field length, the value of (vl - 5). It represents the length of the entire data portion of the expanded sort record.
  • vl is a length parameter. See Setting the variable-length sort parameter (vl). The length of the variable deferred index update entries is 270 for non-FILEORG X'200' files and 271 for FILEORG X'200' files, but 271 can be used for either.
  • xxx is OS for z/OS or CMS for z/VM, depending on the operating system.

The exact syntax for the MODS statement is operating-system and sort-package dependent.

Syntax for z/VSE

SORT FIELDS=(5,aa,CH,A) RECORD TYPE=V,LENGTH=(271,vl,271,vl) MODS PH1=(OI15,1800),PH3=(OI35,1300) END

Setting the variable-length sort parameter (vl)

Because deferred update records of unequal length cannot be properly compared, the sort exit adjusts the variable-length deferred update records to a specified length. That length is the variable-length sort parameter, vl.

The vl setting determines the number of records in the deferred update data set that are optimally ordered by the sort for loading ordered fields by the Z command. A record whose length is less than the specified setting for vl is sorted into an optimum loading order. Records whose length is greater than or equal to vl are placed in the sorted deferred update data set but not in an optimum loading order.

Finding the optimum loading order

It is usually best to place all deferred update records in optimum loading order. If ORDERED fields and either KEY or NUMERIC RANGE fields exist on the same deferred update data set, specify vl as:

vl = A or B, whichever is greater.

where:

This value Equals...
A Length of the longest Ordered Index deferred update record + 1. Estimate this as the length of the longest ORDERED field + 16 or 17 (non-FILEORG X'200' or FILEORG X'200', respectively) bytes overhead.

If you are using a mix of FILEORG X'200' and non-FILEORG X'200' files, you do not have to concern yourself with the type of the file in calculations if you use the 17 as a more conservative value — it will work fine for FILEORG X'200' and non-FILEORG X'200' files.

B 28 or 29 (non-FILEORG X'200' or FILEORG X'200', respectively) bytes for Hashed Index (KEY or NUMERIC RANGE fields) deferred update records.

Measuring the longest record

Determining the exact length of the longest deferred update record requires examining the contents of the variable-length deferred update data sets. This examination is done for you if the File Load utility is being used, as the FILELOAD and FLOD commands print statistics that list the lengths of the deferred update records in the form of a histogram. Record lengths can also be obtained through a user-written program or a utility such as SYNCSORT's HISTOGRAM to read the records in the deferred update data set and determine the longest record.

Setting vl for extreme cases

Specifying vl as described in the previous section results in a sorted deferred update data set that is completely ordered for the most efficient loading by the Z command. In some extreme cases, sorting to completely order all deferred update records places excessive demands on the sorting process because of the way the length is increased for the records to be sorted.

Typically these cases involve very large files with unusual distributions of record lengths in the deferred update data set as shown in Setting vl example. In these cases, a smaller setting of the vl parameter than previously recommended might be desired, even though this results in a less than complete ordering of the data set. The consequent slowing of the Z command processing must be weighed against the benefit to the sort performance.

Note: In all cases, if a KEY or NUMERIC RANGE field is deferred in the variable-length deferred update data set, vl must be greater than 28 for non-FILEORG X'200' files, and greater than 29 for FILEORG X'200' files. Using the minimum allowed values is a bad idea, in any case, and you probably want to use a value significantly greater than the minimum allowed (for example, 40 or more).

Setting vl to optimize performance

Sort performance is sensitive to the effective length (approximately, the product of the number of records and the vl parameter) of the data set to be sorted, falling as the effective length increases. The vl setting that optimizes sort performance minimizes the data set's effective length. Simply lowering vl to minimize effective length might not succeed, however.

Setting vl greater than or equal to the longest deferred update record length causes each update record to be lengthened to this setting. Sort performance is hampered, because the effective length of the sort data set is increased.

Setting vl less than the longest deferred update record length causes records whose length is greater than or equal to vl to be spanned: broken into multiple sort records of length vl by the E15 sort exit. These additional sort records are added to the "number of records" factor of the effective length of the sort data set, and might offset the reduction to the effective length from a lower vl. Furthermore, after a record is spanned, it sorts to the end of the sorted data set, reducing the efficiency of the subsequent index loading by the Z command.

Setting vl example

The goal in setting vl, therefore, is to make vl as small as possible while spanning as few records as possible. For example, suppose that the variable-length deferred update data set containing ORDERED field updates consists of the following distribution of record lengths and records by the histogram produced by the FLOD command:

LONGEST DEFERRED UPDATE LRECL=190 RANGE OF LRECL NUMBER OF RECORDS 256-270 0 240-255 0 224-239 0 208-223 0 192-207 0 176-191 5 160-175 0 144-159 0 128-143 0 112-127 0 96-111 15 80- 95 80 64- 79 0 48- 63 2400000 32- 47 400000 1- 31 0

The size of the longest record is 190, but this is not a very satisfactory choice for the vl parameter. The distribution is such that choosing a lower vl produces a significant decrease in the data set's effective length without adding a significant number of spanned records. The most efficient choice for vl here is 64. A large gain in sort performance is purchased at the expense of the relatively few records in the data set that do not get ordered.

Sort work data sets

The space needed for the sort work data sets depends on:

  • Sort program used
  • Number of records in the variable-length deferred update data set
  • Value of vl.

For example, for IBM's DFSORT the recommended sum of the sizes of all the SORTWKxx data sets is:

2 * (number of records to be sorted) * vl

or:

2 * (effective length of sort data set)

The number of records to be sorted is approximately the number of records in the variable-length deferred update data set plus the number of spanned records.

In the example above, with 2,800,100 records in the variable-length deferred update data set, if vl is set to 64, the effective length of the data set to be sorted is:

(2800000 + (2.∗80) + (2∗15) + (3∗5)).∗ 64 = 123,215,040

This is about 174 cylinders (rounding up) of a 3380 disk. If you use 3 sort work data sets for sorting the variable-length deferred update data set, space parameters of 116 cylinders apiece yield a total of 348 cylinders, two times the effective length of the sort data set.

Installing sort exits

For a detailed discussion of the installation and use of sort exits, consult the sort manuals for the sort program to be used, and also see the M204wiki installation page for your operating system.

Variable-length data set examples

The following examples assume that the sort exit modules or z/VM TEXT files have been given the names OI15xxx and OI35xxx, where xxx is either OS for z/OS or CMS for z/VM, depending on the operating system.

z/OS JCL

The following z/OS JCL sorts the variable-length deferred update data set:

//SORT EXEC PGM=SORT,TIME=60, // REGION=7M, // PARM='MSG=AP,CORE=150000' //SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR //SORTMSGS DD SYSOUT=A //SYSOUT DD SYSOUT=A //CCAPRINT DD SYSOUT=A //CCAEXITS DD DSN=M204.LINKLIB,DISP=SHR //SORTIN DD DSN=M204.DEFER.VAR.CARS, // DISP=(OLD,DELETE,KEEP) //SORTOUT DD DSN=M204.SORTOUT.VAR.CARS, // DISP=(NEW,CATLG,DELETE),UNIT=TAPE, // DCB=(RECFM=VB,LRECL=270,BLKSIZE=15476) //SORTWK01 DD SPACE=(CYL,3,,CONTIG), // UNIT=3380 //SORTWK02 DD SPACE=(CYL,3,,CONTIG), // UNIT=(3380,SEP=SORTWK01) //SORTWK03 DD SPACE=(CYL,3,,CONTIG), // UNIT=(3380,(SEP=SORTWK01,SORTWK02)) //CCAIN DD * SORT FIELDS=(5,75,CH,A) RECORD TYPE=V,LENGTH=(270,80,270,80) MODS E15=(OI15OS,1800,CCAEXITS,N),E35=(OI35OS,1300,CCAEXITS,N) END /* //SYSIN DD * SORT FIELDS=(5,75,CH,A) RECORD TYPE=V,LENGTH=(270,80,270,80) MODS E15=(OI15OS,1800,CCAEXITS,N),E35=(OI35OS,1300,CCAEXITS,N) END /*

Many installations provide cataloged procedures that contain most of the above JCL. Check the sort package documentation for the definitive forms of the sort control statements necessary at your installation.

z/VSE JCL

The following z/VSE JCL sorts the variable-length deferred update data set:

// TLBL SORTIN1,'M204.DEFERV.CARS' // ASSGN SYS002,TAPE // TLBL SORTOUT,'M204.SORTVAR.CARS' // ASSGN SYS001,TAPE sort work statements Specify SORTWK1 through . SORTWKn for sort work . data sets . // DLBL M204CL,'M204.CORE.IMAGE.LIBRARY' // LIBDEF CL,SEARCH=M204CL // EXEC SORT,SIZE=(AUTO,100K) SORT FIELDS=(5,75,CH,A),WORK=n n is number of sort work data sets RECORD TYPE=V,LENGTH=(270,80,270,80) MODS PH1=(OI15,L2000,E15),PH3=(OI35,L1000,E35) INPFIL BLKSIZE=6000 OUTFIL BLKSIZE=6000 /* /&

Applying the variable-length deferred updates

Apply the variable-length deferred updates, using the Z command. The Z command:

  • Processes the sorted output from the sort of the variable-length deferred update data set.
  • Adds the Ordered Index information to Table D.
  • If any KEY and/or NUMERIC RANGE deferred update records are also in the variable-length deferred update data set, the Z command adds this KEY and/or NUMERIC RANGE retrieval index information to Tables C and D.
  • If there are KEY field updates in the variable-length deferred update data set, and any of the KEY fields updated also have the FRV attribute, the Z command creates an additional deferred update data set, an FRV data set, that is processed in later job steps.

For more information on the FRV deferred update data set, see Applying the FRV deferred updates.

z/OS JCL

The JCL to apply the variable-length deferred index updates for z/OS follows:

// EXEC ... Include here the basic JCL or cataloged procedure invocation provided by the Model 204 system manager to run BATCH204. //CARS DD DSN=M204.FILE.CARS,DISP=SHR //SORT5 DD DSN=M204.SORTOUT.VAR.CARS, // DISP=(OLD,DELETE,KEEP) //TAPE5 DD DUMMY,DCB=BLKSIZE=24 //CCAIN DD * user zero parameters LOGIN userid password OPEN CARS Z CLOSE ALL EOJ /*

If both a fixed- and a variable-length data set are supplied for the deferred updates, then TAPE5 is not used when applying the variable-length updates and should point to a dummy data set when applying the variable-length updates.

If a fixed-length deferred update data set exists, the FRV deferred updates are generated when the fixed-length deferred updates are applied.

If only a variable-length data set is supplied for the deferred updates, and any FRV fields are updated during the first phase step, then an FRV deferred update data set must be provided with the TAPE5 ddname so that Model 204 can write out the FRV deferred updates to this data set.

z/VSE JCL

The JCL to apply the variable-length deferred index updates for z/VSE follows:

// DLBL CARS,'M204.FILE.CARS',,DA // EXTENT SYSnnn,volser // TLBL SYS015,'M204.SORTVAR.CARS' // ASSGN SYS015,TAPE // DLBL TAPE5,'M204.TAPE5.DUMMY' // EXTENT SYSnnn,volser // EXEC BATCH204,SIZE=AUTO PAGESZ=6184,MAXBUF=20 DEFINE DATASET TAPE5 WITH SCOPE=SYSTEM - RECFM=FB LRECL=24 BLKSIZE=1680 DEFINE DATASET SORT5 WITH SCOPE=SYSTEM DDNAME=SYS015- RECFM=VB LRECL=270 BLKSIZE=6000 LOGIN userid password OPEN CARS Z CLOSE ALL EOJ /* /&

FRV deferred update data set

The FRV (For Each Value) deferred update data set is very similar to a fixed-length deferred update data set. One 24-byte record is written to the FRV deferred update data set for every new value of an FRV field that is stored in Tables C and D during the Z command processing. Unless the Model 204 file being updated has many FRV fields or an FRV field is also MANY-VALUED, the FRV deferred update data set is fairly small.

Determining the FRV step

The number and type of deferred update data sets specified in the OPEN command or IFOPEN call in the first phase of deferred data set processing determines when the FRV defined data set is generated.

If a fixed-length deferred update data set was specified on the OPEN command or IFOPEN call in the first phase step, and an FRV field was updated, the FRV deferred update data set is generated when the fixed-length deferred updates are applied (in other words, during the execution of the Z command that applies the fixed-length deferred updates).

If no fixed-length deferred update data set was specified in the OPEN command or IFOPEN call, but a variable-length deferred update data set was specified, and an FRV field was updated, the FRV deferred update data set is generated when the variable-length deferred updates are applied-in other words, during the execution of the Z command that applies the variable-length deferred updates.

Creating the FRV deferred update data set

The FRV deferred update data set is always named TAPE5. It can be placed either on magnetic tape or on a direct access device.

DCB parameters

The default parameters are:

RECFM=FB LRECL=24 BLKSIZE=6000

For z/VSE installations, TAPE5 must be allocated. Under z/OS, no additional action regarding TAPE5 need be taken.

You can specify the BLKSIZE subparameter explicitly. A full disk track is recommended. z/VSE users can specify TAPE5's block size using the DEFINE DATASET command.

Sorting the FRV deferred update data set

The FRV deferred update data set is sorted after the step that created the FRV deferred update data set. The FRV deferred update records are 24 bytes long and must be sorted in ascending order by the first 16 bytes using the standard EBCDIC collating sequence.

Determine the number of records in the FRV deferred update data set by checking statistics of the Z command that created the FRV deferred update data set. The FRV statistic records the number of FRV deferred update records written to the FRV deferred update data set.

Any sort utility can be used to perform the sort of the FRV deferred update data set. The basic JCL for the IBM SORT Utility follows. Refer to the appropriate IBM manual for additional information.

SORTIN and SORTOUT

SORTIN is the FRV deferred update data set.

Specify SORTOUT in the same way as in the step in which it was created. In z/OS and z/VM, set DCB subparameters explicitly. The following DCB subparameters are recommended:

RECFM=FB LRECL=24 BLKSIZE=27998 (1/2 track on a 3390 disk)

In z/VSE, the physical record format for the SORTIN data set is specified using the SORT program's RECORD statement.

SORT control statement examples

The following SYSIN control statement example sorts FRV deferred update records in z/OS:

z/OS

SORT FIELDS=(1,16,CH,A),SIZE=En

Where:

n is the value of the FRV statistic taken from the output of the Z command that created the FRV deferred update data set.

z/VSE

For z/VSE, the SYSIPT control statement is as follows:

SORT FIELDS=(1,16,CH,A),SIZE=En RECORD TYPE=F,LENGTH=24 INPFIL BLKSIZE=blocksize of SORTIN OUTFIL BLKSIZE=blocksize of SORTOUT

Sort work data sets for the FRV deferred update data set

The amount of space needed for the sort work data sets for the FRV deferred update data set is calculated in the same way as for the sort work data sets for the fixed-length deferred update data set. See Sort work data sets for the fixed-length deferred update data set.

z/OS JCL

The following z/OS JCL sorts the FRV deferred update data set:

//SORT EXEC PGM=SORT,TIME=60, // REGION=7M, // PARM='MSG=AP,CORE=150000' //SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR //SORTMSGS DD SYSOUT=A //SYSOUT DD SYSOUT=A //SORTIN DD DSN=M204.TAPE5.CARS, // DISP=(OLD,DELETE,KEEP) //SORTOUT DD DSN=M204.SORTOUT.FRV.CARS, // DISP=(NEW,CATLG,DELETE),UNIT=TAPE, // DCB=(RECFM=FB,LRECL=24,BLKSIZE=15476) //SORTWK01 DD SPACE=(CYL,1), // UNIT=3380 //SORTWK02 DD SPACE=(CYL,1), // UNIT=(3380,SEP=SORTWK01) //SORTWK03 DD SPACE=(CYL,1), // UNIT=(3380,(SEP=SORTWK01,SORTWK02)) //SYSIN DD * SORT FIELDS=(1,16,CH,A),SIZE=E100 /*

Many sites provide cataloged procedures that contain most of the above JCL.

z/VSE JCL

The following z/VSE JCL sorts the FRV deferred update data set:

// TLBL SORTIN1,'M204.TAPE5.CARS' // ASSGN SYS002,TAPE // TLBL SORTOUT,'M204.SORTFRV.CARS' // ASSGN SYS001,TAPE sort work statements Specify SORTWK1 through . SORTWKn for sort work . data sets . // EXEC SORT,SIZE=1M SORT FIELDS=(1,16,CH,A),WORK=n n is number of sort work data sets RECORD TYPE=F,LENGTH=24 INPFIL BLKSIZE=1680 OUTFIL BLKSIZE=1680 /*

Applying the FRV deferred updates

To apply the FRV deferred updates, use the Z command. The Z command:

  • Processes the sorted output from the sort of the FRV deferred update data set
  • Adds the FRV retrieval index information to Tables C and D.

Applying the FRV deferred updates is much like applying the fixed-length deferred updates, except that:

  • SORT5 points to the sorted FRV deferred update data set.
  • TAPE5, under z/OS, points to a dummy data set that has DCB=BLKSIZE=24. Under z/VM, TAPE5 is a dummy file; under z/VSE, it must not be a dummy file.

SPCORE

Set the SPCORE parameter large enough to open the Model 204 file and to accommodate both the input buffer for SORT5 and the output buffer for TAPE5 along with other structures. See Setting the SPCORE parameter.

z/OS JCL

The z/OS JCL to apply the FRV deferred updates for z/OS follows:

// EXEC ... Include here the basic JCL or cataloged procedure invocation provided by the Model 204 system manager to run BATCH204. //CARS DD DSN=M204.FILE.CARS,DISP=SHR //SORT5 DD DSN=M204.SORTOUT.FRV.CARS, // DISP=(OLD,DELETE,KEEP) //TAPE5 DD DUMMY,DCB=BLKSIZE=24 TAPE5 points to a dummy data set because no new FRV deferred updates will be created. //CCAIN DD * user zero parameters LOGIN userid password OPEN CARS Z CLOSE ALL EOJ /*

z/VSE JCL

The z/VSE JCL to apply the FRV deferred updates for z/VSE follows:

// DLBL CARS,'M204.FILE.CARS',,DA // EXTENT SYSnnn,volser // TLBL SYS015,'M204.SORTFRV.CARS' // ASSGN SYS015,TAPE // DLBL TAPE5,'M204.TAPE5.DUMMY' // EXTENT SYSnnn,volser TAPE5 is not used because no new FRV deferred updates will be created. // EXEC BATCH204,SIZE=AUTO PAGESZ=6184,MAXBUF=20 DEFINE DATASET TAPE5 WITH SCOPE=SYSTEM - RECFM=FB LRECL=24 BLKSIZE=1680 DEFINE DATASET SORT5 WITH SCOPE=SYSTEM - DDNAME=SYS015 RECFM=FB LRECL=24 BLKSIZE=1680 LOGIN userid password OPEN CARS Z CLOSE ALL EOJ /* /&

z/VM deferred update example

Using deferred updates with FASTLOAD to load files

The most common use of the deferred update feature is to load files. The z/VM FASTLOAD driver EXEC, distributed with the Model 204 installation, incorporates the deferred update procedure into the file loading process. The FASTLOAD EXEC can initiate a multistep deferred update procedure that is as many job-steps (seven, five, three, or one) as required.

The FASTLOAD EXEC accepts as parameters the name of another EXEC, such as DEFUPD in the following example, and the type (number of deferred update procedure job steps) of FASTLOAD to execute. DEFUPD EXEC is used by the driver to define the files to be used for each FASTLOAD step and to invoke Model 204 when necessary.

FASTLOAD EXEC format

The format of the FASTLOAD command is:

Syntax

FASTLOAD [TEST] [NODCSS] EXECname [NUM] [(option[)]]

If no option is specified, 5STEP is the default.

where:

  • TEST specifies a test version of the Model 204 ONLINE module or shared segment-that is, T204. If TEST is not specified, the production version-that is, M204 is invoked.
  • NODCSS specifies that shared segments are not to be used, even though they exist.
  • EXECname specifies the name of an EXEC procedure that provides the file definitions and other logic required to prepare a deferred update or File Load utility job. The EXEC procedure is invoked once before each step of the deferred update process, and during FASTLOAD command initialization.
  • NUM specifies the number, from 1 through 7, of the step to begin with in case of a restart.
  • option is one of the following:
    Option Indicates...
    7STEP Seven-step job
    5STEP Five-step job
    3STEP Three-step job
    1STEP One-step job

Setting parameters in the FASTLOAD EXEC

Parameters required to invoke Model 204 are set in the EXEC procedure called by the FASTLOAD EXEC. These parameters must be placed in the stack using the &STACK command as keyword-value pairs, separated by blanks, during Steps 1, 3, 5, and 7. The only operand provided to the EXEC called by the FASTLOAD EXEC is the step number.

FASTLOAD EXEC example

In the following example, the FASTLOAD EXEC calls DEFUPD and passes it the parameter for the step number to be executed. The DEFUPD EXEC concatenates the passed parameter (&1, for example) with the step name (FLOAD) in a &GOTO statement. This numbering and consequent program flow simulate the job steps in the previous z/OS and z/VSE examples.

z/VM EXEC

Enter the following command to run the example:

FASTLOAD DEFUPD (7STEP

The DEFUPD EXEC appears below, followed by a step-by-step explanation of the EXEC and the files defined in each step.

&CONTROL OFF &ERROR &EXIT &RETCODE &IF &1 EQ 0 &GOTO -ACCESS FILEDEF * CLEAR &GOTO -FLOAD&1 -ACCESS RELEASE M ACCESS 201 M &EXIT -FLOAD1 FILEDEF TAPECARF TAP1 SL ( BLOCK 2400 LRECL 24 RECFM FB LABELDEF TAPECARF VOLID 123456 FILEDEF TAPECARV DISK CARS DEFV W (BLOCK 6000 LRECL 270 RECFM VB FILEDEF CARS M DSN M204DB CARS FILEDEF CCAIN DISK DEFUPD CCAIN1 * &GOTO -COMMON -FLOAD2 LABELDEF SORTIN1 VOLID 123456 SSORT TAP1 CARS DEFSORT W DEFUPDF SORTCTRL B &EXIT &RC -FLOAD3 FILEDEF SORT5 DISK CARS DEFSORT W FILEDEF TAPE5 DISK CARS FRV W ( BLOCK 24 LRECL 24 RECFM FB FILEDEF CCAIN DISK DEFUPD CCAIN3 * FILEDEF CARS M DSN M204DB CARS &GOTO -COMMON -FLOAD4 FILEDEF CCAIN DISK DEFUPDV SORTCTRL B FILEDEF CCAPRINT DISK DEFUPD&1 CCAPRINT A SSORT CARS DEFV W CARS SORTVAR W DEFUPDV SORTCTRL B &EXIT &RC -FLOAD5 FILEDEF SORT5 DISK CARS SORTVAR W FILEDEF TAPE5 DUMMY ( BLOCK 24 LRECL 24 RECFM FB) FILEDEF CCAIN DISK DEFUPD CCAIN5 * FILEDEF CARS M DSN M204DB CARS &GOTO -COMMON -FLOAD6 SSORT CARS FRV W CARS FRVSORT W FASTLOAD SORTCTRL C &EXIT &RC -FLOAD7 FILEDEF SORT5 DISK CARS FRVSORT W FILEDEF TAPE5 DUMMY ( BLOCK 24 LRECL 24 RECFM FB FILEDEF CCAIN DISK DEFUPD CCAIN7 * FILEDEF CARS M DSN M204DB CARS &GOTO -COMMON &EXIT -COMMON FILEDEF CCAPRINT DISK DEFUPD&1 CCAPRINT A FILEDEF CCAAUDIT DISK DEFUPD&1 CCAAUDIT A FILEDEF CCATEMP N DSN WORK CCATEMP FILEDEF CCASTAT N DSN WORK CCASTAT FILEDEF CCASNAP PRINTER &STACK SYSOPT 128 &EXIT

Description of steps

The task performed and the files defined in each step are as follows.

Step 1

Update database file CARS in deferred update mode. The files defined are:

TAPECARF

Fixed-length deferred update data set, defined to go to a standard label tape. A LABELDEF command defines the volume serial number.

When Model 204 uses a tape, it executes the M204MOUN EXEC to tell an operator to mount the volume label specified in the LABELDEF. The M204UNLD EXEC is executed at the end of tape processing to issue the appropriate z/VM TAPE command function. The version of M204UNLD distributed has a TAPE RUN command. Change this to TAPE REW to run this example.

TAPECARV Variable-length deferred update data set.
CARS Model 204 database file being updated. The file is defined on a z/OS minidisk.
CCAIN z/VM disk file, DEFUPD CCAIN1, that contains the commands to open and update the file CARS. A file listing follows the EXEC.

Step 2

Sort the fixed-length deferred update file that has been written in Step 1. This example uses SYNCSORT, which is able to read tape input. A LABELDEF is needed to define the volume serial number.

The SYSIN file to the sort is DEFUPDF SORTCTRL. See the DEFUPD EXEC for the control statement format.

Step 3

Execute the first Z command to apply the fixed-length deferred updates. The files defined are:

SORT5 Sorted fixed-length deferred update data set.
TAPE5 FRV deferred update data set.
CCAIN z/VM disk file, DEFUPD CCAIN3,containing the commands to open and update the file CARS. A file listing follows the EXEC.
CARS Model 204 database file being updated. The file is defined on a z/OS minidisk.

Step 4

Sort the variable-length deferred update data set. This example uses SYNCSORT and the sort exits OI15CMS and OI35CMS. These sort exits are provided with the installation. Typically, the sort exits are either placed in a TXTLIB or reside on an accessed disk with a filetype of TEXT.

The SYSIN file to the sort is DEFUPDV SORTCTRL. See the DEFUPD EXEC for the control statement format.:

CCAIN Sort control statements (same as SYSIN).
CCAPRINT Sort error message file for the variable-length deferred update data set sort.

Step 5

Execute the second Z command to apply the variable-length deferred updates:

SORT5 Sorted data set of variable-length deferred update entries.
TAPE5 Dummy file. If both a fixed-length deferred update data set and a variable-length deferred update data set are used, the FRV deferred update data set is generated during the processing of the fixed-length deferred update data set (Step 3).
CCAIN z/VM disk file, DEFUPD CCAIN5, containing the commands to open and update the file CARS. A file listing follows the EXEC.
CARS Model 204 database file being updated. The file is defined on a z/OS minidisk.

Step 6

Sort the FRV index file that has been written in Step 3. This example uses SYNCSORT.

The SYSIN file to the sort is FASTLOAD SORTCTRL. This file is provided with the installation. See the DEFUPD EXEC for the control statement format.

Step 7

Apply the FRV deferred updates using the Z command:

SORT5 Sorted data set of FRV deferred updates.
TAPE5 Dummy file.
CCAIN z/VM disk file, DEFUPD CCAIN7, that contains the commands to open and update the file CARS. A file listing follows the EXEC.
CARS Model 204 database file being updated. The file is defined on a z/OS minidisk.

Step COMMON

Define files common to each step.

COMMON is executed with Steps 1, 3, 5, and 7. The files defined are:

CCAAUDIT Step number is concatenated to the filename to have a separate file for each step.
CCAPRINT Step number is concatenated to the filename to have a separate file for each step.
CCASTAT Previously defined file on a z/OS minidisk.
CCATEMP Previously defined file on a z/OS minidisk.
CCASNAP Set to PRINTER to save disk space.
&STACK Passes execution parameter SYSOPT 128 in the program stack to FASTLOAD.

DEFUPD EXEC

The DEFUPD EXEC input files are:

DEFUPD CCAIN1 SPCORE=50000 OPEN CARS,TAPECARF,TAPECARV I STORE CLOSE CARS EOJ DEFUPD CCAIN3 SPCORE=30000 OPEN CARS Z EOJ DEFUPD CCAIN5 SPCORE=30000 OPEN CARS Z EOJ DEFUPD CCAIN7 SPCORE=27000 OPEN CARS Z EOJ DEFUPDF SORTCTRL SORT FIELDS=(1,16,CH,A),SIZE=500 INPFIL BLKSIZE=2400 RECORD TYPE=F,LENGTH=(24,24) OPTION PRINT=ALL END DEFUPDV SORTCTRL SORT FIELDS=(5,75,CH,A) RECORD TYPE=V,LENGTH=(270,80,270,80) MODS E15 = (OI15CMS,1500),E35=(OI35CMS,800) END FASTLOAD SORTCTRL SORT FIELDS=(1,16,CH,A)

Job steps

The first phase of the deferred update process is performed in one job step. The second phase can involve many separate job steps: two job steps for each deferred update data set generated in the first phase and two job steps for the FRV deferred update data set, if one is generated.

Two basic job steps

The two job steps for processing each deferred update data set are:

  • First job step executes a sort program, such as IBM SORT, to sort the deferred update data set for efficient processing in the next job step.
  • Second job step executes the BATCH204 load module to process the sorted deferred index information and to update Tables C and D.

Total number of job steps

The number of job steps in the entire deferred update process depends on the attributes of the fields being updated and the number of deferred index update data sets specified on the OPEN command or IFOPEN call.

The deferred update process can have three, five, or seven steps. Each type of deferred update process is explained in detail in the following sections.

Determining deferred update process steps is a quick reference chart for determining the number of job steps needed, including the first phase job step, for each file placed in deferred update mode.

Determining deferred update process steps
File attributes for all deferred fields in file
 
No. of
deferred update
data sets in
OPEN command
No. of
sort files
required
No. of
steps
 
KEY 1 1 3
KEY and FRV 1 2 5
KEY and NUMERIC RANGE 1 1 3
KEY and ORDERED 1
2
1
2
3
5
KEY, FRV, and NUMERIC RANGE 1 2 5
KEY, FRV, and ORDERED 1
2
2
3
5
7
KEY, FRV, NUMERIC RANGE, and ORDERED 1
2
2
3
5
7
KEY, NUMERIC RANGE, and ORDERED 1
2
1
2
3
5
NUMERIC RANGE 1 1 3
NUMERIC RANGE and ORDERED 1
2
1
2
3
5
ORDERED 1 1 3

Seven-step deferred update process

A seven-step deferred update process is needed when the following conditions occur:

Condition Description
Deferred update mode File was put in deferred update mode by specifying two deferred update data sets on the OPEN command or IFOPEN call:
  • One fixed-length deferred update data set
  • One variable-length deferred update data set
Hashed index fields Fields with the KEY and/or NUMERIC RANGE attribute are updated and the index updates are deferred to the fixed-length data set.
Ordered Index fields ORDERED CHARACTER and/or ORDERED NUMERIC are updated and the index updates are deferred to the variable-length data set.
Key fields One or more of the KEY fields updated and deferred also has the FRV attribute.

Seven-step job steps

Follow these steps in the seven-step deferred update process:

  1. The first phase step, generate two deferred update data sets: one fixed-length and one variable-length.
  2. Sort the variable-length deferred update data set. (It is not necessary to sort the variable-length data set before the fixed-length data set. Steps 4 and 5 can be switched with steps 2 and 3.)
  3. Apply the updates from the sorted variable-length deferred update data set.
  4. Sort the fixed-length deferred update data set
  5. Apply the updates from the sorted fixed-length deferred update data set, which generates an additional fixed-length deferred update data set (for FRV fields).
  6. Sort the additional fixed-length deferred update data set.
  7. Apply the updates for the additional sorted fixed-length deferred update data set.

Five-step deferred update process

Three combinations of field attributes and specified deferred update data sets require five job steps to complete the deferred update process:

This type... Does...
Fixed-length data set with FRV field Fixed-length deferred update processing for KEY and/or NUMERIC RANGE and FRV fields.
Fixed-length and Variable-length data set Fixed- and variable-length deferred update processing for KEY and/or NUMERIC RANGE and ORDERED fields.
Variable-length data set and FRV field Variable-length deferred update processing for KEY, NUMERIC RANGE, and ORDERED fields, and fixed-length deferred update processing for FRV fields.

When to use Fixed/FRV

The Fixed/FRV type of five-step process is needed when the following conditions occur:

  • File was put in deferred update mode by specifying one fixed-length deferred update data set on the OPEN command or IFOPEN call.
  • Hashed index fields (KEY and/or NUMERIC RANGE) are updated and the index updates are deferred to the fixed-length data set.
  • One or more of the KEY fields updated and deferred also has the FRV attribute.

In this case, either no ORDERED fields are updated or the variable-length deferred update data set is intentionally omitted. This omission forces updates to the Ordered Index (ORDERED fields) to be updated immediately, and no Ordered Index updates are deferred.

Fixed/FRV five-step process

  1. The first-phase step, generate one fixed-length deferred update data set.
  2. Sort the fixed-length deferred update data set.
  3. Apply the updates from the sorted fixed-length deferred update data set, which generates an additional fixed-length deferred update data set for FRV fields.
  4. Sort the additional fixed-length deferred update data set.
  5. Apply the updates for the additional sorted fixed-length deferred update data set.

When to use Fixed/Variable

The Fixed/Variable type of five-step process is needed when the following conditions occur:

  • File was put in deferred update mode by specifying one fixed-length and one variable-length deferred update data sets on the OPEN command or IFOPEN call.
  • Hashed index fields-KEY and/or NUMERIC RANGE-are updated and the index updates are deferred to the fixed-length data set.
  • Ordered Index fields-ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.
  • None of the KEY fields updated and deferred has the FRV attribute.

Fixed/Variable five-step process

  1. The first-phase step, generates one fixed-length and one variable-length deferred update data set.
  2. Sort the variable-length deferred update data set. It is not necessary to sort the variable-length data set before the fixed-length data set. Steps 4 and 5 can be switched with steps 2 and 3.
  3. Apply the updates from the sorted variable-length deferred update data set.
  4. Sort the fixed-length deferred update data set.
  5. Apply the updates from the sorted fixed-length deferred update data set. This does not generate an additional fixed-length deferred update data set, because there are no FRV fields involved.

When to use Variable/FRV

The Variable/FRV type of five-step deferred update process is used when the following conditions occur:

  • File was put in deferred update mode by specifying one variable-length deferred update data set on the OPEN command or IFOPEN call.
  • Hashed index fields-KEY and/or NUMERIC RANGE) and/or Ordered Index fields (ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.
  • One or more of the KEY fields updated and deferred also has the FRV attribute.

In other words, no fixed-length deferred update data set is supplied, so all the deferred updates generated by the first phase are sent to the variable-length data set.

Variable/FRV five-step process

  1. The first-phase step, generate one variable-length deferred update data set.
  2. Sort the variable-length deferred update data set.
  3. Apply the updates from the sorted variable-length deferred update data set, which generates an additional fixed-length deferred update data set (for FRV fields).
  4. Sort the additional fixed-length deferred update data set.
  5. Apply the updates for the additional sorted fixed-length deferred update data set.

Three-step deferred update process

The two types of three-step deferred update processes are:

  • Fixed type
  • Variable type

When to use the Fixed three-step process

The Fixed type of three-step process is used when the following conditions occur:

  • File was put in deferred update mode by specifying one fixed-length deferred update data set on the OPEN command or IFOPEN call.
  • Hashed index fields-KEY and/or NUMERIC RANGE-are updated and the index updates are deferred to the fixed-length data set.
  • None of the KEY fields updated and deferred has the FRV attribute.

Either no ORDERED fields are updated or the variable-length deferred update data set is intentionally omitted. This omission forces immediate updates to the Ordered Index (ORDERED fields) and no Ordered Index updates are deferred.

Fixed three-step process

  1. The first-phase step, generate one fixed-length deferred update data set.
  2. Sort the fixed-length deferred update data set.
  3. Apply the updates from the sorted fixed-length deferred update data set. (This does not generate an additional fixed-length deferred update data set, because there are no FRV fields involved.)

When to use the Variable three-step process

The Variable type of three-step deferred update process is used when the following conditions occur:

  • File was put in deferred update mode by specifying one variable-length deferred update data set on the OPEN command or IFOPEN call.
  • Hashed index fields-KEY and/or NUMERIC RANGE-and/or Ordered Index fields-ORDERED CHARACTER and/or ORDERED NUMERIC-are updated and the index updates are deferred to the variable-length data set.
  • None of the KEY fields updated and deferred has the FRV attribute.

In other words, no fixed-length deferred update data set is supplied, so all the deferred updates generated by the first phase are sent to the variable-length data set.

Variable three-step process

In this case the following steps are necessary in the deferred update process:

  1. First-phase step, generate one variable-length deferred update data set.
  2. Sort the variable-length deferred update data set.
  3. Apply the updates from the sorted variable-length deferred update data set.

Merging deferred updates

It is possible to merge the fixed-length deferred update data sets of many first-phase steps into a single sorted data set. This can be useful when many jobs are used to update one file, and each job produces its own fixed-length deferred update data set. The following restrictions apply to merging deferred update data sets:

  • No KEY or NUMERIC RANGE deferred update records can be deferred to the variable-length deferred update data set.
  • No variable-length deferred update data sets can be merged.

The merged fixed-length deferred update sort output is used as input for a single index step. A single index step can handle a maximum of 2,147,483,648 (or 231) deferred update records.

The variable-length deferred update data set cannot be merged. If the fixed-length deferred update data sets produced in the same first-phase steps as the variable-length data sets are merged, the variable-length deferred update data sets must still be processed separately and in chronological order.

Although merging several deferred update data sets can produce a cost reduction in the next step, other considerations, such as error recovery, can make merging undesirable.

Overriding deferred updates

Consider the following type of update situation: new records are to be added to an automobile file in which each record has a unique SERIAL NUMBER field, which is KEY. Before a record is added, the user issues a Find statement to see if any other record already exists with the same value of SERIAL NUMBER. If one is found, the new record is not added.

If updates to the index are deferred, the Find fails to locate duplicate records that already have been added in the same main step. In order to avoid this situation, define the field SERIAL NUMBER with the NON-DEFERRABLE attribute.

Deferring updates in single-user runs

In single-user runs, however, there is usually no reason not to defer updates. Consequently, in single-user runs, if a file is in deferred update mode, the NON-DEFERRABLE attribute is ignored by Model 204. If you must prevent updates to a field from being deferred in a single user environment, use the following technique to simulate a multiuser environment and thereby force the NON-DEFERRABLE fields to be updated immediately:

  • On User 0's parameter line in the main job step, set NUSERS to 2.
  • Follow User 0's parameter line with a second parameter line that contains IODEV=3, INPUT=T03U001I, and OUTPUT=T03U001O.
  • Include these three statements in the JCL for the main step:

    //T03U001I DD * /* //T03U001O DD SYSOUT=A

For z/VSE, specify the IODEV=3 input and output file names using z/VSE system logical names that are assigned to "IGN" in the JCL.

Handling a deferred update override

If you override the deferred update feature, you must manually turn off the file load optimization feature. To turn this feature off, specify a read-and-load-a-field statement with the delete mode bit, and then include a branch before the statement so that it never executes.

For example:

DEFINE FIELD DUMMY Define a dummy field before . the FILELOAD statement. . . =5 Branch to 5 DUMMY=1,0.X'4000' Turn on delete mode bit #5 Always skip DUMMY statement. . . .

Deferred updates for NON-DEFERRABLE fields

There are times in Model 204 in which updates are deferred for NON-DEFERRABLE fields. Some NON-DEFERRABLE fields are deferred if the file is opened in deferred update mode and NUSERS=1 (that is, the file is opened in single user mode).

The following table describes the conditions under which the updates are deferred for NON-DEFERRABLE fields.

Deferring NON-DEFERRABLE fields
Condition Fixed-length data set only Variable-length* data set only Fixed- and variable-length* data sets
UNIQUE through FLOD N/A KEY and ORD deferred KEY deferred to Fixed
ORD deferred to Variable
UNIQUE without FLOD No updates deferred No updates deferred No updates deferred
NON-UNIQUE through FLOD KEY and NR deferred KEY, NR, and ORD deferred KEY, NR deferred to Fixed
ORD deferred to Variable
NON-UNIQUE without FLOD KEY and NR deferred KEY, NR, and ORD deferred KEY, NR deferred to Fixed
ORD deferred to Variable
*A variable-length data set is required for ORDERED fields loaded through FLOD.

Note: If new fieldname=value pairs are created (for example COLOR=BLUE, where BLUE is a new property entry) you can generate and defer FRV index updates during the Z-step of a KEY index.

Deferred updates and Reuse Record Number files

Do not use deferred update mode with Reuse Record Number (RRN) files except where you are performing simple record adds, such as reorganizing files. Using deferred update mode with RRN files might cause you to lose updates without any warning. For more information, see RRN files and deferred update mode.