Creating a file with FILEMGMT: Difference between revisions
(41 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
==Overview of creating files== | ==Overview of creating files== | ||
<p>Prerequisites:</p> | <blockquote class="note"> | ||
< | <p><b>Prerequisites:</b> </p> | ||
< | <ul> | ||
<p>Adding a file to the database includes the following steps:</p> | <li>You must have Dictionary/204 and its subsystems running in order to use FILEMGMT.</li> | ||
<li>Before working your way through the File Management Subsystem facility (FILEMGMT) interface to create a file, you should have made decisions about the organization, recovery options, and security for the file you are creating. See [[File design]] for more information.</li> | |||
</ul> | |||
</blockquote> | |||
<p> | |||
Adding a file to the database includes the following steps:</p> | |||
<ol> | <ol> | ||
<li>Defining the file organization and recovery options (File Definition - Organization screen).</li> | <li>[[#Defining_file_organization|Defining the file organization]] and recovery options (File Definition - Organization screen).</li> | ||
<li>Defining the file security (File Definition - Security screen).</li> | |||
<li>For procedure files, defining the parameters for the procedures contained in the file (File Definition - Procedure screen).</li> | <li>[[Defining file security with FILEMGMT|Defining the file security]] (File Definition - Security screen).</li> | ||
<li>For procedure files, [[Defining file procedures with FILEMGMT|defining the parameters for the procedures]] contained in the file (File Definition - Procedure screen).</li> | |||
<li>For data files, defining fields, records, and field groups in the following order: | <li>For data files, defining fields, records, and field groups in the following order: | ||
<ol style="list-style-type:lower-alpha"> | <ol style="list-style-type:lower-alpha"> | ||
<li>Defining the fields in the file. (Field Name List screen; Field Attributes screen)</li> | <li>[[Defining fields with FILEMGMT|Defining the fields]] in the file. (Field Name List screen; Field Attributes screen)</li> | ||
<li>Defining the records in the file. (Record Name LIst screen; Record Definitions screen)</li> | |||
<li>Defining the field groups in the file. (Optional. Field Group List screen; Field Group Definition screen. | <li>[[Defining records with FILEMGMT|Defining the records]] in the file. (Record Name LIst screen; Record Definitions screen)</li> | ||
< | |||
<li>Defining the field groups in the file. (Optional. Field Group List screen; Field Group Definition screen. | |||
</li> | <p> | ||
<li>Sizing the file and its tables. (File Size Definition screen)</li> | See "Field group maintenance" in the <var class="book">Rocket Model 204 Dictionary/204 and Data Administration Guide</var> for details.</p> | ||
</li></ol> | |||
<li>[[Managing file and table size with FILEMGMT|Sizing the file and its tables]]. (File Size Definition screen)</li> | |||
<li>Modifying the file's field, record, and field group definitions and the size specifications, as needed.</li> | <li>Modifying the file's field, record, and field group definitions and the size specifications, as needed.</li> | ||
<li>Executing the CREATE command (Execute Commands screen).</li> | |||
<li>Executing the <var>CREATE</var> command ([[Executing and deleting commands with FILEMGMT#Execute Commands screen|Execute Commands screen]]).</li> | |||
</ol> | </ol> | ||
==Defining file organization== | ==Defining file organization== | ||
<ol> | <ol> | ||
<li>Log on to FILEMGMT as described in [[ | <li>Log on to FILEMGMT as described in [[Logging on to FILEMGMT]].</li> | ||
<li>Select the FILE Maintenance CREATE function (number 1) from the primary screen. | <li>Select the FILE Maintenance CREATE function (number 1) from the primary screen. | ||
<p>FILEMGMT displays the first of the three File Definition screens, the Organization | <p> | ||
FILEMGMT displays the first of the three File Definition screens, the Organization screen:</p> | |||
</li> | </li> | ||
</ol> | </ol> | ||
== | <p class="caption" style="margin-right:24em">File Definition - Organization screen</p> | ||
<table> | <table> | ||
<tr> | <tr> | ||
<td> | <td> | ||
<p class="code"> | <p class="code">FILEMGMT File Definition - Organization PAGE 1 OF 3 | ||
FILEMGMT File Definition - Organization PAGE 1 OF 3 | |||
Filename: VEHICLES FICREATE: 7.5 LANGUAGE: US Active/Inactive I | |||
FILE ORGANIZATION Opt Fld Ext: N RFG: N LG FILES: N FILEORG X' 0E ' | |||
Entry:__ Sorted:_ Hash:X Unordered:_ Reuse Record Numbers:_ | Entry:__ Sorted:_ Hash:X Unordered:_ Reuse Record Numbers:_ | ||
Sort/Hash Key: Req Evry Rec:X Enable Skewing:_ | Sort/Hash Key: Req Evry Rec: X Enable Skewing: _ | ||
Table B Auto | Table B Auto Incr Pages: 0 | ||
Table D Auto | Table D Auto Incr Pages: 0 | ||
Table X Auto | Table X Auto Incr Pages: 0 | ||
File Models: None X | |||
File Models: None X 1nf _ Numeric Validation_ FILEMODL X' 00 ' | |||
FILE OPTIONS FOPT X' 00 ' | FILE OPTIONS FOPT X' 00 ' | ||
Disable Lock Pending Updates: _ Only FM Defines New Fields: _ | Disable Lock Pending Updates: _ Only FM Defines New Fields: _ | ||
No Procedure Statement Numbers: _ No Procedure Statement Labels:_ | No Procedure Statement Numbers: _ No Procedure Statement Labels:_ | ||
Enable Date Time Stamp: N | Enable Date Time Stamp: N | ||
FILE RECOVERY OPTIONS FRCVOPT X' 00 ' | FILE RECOVERY OPTIONS FRCVOPT X' 00 ' | ||
Disable Transaction | Disable Transaction Backout: _ No Rollforward (RF): _ | ||
No RF Logging: _ No Checkpoint (CK) Logging: _ | No RF Logging: _ No Checkpoint (CK) Logging: _ | ||
No Updates Without RF Logging: _ No Updates Without CK Logging:_ | No Updates Without RF Logging: _ No Updates Without CK Logging:_ | ||
All Updates Applied During RF: _ No Discontinuities Allowed: _ | All Updates Applied During RF: _ No Discontinuities Allowed: _ | ||
Format File During CREATE: Y Verify Disk Updates: N | Format File During CREATE: Y Verify Disk Updates: N | ||
<b></b>===> | <b></b>===> | ||
1=HELp 2= 3=QUIt 4=FIElds 5=WIDen 6=COMmands | 1=HELp 2= 3=QUIt 4=FIElds 5=WIDen 6=COMmands | ||
7= 8=FORward 9=SIZe 10= 11= 12=END | 7= 8=FORward 9=SIZe 10= 11= 12=END | ||
Line 59: | Line 80: | ||
</tr> | </tr> | ||
</table> | </table> | ||
<p>You use the File Definition - Organization screen to name a new file and to specify file organization parameters. When this screen is displayed for a file for the first time, the standard <var class="product">Model 204</var> default values for the parameters are used.</p> | <p> | ||
<p><var class="product">Model 204</var> default values are supplied for any parameters for which you do not fill in values.</p> | You use the File Definition - Organization screen to name a new file and to specify file organization parameters. When this screen is displayed for a file for the first time, the standard <var class="product">Model 204</var> default values for the parameters are used.</p> | ||
<p>You select options from the choices on the screen, and FILEMGMT uses your selections to compute appropriate values for the <var class="product">Model 204</var> FILEMODL, FILEORG, FOPT, and FRCVOPT parameters.</p> | <p> | ||
<var class="product">Model 204</var> default values are supplied for any parameters for which you do not fill in values.</p> | |||
<p> | |||
You select options from the choices on the screen, and FILEMGMT uses your selections to compute appropriate values for the <var class="product">Model 204</var> <var>FILEMODL</var>, <var>FILEORG</var>, <var>FOPT</var>, and <var>FRCVOPT</var> parameters.</p> | |||
<ol> | <ol> | ||
<li>In the Filename input field, enter the name of the file that you are creating. | <li>In the <b>Filename</b> input field, enter the name of the file that you are creating. | ||
<p>The name can be | <p> | ||
< | The name can be as many as eight characters long (7 for DOS systems). The file name cannot be <code>FILE</code> or <code>GROUP</code> and cannot start with <code>CCA</code> (except for [[System requirements for Application Subsystems#Creating CCASYS|CCASYS]]), <code>SYS</code>, <code>OUT</code>, <code>TAPE</code>, or a number. It can contain only uppercase letters, numbers, and the following special characters:</p> | ||
< | <ul> | ||
< | <li>At sign (<tt>@</tt>)</li> | ||
</ | <li>Pound sign (<tt>#</tt>)</li> | ||
<li>The FICREATE input field displays the <var class="product">Model 204</var> version number for the file that you are creating. FILEMGMT uses FICREATE to calculate the file size and validate certain <var class="product">Model 204</var> file features. Enter a different version number if needed.</li> | <li>Dollar sign (<tt>$</tt>) (alternately displayed as £)</li> | ||
<li>The LANGUAGE input field displays the language of the file that you are creating (set by the LANGFILE parameter). The default is U.S. English. Enter a different language if needed. </li> | </ul> | ||
<li>Change the Active/Inactive default value as needed. | |||
<p>The Active/Inactive input field specifies how the commands in your file will be processed when you execute commands from the Execute Commands screen.</p> | <li>The <b>FICREATE</b> input field displays the <var class="product">Model 204</var> version number for the file that you are creating. FILEMGMT uses <b>FICREATE</b> to calculate the file size and validate certain <var class="product">Model 204</var> file features. Enter a different version number if needed.</li> | ||
<p>Active or inactive indicates the mode you selected on the Organization screen or last used to execute commands against the file. The file itself is referred to as active or inactive, depending on the mode in which commands for the file were last executed.</p> | |||
<p>If you have permissions to change the value, and your system supports the alternative option you choose, your entry will override the system default set by the system administrator.</p> | <li>The <b>LANGUAGE</b> input field displays the language of the file that you are creating (set by the <var>LANGFILE</var> parameter). The default is U.S. English. Enter a different language if needed. </li> | ||
<li>Change the <b>Active/Inactive</b> default value as needed. | |||
<p> | |||
The <b>Active/Inactive</b> input field specifies how the commands in your file will be processed when you execute commands from the Execute Commands screen.</p> | |||
<p> | |||
Active or inactive indicates the mode you selected on the Organization screen or last used to execute commands against the file. The file itself is referred to as active or inactive, depending on the mode in which commands for the file were last executed.</p> | |||
<p> | |||
If you have permissions to change the value, and your system supports the alternative option you choose, your entry will override the system default set by the system administrator.</p> | |||
</li> | </li> | ||
<ul> | <ul> | ||
<li>Type A to create an Active file. The commands will be executed immediately (upon verifying your permissions) or later in a batch file. Select the active execution mode if you choose to transform the file to current release format. Set FICREATE to the current release number.</li> | <li>Type <code>A</code> to create an Active file. The commands will be executed immediately (upon verifying your permissions) or later in a batch file. Select the active execution mode if you choose to transform the file to current release format. Set <b>FICREATE</b> to the current release number.</li> | ||
<li>Type I to create an Inactive file. The commands will be generated and stored in separate files for later execution. | |||
<p>Active and inactive options are described in | <li>Type <code>I</code> to create an Inactive file. The commands will be generated and stored in separate files for later execution. | ||
<p> | |||
Active and inactive options are described in [[Executing and deleting commands with FILEMGMT#Execution options|Execution options]] and [[Executing and deleting commands with FILEMGMT#Execute Commands screen|Execute Commands screen]].</p> | |||
</li> | </li> | ||
</ul> | </ul> | ||
<li>In the | <li>In the <b>Opt Fld Ext</b> (optimized field extract) input field, enter <code>Y</code> to add a length byte to every non-preallocated (or non-<var>OCCURS</var>) field, which could result in faster field extraction. The improvement is most noticeable when you have built records with a large number of fields. Entering <code>Y</code> sets <var>FILEORG</var> to X'80'. | ||
<p>The default is N: non-preallocated (or non-OCCURS) fields that are type FLOAT, CODED, and BINARY are not stored with a preceding length byte. See [[ | <p> | ||
The default is <code>N</code>: non-preallocated (or non-<var>OCCURS</var>) fields that are type <var>FLOAT</var>, <var>CODED</var>, and <var>BINARY</var> are not stored with a preceding length byte. See [[Field design#Preallocated fields (OCCURS attribute)|Preallocated fields]] for more information on preallocated and non-preallocated fields.</p> | |||
</li> | </li> | ||
<li>In the | <li>In the <b>RFG</b> input field, enter <code>Y</code> to enable repeating field groups. Repeating field groups, available in Model 204 version 7.5, let you view and process groups of fields as a logical entity. Files with repeating field groups can have up to 32,000 fields. For more information, see [[Field group (File architecture)]]. | ||
<p> | <p>Entering <code>Y</code> sets <var>FILEORG</var> to X'100'. Note that the <var>FILEORG</var> X'100' attributes (such as CHUNK, DATETIME, and so on) are not currently supported by FILEMGMT.</p> | ||
</li> | </li> | ||
</ol> | |||
<table> | <li>In the <b>LG Files</b> input field, enter <code>Y</code> to enable support for large files. Large files, available in Model 204 version 7.5, can hold up to 48 million records. Entering <code>Y</code> sets <var>FILEORG</var> to X'200'. | ||
<li>In the <b>FILE ORGANIZATION</b> section, select file organization characteristics for the specified file. FILEMGMT computes the <var class="product">Model 204</var> <var>[[FILEORG parameter|FILEORG]]</var> parameter from your selections and displays the computed value. See [[File design]] for details on the advantages and disadvantages of each file organization type. | |||
<ol class="low-al"> | |||
<li>Select one of the following options: | |||
<table class="thJustBold"> | |||
<tr class="head"> | <tr class="head"> | ||
<th>Option</th> | <th>Option</th> | ||
Line 98: | Line 138: | ||
<tr> | <tr> | ||
< | <th>Entry</th> | ||
<td> | <td>FILEORG X'00'</td> | ||
<td>Records are stored in the file in the order in which they are entered. You cannot reorder records or reuse the record numbers of deleted records. Entry is the default file organization. </td></tr> | <td>Records are stored in the file in the order in which they are entered. You cannot reorder records or reuse the record numbers of deleted records. <b>Entry</b> is the default file organization. </td></tr> | ||
<tr> | <tr> | ||
< | <th>Sorted</th> | ||
<td> | <td>FILEORG X'01'</td> | ||
<td>Records are stored in the file in order by the sort key that you specify. Sorted is less efficient than the other options and is not recommended. </td></tr> | <td>Records are stored in the file in order by the sort key that you specify. <b>Sorted</b> is less efficient than the other options and is not recommended. </td></tr> | ||
<tr> | <tr> | ||
< | <th>Hash</th> | ||
<td> | <td>FILEORG X'08'</td> | ||
<td>Records are stored in the file in order by the hash key that you specify. </td></tr> | <td>Records are stored in the file in order by the hash key that you specify. </td></tr> | ||
<tr> | <tr> | ||
< | <th>Unordered</th> | ||
<td> | <td>FILEORG X'20'</td> | ||
<td>Records are stored in the file in the order in which they are entered. You can reorder records and reuse the record numbers of deleted records. </td></tr> | <td>Records are stored in the file in the order in which they are entered. You can reorder records and reuse the record numbers of deleted records. </td></tr> | ||
</table> | </table> | ||
</li> | |||
<li>A record is stored on a page if there is sufficient space (as determined by the <var>[[BREUSE parameter|BREUSE]]</var> parameter) and if there is an unused record number. | |||
<p> | <p> | ||
In the <b>Reuse Record Numbers</b> input field, enter <code>Y</code> or <code>N</code>. </p> | |||
< | <p> | ||
Available with Unordered, Hash, or Sorted file organization. Select <b>Reuse Record Numbers</b> if you want the record numbers of deleted records to be reused for new records added, provided that the record number is available on the Table B page to which the new record is being added. Selecting <b>Reuse Record Numbers</b> sets the <var>FILEORG</var> X'04' bit.</p> | |||
<p>Available with Unordered, | |||
</li> | </li> | ||
<li>Enter a Sort or Hash key, if applicable. | <li>Enter a Sort or Hash key, if applicable. | ||
<p>If you have selected | <p> | ||
<p>If you have selected the Entry or Unordered file organization option, leave Sort/Hash Key blank.</p> | If you have selected <b>Hash</b> or <b>Sorted</b> as the file organization, enter the name of the sort or hash key field. The entry must be a valid <var class="product">Model 204</var> field name (1-70 characters). The requirements for a valid field name are described in [[ Field names#Field name rules|Field name rules]]. The sort or hash key field must exist in every record in the file. </p> | ||
<p> | |||
If you have selected the <b>Entry</b> or <b>Unordered</b> file organization option, leave <b>Sort/Hash Key</b> blank.</p> | |||
</li> | </li> | ||
<li> | <li>In the <b>Req Every Rec</b> input field: | ||
< | <p>If you have selected <b>Hash</b> or <b>Sorted</b> as the file organization, enter <code>X</code> to place a hash key (for hashed files) or a sort key (for sorted files) on every record. This option is required for hashed or sorted files because a key on every record is needed to process the file correctly. This option sets the <var>FILEORG</var> X'02' bit.</p> | ||
< | <p>If you have selected the <b>Entry</b> or <b>Unordered</b> file organization option, leave <b>Req Evry Rec</b> blank.</p></li> | ||
<li> | <li>Leave the <b>Enable Skewing</b> input field blank. Skewing is an obsolete method of physical storage that was designed to improve efficiency during sequential searches. An <code>X</code> would indicate that blocks within a track were stored in a skewed order. </li> | ||
<li> | <li>Select the following Auto Increase options as needed. See [[File size calculation in detail]] for details. | ||
<ul> | |||
<li> | <li><b>Table B Auto Incr Pages:</b> If you want <var class="product">Model 204</var> to automatically increase Table B when it becomes full, enter the number of pages to increase Table B by. This sets the parameter <var>[[BAUTOINC parameter|BAUTOINC]]</var> to the specified value.</li> | ||
<li> | <li><b>Table D Auto Incr Pages:</b> If you want <var class="product">Model 204</var> to automatically increase Table D when it becomes full, enter the number of pages to increase Table D by. This sets the parameter <var>[[DAUTOINC parameter|DAUTOINC]]</var> to the specified value.</li> | ||
<li>Table | <li><b>Table X Auto Incr Pages:</b> If you want <var class="product">Model 204</var> to automatically increase Table X when it becomes full, enter the number of pages to increase Table X by. This sets the parameter <var>[[XAUTOINC parameter|XAUTOINC]]</var> to the specified value. To use Table X: | ||
<p> | |||
The file must have been created in <var class="product">Model 204</var> version 7.1.0 or later.</p> | |||
<p> | |||
The file must have an organization type of Entry or Unordered.</p> | |||
</li> | |||
</ul> | |||
</ol> | |||
< | |||
<li>File Models: A file model is a set of default file and field attributes. Rocket Software recommends that you use the default setting.</li> | <li><b>File Models:</b> A file model is a set of default file and field attributes. Rocket Software recommends that you use the default setting.</li> | ||
<li>In the FILE OPTIONS section, select the characteristics of the file you are creating. FILEMGMT computes the <var class="product">Model 204</var> FOPT parameter from your selections and displays the computed value. | <li>In the <b>FILE OPTIONS</b> section, select the characteristics of the file you are creating. FILEMGMT computes the <var class="product">Model 204</var> <var>[[FOPT parameter|FOPT]]</var> parameter from your selections and displays the computed value. | ||
<table class="thJustBold"> | <table class="thJustBold"> | ||
<tr> | <tr> | ||
<th>Disable | <th>Disable Lock Pending Updates</th> | ||
<td>Transaction back out locks an update until the transaction is committed, allowing an update to be backed out prior to the commit if for any reason the transaction does not finish. By disabling Lock Pending Updates, the feature Transaction back out is also disabled (Disable Transaction Backout must also be selected). If Disable lock pending updates is selected, incomplete transactions may be present in the file which may result in a file that is logically inconsistent. (FOPT=X'02') | <td>Transaction back out locks an update until the transaction is committed, allowing an update to be backed out prior to the commit if for any reason the transaction does not finish. By disabling Lock Pending Updates, the feature Transaction back out is also disabled (Disable Transaction Backout must also be selected). If Disable lock pending updates is selected, incomplete transactions may be present in the file which may result in a file that is logically inconsistent. (FOPT=X'02') | ||
<p> | <p> | ||
Line 166: | Line 209: | ||
<tr> | <tr> | ||
<th nowrap>Only | <th nowrap>Only FM Defines New Fields</th> | ||
<td>This option prevents the DEFINE FIELD command from being issued without using the FILEMGMT facility. The purpose of this option is to maintain the integrity of the dictionary. By using the FILEMGMT facility to define fields, the relationship between a file, the records in the file and the fields and their relationship to the file and the records within the file is automatically maintained in the Dictionary. (FOPT=X'01') | <td>This option prevents the DEFINE FIELD command from being issued without using the FILEMGMT facility. The purpose of this option is to maintain the integrity of the dictionary. By using the FILEMGMT facility to define fields, the relationship between a file, the records in the file and the fields and their relationship to the file and the records within the file is automatically maintained in the Dictionary. (FOPT=X'01') | ||
<p> | <p> | ||
Line 173: | Line 216: | ||
<tr> | <tr> | ||
<th>No | <th nowrap>No Procedure Statement Numbers</th> | ||
<td>Selecting this option prevents any procedures from being stored in the file which use statement numbers. Using statement numbers is an obsolete way of coding a User Language procedure which is difficult to understand. If this file is being used to store procedures, select this option in order to enforce proper coding standards. (FOPT=X'80') | <td>Selecting this option prevents any procedures from being stored in the file which use statement numbers. Using statement numbers is an obsolete way of coding a User Language procedure which is difficult to understand. If this file is being used to store procedures, select this option in order to enforce proper coding standards. (FOPT=X'80') | ||
</td></tr> | </td></tr> | ||
<tr> | <tr> | ||
<th>No | <th>No Procedure Statement Labels</th> | ||
<td>Selecting this option prevents any procedures from being stored in the file which use statement labels. Statement labels are the proper way to code a User Language procedure. If this file will be used for storing procedures, enter N or leave the input field blank. Otherwise, enter Y if you want to prohibit procedure statement labels from being assigned to procedure lines. (FOPT=X'40') | <td>Selecting this option prevents any procedures from being stored in the file which use statement labels. Statement labels are the proper way to code a User Language procedure. If this file will be used for storing procedures, enter N or leave the input field blank. Otherwise, enter Y if you want to prohibit procedure statement labels from being assigned to procedure lines. (FOPT=X'40') | ||
</td></tr> | </td></tr> | ||
Line 184: | Line 227: | ||
<tr> | <tr> | ||
<th>Enable Date Time Stamp</th> | <th>Enable Date Time Stamp</th> | ||
<td>The Date Time Stamp is an additional field within the file which tracks changes to a file at the record level and records the date and time of each update to a record. (FOPT=X'10') For details, see [[ Adding a | <td>The Date Time Stamp is an additional field within the file which tracks changes to a file at the record level and records the date and time of each update to a record. (FOPT=X'10') For details, see [[Adding a date-time stamp field#Overview of the date-time stamp feature|Overview of the date-time stamp feature]]. | ||
<p> | <p> | ||
To use the date-time stamp:</p> | To use the date-time stamp:</p> | ||
<ul> | <ul> | ||
<li>The file must be an LPU file. | <li>The file must be an LPU file. | ||
<li>The date/time stamp field specified in the DTSFN= system parameter must have already been defined to the file. For details, see [[Setting | |||
<li>The date/time stamp field specified in the DTSFN= system parameter must have already been defined to the file. For details, see [[Setting up the date-time stamp field#Enabling date-time stamp updates|Enabling date-time stamp updates]]. | |||
</ul> | </ul> | ||
</td></tr> | </td></tr> | ||
Line 195: | Line 239: | ||
</li> | </li> | ||
<li>In the FILE RECOVERY OPTIONS section, select file recovery options for the file. FILEMGMT computes the <var class="product">Model 204</var> FRCVOPT parameter from your selections and displays the computed value. | <li>In the <b>FILE RECOVERY OPTIONS</b> section, select file recovery options for the file. FILEMGMT computes the <var class="product">Model 204</var> <var>[[FRCVOPT parameter|FRCVOPT]]</var> parameter from your selections and displays the computed value. | ||
<p>By default, recovery features are enabled. In an online environment, using the default options is recommended so that the file can participate in recovery if the system crashes. </p> | <p> | ||
<p>You might want to turn off recovery options if you are running a batch job that does not need to incur the overhead of recording information for recovery. FILEMGMT provides options to turn off specific recovery features, as described below. </p> | By default, recovery features are enabled. In an online environment, using the default options is recommended so that the file can participate in recovery if the system crashes. </p> | ||
<p>See [[File | <p> | ||
You might want to turn off recovery options if you are running a batch job that does not need to incur the overhead of recording information for recovery. FILEMGMT provides options to turn off specific recovery features, as described below. </p> | |||
<p> | |||
See [[File integrity and recovery]] for details about these options.</p> | |||
<table class="thJustBold"> | <table class="thJustBold"> | ||
Line 226: | Line 273: | ||
<p> | <p> | ||
Checkpoint logging is the process of capturing the contents of a record before an update is made. If checkpoint logging is not active, the file cannot participate in recovery.</p> | Checkpoint logging is the process of capturing the contents of a record before an update is made. If checkpoint logging is not active, the file cannot participate in recovery.</p> | ||
<p>(FRCVOPT=X'20')</p></td></tr> | <p> | ||
(FRCVOPT=X'20')</p></td></tr> | |||
<tr> | <tr> | ||
Line 233: | Line 281: | ||
<p> | <p> | ||
Selecting this option requires that a journal be defined in the environment in which updates are made to the file. If a journal is not available, updates will not be allowed. If updates are made using a batch job, selecting this option will require that the batch job have a journal defined to it that will allow roll forward logging to be performed. </p> | Selecting this option requires that a journal be defined in the environment in which updates are made to the file. If a journal is not available, updates will not be allowed. If updates are made using a batch job, selecting this option will require that the batch job have a journal defined to it that will allow roll forward logging to be performed. </p> | ||
<p>(FRCVOPT=X'80')</p> | <p> | ||
(FRCVOPT=X'80')</p> | |||
</td></tr> | </td></tr> | ||
<tr> | <tr> | ||
<th nowrap>No Updates | <th nowrap>No Updates Without CK Logging</th> | ||
<td>File is not updated unless checkpoint logging is active.The default is null. | <td>File is not updated unless checkpoint logging is active.The default is null. | ||
<p> | <p> | ||
This option requires that a checkpoint data set be defined to the run. Updates will not be allowed unless a checkpoint data set is present. If updates are made using a batch job, the job must have a checkpoint data set.</p> | This option requires that a checkpoint data set be defined to the run. Updates will not be allowed unless a checkpoint data set is present. If updates are made using a batch job, the job must have a checkpoint data set.</p> | ||
<p>(FRCVOPT=X'40')</p> | <p> | ||
(FRCVOPT=X'40')</p> | |||
</td></tr> | </td></tr> | ||
Line 249: | Line 299: | ||
<p> | <p> | ||
This option will apply all updates during roll forward and not back out any incomplete update transactions. This option can only be used if Transaction back out (TBO) is turned off. This can be useful if a large number of updates are made without a commit being issued. It is suggested that after recovery has been run against a file with this option that a REORG be run against this file to ensure that the data and the indexes are in sync. </p> | This option will apply all updates during roll forward and not back out any incomplete update transactions. This option can only be used if Transaction back out (TBO) is turned off. This can be useful if a large number of updates are made without a commit being issued. It is suggested that after recovery has been run against a file with this option that a REORG be run against this file to ensure that the data and the indexes are in sync. </p> | ||
<p>(FRCVOPT=X'09')</p> | <p> | ||
(FRCVOPT=X'09')</p> | |||
</td></tr> | </td></tr> | ||
Line 257: | Line 308: | ||
<p> | <p> | ||
A discontinuity is an event that cannot be rolled back past during recovery. It will process the file using the discontinuity as a checkpoint for roll back and roll forward recovery. Essentially, a discontinuity creates a checkpoint for the file in question at the point in time when the discontinuity occurs. There is really no reason not to allow discontinuities.</p> | A discontinuity is an event that cannot be rolled back past during recovery. It will process the file using the discontinuity as a checkpoint for roll back and roll forward recovery. Essentially, a discontinuity creates a checkpoint for the file in question at the point in time when the discontinuity occurs. There is really no reason not to allow discontinuities.</p> | ||
<p>(FRCVOPT=X'10')</p> | <p> | ||
(FRCVOPT=X'10')</p> | |||
</td></tr> | </td></tr> | ||
</table> | </table></li> | ||
<li><b>Format File During CREATE:</b> FILEMGMT formats the file during file creation. Valid values are <code>Y</code> and <code>N</code>. Rocket Software recommends that you use the default value, <code>Y</code>, in order to maintain file integrity.</li> | |||
<li> | <li><b>Verify Disk Updates:</b> FILEMGMT verifies all updates made to the file during file creation. Valid values are <code>Y</code> and <code>N</code>. Rocket Software recommends that you use the default value, <code>N</code>. The computer does its own verification of disk updates, so this option is no longer necessary and likely to cause overhead.</li> | ||
</ol> | </ol> | ||
==Recreating files== | ==Recreating files== | ||
<p>A file recreate is necessary if, for example, you want to increase a table size that cannot be increased in the existing file. Recreating a file deletes all the data and procedures in the file, but leaves the field, record, and field group definitions intact. To preserve the data and procedures, you must dump or display the files and procedures. You cannot recreate a file from the primary screen, which has entities staged with commands.</p> | <p> | ||
<p>To recreate a file:</p> | A file recreate is necessary if, for example, you want to increase a table size that cannot be increased in the existing file. Recreating a file deletes all the data and procedures in the file, but leaves the field, record, and field group definitions intact. To preserve the data and procedures, you must dump or display the files and procedures. You cannot recreate a file from the primary screen, which has entities staged with commands.</p> | ||
<p>Select the File Maintenance Recreate function from one of the following:</p> | <p> | ||
To recreate a file:</p> | |||
<p>Select the File Maintenance <b>Recreate</b> function from one of the following:</p> | |||
<ul> | <ul> | ||
<li>Primary screen if the file is an existing file.</li> | <li>Primary screen if the file is an existing file.</li> | ||
<li>File Size Definition screen if the file is existing or staged, and if the sizing calculations show some tables are so large that the file needs to be recreated. (See [[ Managing | <li>File Size Definition screen if the file is existing or staged, and if the sizing calculations show some tables are so large that the file needs to be recreated. (See [[ Managing file and table size with FILEMGMT#Sizing an existing file|Sizing an existing file]].) </li> | ||
</ul> | </ul> | ||
<p>When you select the Recreate function, FILEMGMT creates a version of all field, record, and field group definitions and stages them for DEFINE. The steps for recreating a file are thereafter similar to the steps for creating a file described in [[#Overview of creating files|Overview of creating files]]. </p> | <p> | ||
<p>The Recreate function uses the same Definition screens as the CREATE function. </p> | When you select the <var>Recreate</var> function, FILEMGMT creates a version of all field, record, and field group definitions and stages them for <var>DEFINE</var>. The steps for recreating a file are thereafter similar to the steps for creating a file described in [[#Overview of creating files|Overview of creating files]]. </p> | ||
<p>You can select the Size function to resize the file after you redefine the file on the Definition screens. </p> | <p> | ||
The <var>Recreate</var> function uses the same Definition screens as the <var>CREATE</var> function. </p> | |||
<p> | |||
You can select the Size function to resize the file after you redefine the file on the Definition screens. </p> | |||
[[Category:FILEMGMT application subsystem]] | [[Category:FILEMGMT application subsystem]] |
Latest revision as of 20:29, 26 September 2016
Overview of creating files
Prerequisites:
- You must have Dictionary/204 and its subsystems running in order to use FILEMGMT.
- Before working your way through the File Management Subsystem facility (FILEMGMT) interface to create a file, you should have made decisions about the organization, recovery options, and security for the file you are creating. See File design for more information.
Adding a file to the database includes the following steps:
- Defining the file organization and recovery options (File Definition - Organization screen).
- Defining the file security (File Definition - Security screen).
- For procedure files, defining the parameters for the procedures contained in the file (File Definition - Procedure screen).
- For data files, defining fields, records, and field groups in the following order:
- Defining the fields in the file. (Field Name List screen; Field Attributes screen)
- Defining the records in the file. (Record Name LIst screen; Record Definitions screen)
- Defining the field groups in the file. (Optional. Field Group List screen; Field Group Definition screen.
See "Field group maintenance" in the Rocket Model 204 Dictionary/204 and Data Administration Guide for details.
- Sizing the file and its tables. (File Size Definition screen)
- Modifying the file's field, record, and field group definitions and the size specifications, as needed.
- Executing the CREATE command (Execute Commands screen).
Defining file organization
- Log on to FILEMGMT as described in Logging on to FILEMGMT.
- Select the FILE Maintenance CREATE function (number 1) from the primary screen.
FILEMGMT displays the first of the three File Definition screens, the Organization screen:
FILEMGMT File Definition - Organization PAGE 1 OF 3 Filename: VEHICLES FICREATE: 7.5 LANGUAGE: US Active/Inactive I FILE ORGANIZATION Opt Fld Ext: N RFG: N LG FILES: N FILEORG X' 0E ' Entry:__ Sorted:_ Hash:X Unordered:_ Reuse Record Numbers:_ Sort/Hash Key: Req Evry Rec: X Enable Skewing: _ Table B Auto Incr Pages: 0 Table D Auto Incr Pages: 0 Table X Auto Incr Pages: 0 File Models: None X 1nf _ Numeric Validation_ FILEMODL X' 00 ' FILE OPTIONS FOPT X' 00 ' Disable Lock Pending Updates: _ Only FM Defines New Fields: _ No Procedure Statement Numbers: _ No Procedure Statement Labels:_ Enable Date Time Stamp: N FILE RECOVERY OPTIONS FRCVOPT X' 00 ' Disable Transaction Backout: _ No Rollforward (RF): _ No RF Logging: _ No Checkpoint (CK) Logging: _ No Updates Without RF Logging: _ No Updates Without CK Logging:_ All Updates Applied During RF: _ No Discontinuities Allowed: _ Format File During CREATE: Y Verify Disk Updates: N ===> 1=HELp 2= 3=QUIt 4=FIElds 5=WIDen 6=COMmands 7= 8=FORward 9=SIZe 10= 11= 12=END |
You use the File Definition - Organization screen to name a new file and to specify file organization parameters. When this screen is displayed for a file for the first time, the standard Model 204 default values for the parameters are used.
Model 204 default values are supplied for any parameters for which you do not fill in values.
You select options from the choices on the screen, and FILEMGMT uses your selections to compute appropriate values for the Model 204 FILEMODL, FILEORG, FOPT, and FRCVOPT parameters.
- In the Filename input field, enter the name of the file that you are creating.
The name can be as many as eight characters long (7 for DOS systems). The file name cannot be
FILE
orGROUP
and cannot start withCCA
(except for CCASYS),SYS
,OUT
,TAPE
, or a number. It can contain only uppercase letters, numbers, and the following special characters:- At sign (@)
- Pound sign (#)
- Dollar sign ($) (alternately displayed as £)
- The FICREATE input field displays the Model 204 version number for the file that you are creating. FILEMGMT uses FICREATE to calculate the file size and validate certain Model 204 file features. Enter a different version number if needed.
- The LANGUAGE input field displays the language of the file that you are creating (set by the LANGFILE parameter). The default is U.S. English. Enter a different language if needed.
- Change the Active/Inactive default value as needed.
The Active/Inactive input field specifies how the commands in your file will be processed when you execute commands from the Execute Commands screen.
Active or inactive indicates the mode you selected on the Organization screen or last used to execute commands against the file. The file itself is referred to as active or inactive, depending on the mode in which commands for the file were last executed.
If you have permissions to change the value, and your system supports the alternative option you choose, your entry will override the system default set by the system administrator.
- Type
A
to create an Active file. The commands will be executed immediately (upon verifying your permissions) or later in a batch file. Select the active execution mode if you choose to transform the file to current release format. Set FICREATE to the current release number. - Type
I
to create an Inactive file. The commands will be generated and stored in separate files for later execution.Active and inactive options are described in Execution options and Execute Commands screen.
- In the Opt Fld Ext (optimized field extract) input field, enter
Y
to add a length byte to every non-preallocated (or non-OCCURS) field, which could result in faster field extraction. The improvement is most noticeable when you have built records with a large number of fields. EnteringY
sets FILEORG to X'80'.The default is
N
: non-preallocated (or non-OCCURS) fields that are type FLOAT, CODED, and BINARY are not stored with a preceding length byte. See Preallocated fields for more information on preallocated and non-preallocated fields. - In the RFG input field, enter
Y
to enable repeating field groups. Repeating field groups, available in Model 204 version 7.5, let you view and process groups of fields as a logical entity. Files with repeating field groups can have up to 32,000 fields. For more information, see Field group (File architecture).Entering
Y
sets FILEORG to X'100'. Note that the FILEORG X'100' attributes (such as CHUNK, DATETIME, and so on) are not currently supported by FILEMGMT. - In the LG Files input field, enter
Y
to enable support for large files. Large files, available in Model 204 version 7.5, can hold up to 48 million records. EnteringY
sets FILEORG to X'200'. - In the FILE ORGANIZATION section, select file organization characteristics for the specified file. FILEMGMT computes the Model 204 FILEORG parameter from your selections and displays the computed value. See File design for details on the advantages and disadvantages of each file organization type.
- Select one of the following options:
Option Parameter value Description Entry FILEORG X'00' Records are stored in the file in the order in which they are entered. You cannot reorder records or reuse the record numbers of deleted records. Entry is the default file organization. Sorted FILEORG X'01' Records are stored in the file in order by the sort key that you specify. Sorted is less efficient than the other options and is not recommended. Hash FILEORG X'08' Records are stored in the file in order by the hash key that you specify. Unordered FILEORG X'20' Records are stored in the file in the order in which they are entered. You can reorder records and reuse the record numbers of deleted records. - A record is stored on a page if there is sufficient space (as determined by the BREUSE parameter) and if there is an unused record number.
In the Reuse Record Numbers input field, enter
Y
orN
.Available with Unordered, Hash, or Sorted file organization. Select Reuse Record Numbers if you want the record numbers of deleted records to be reused for new records added, provided that the record number is available on the Table B page to which the new record is being added. Selecting Reuse Record Numbers sets the FILEORG X'04' bit.
- Enter a Sort or Hash key, if applicable.
If you have selected Hash or Sorted as the file organization, enter the name of the sort or hash key field. The entry must be a valid Model 204 field name (1-70 characters). The requirements for a valid field name are described in Field name rules. The sort or hash key field must exist in every record in the file.
If you have selected the Entry or Unordered file organization option, leave Sort/Hash Key blank.
- In the Req Every Rec input field:
If you have selected Hash or Sorted as the file organization, enter
X
to place a hash key (for hashed files) or a sort key (for sorted files) on every record. This option is required for hashed or sorted files because a key on every record is needed to process the file correctly. This option sets the FILEORG X'02' bit.If you have selected the Entry or Unordered file organization option, leave Req Evry Rec blank.
- Leave the Enable Skewing input field blank. Skewing is an obsolete method of physical storage that was designed to improve efficiency during sequential searches. An
X
would indicate that blocks within a track were stored in a skewed order. - Select the following Auto Increase options as needed. See File size calculation in detail for details.
- Table B Auto Incr Pages: If you want Model 204 to automatically increase Table B when it becomes full, enter the number of pages to increase Table B by. This sets the parameter BAUTOINC to the specified value.
- Table D Auto Incr Pages: If you want Model 204 to automatically increase Table D when it becomes full, enter the number of pages to increase Table D by. This sets the parameter DAUTOINC to the specified value.
- Table X Auto Incr Pages: If you want Model 204 to automatically increase Table X when it becomes full, enter the number of pages to increase Table X by. This sets the parameter XAUTOINC to the specified value. To use Table X:
The file must have been created in Model 204 version 7.1.0 or later.
The file must have an organization type of Entry or Unordered.
- Select one of the following options:
- File Models: A file model is a set of default file and field attributes. Rocket Software recommends that you use the default setting.
- In the FILE OPTIONS section, select the characteristics of the file you are creating. FILEMGMT computes the Model 204 FOPT parameter from your selections and displays the computed value.
Disable Lock Pending Updates Transaction back out locks an update until the transaction is committed, allowing an update to be backed out prior to the commit if for any reason the transaction does not finish. By disabling Lock Pending Updates, the feature Transaction back out is also disabled (Disable Transaction Backout must also be selected). If Disable lock pending updates is selected, incomplete transactions may be present in the file which may result in a file that is logically inconsistent. (FOPT=X'02') The default is null.
Only FM Defines New Fields This option prevents the DEFINE FIELD command from being issued without using the FILEMGMT facility. The purpose of this option is to maintain the integrity of the dictionary. By using the FILEMGMT facility to define fields, the relationship between a file, the records in the file and the fields and their relationship to the file and the records within the file is automatically maintained in the Dictionary. (FOPT=X'01') The default is that new fields can be defined outside of FILEMGMT on the command line.
No Procedure Statement Numbers Selecting this option prevents any procedures from being stored in the file which use statement numbers. Using statement numbers is an obsolete way of coding a User Language procedure which is difficult to understand. If this file is being used to store procedures, select this option in order to enforce proper coding standards. (FOPT=X'80') No Procedure Statement Labels Selecting this option prevents any procedures from being stored in the file which use statement labels. Statement labels are the proper way to code a User Language procedure. If this file will be used for storing procedures, enter N or leave the input field blank. Otherwise, enter Y if you want to prohibit procedure statement labels from being assigned to procedure lines. (FOPT=X'40') Enable Date Time Stamp The Date Time Stamp is an additional field within the file which tracks changes to a file at the record level and records the date and time of each update to a record. (FOPT=X'10') For details, see Overview of the date-time stamp feature. To use the date-time stamp:
- The file must be an LPU file.
- The date/time stamp field specified in the DTSFN= system parameter must have already been defined to the file. For details, see Enabling date-time stamp updates.
- In the FILE RECOVERY OPTIONS section, select file recovery options for the file. FILEMGMT computes the Model 204 FRCVOPT parameter from your selections and displays the computed value.
By default, recovery features are enabled. In an online environment, using the default options is recommended so that the file can participate in recovery if the system crashes.
You might want to turn off recovery options if you are running a batch job that does not need to incur the overhead of recording information for recovery. FILEMGMT provides options to turn off specific recovery features, as described below.
See File integrity and recovery for details about these options.
Disable Transaction Backout File does not use the Model 204 transaction back out feature. This option is required if Disable Lock Pending Updates is selected. Transaction back out is a feature that will back out an update if the update does not complete as intended. This feature maintains the logical integrity of the file by ensuring that if the commit for an update is not executed, the update will not be kept.
The default is null.
(FRCVOPT=X'08')
No Rollforward (RF) File does not use the roll forward facility of the RESTART command. The default is null. This option prevents the updates from the file from being processed during roll forward. If this option is selected, the file will not participate in roll forward when the system performs recovery. (FRCVOPT=X'02')
No RF Logging Model 204 does not log changes to the journal file. The default is null. Roll Forward logging is the recording of updates from a file that are then used to apply updates when recovery is run. Selecting this option prevents the file from being able to use recovery. (FRCVOPT=X'04')
No Checkpoint (CK) Logging Model 204 does not log checkpoint information to the checkpoint data set. The default is null. Checkpoint logging is the process of capturing the contents of a record before an update is made. If checkpoint logging is not active, the file cannot participate in recovery.
(FRCVOPT=X'20')
No Updates without RF Logging File is not updated unless roll forward logging is active. The default is null. Selecting this option requires that a journal be defined in the environment in which updates are made to the file. If a journal is not available, updates will not be allowed. If updates are made using a batch job, selecting this option will require that the batch job have a journal defined to it that will allow roll forward logging to be performed.
(FRCVOPT=X'80')
No Updates Without CK Logging File is not updated unless checkpoint logging is active.The default is null. This option requires that a checkpoint data set be defined to the run. Updates will not be allowed unless a checkpoint data set is present. If updates are made using a batch job, the job must have a checkpoint data set.
(FRCVOPT=X'40')
All Updates Applied During RF All updates to the file are applied when the file is rolled forward. The default is null. This option will apply all updates during roll forward and not back out any incomplete update transactions. This option can only be used if Transaction back out (TBO) is turned off. This can be useful if a large number of updates are made without a commit being issued. It is suggested that after recovery has been run against a file with this option that a REORG be run against this file to ensure that the data and the indexes are in sync.
(FRCVOPT=X'09')
No Discontinuities Allowed Only updates that do not result in discontinuities are applied to the file. The default is null. A discontinuity is an event that cannot be rolled back past during recovery. It will process the file using the discontinuity as a checkpoint for roll back and roll forward recovery. Essentially, a discontinuity creates a checkpoint for the file in question at the point in time when the discontinuity occurs. There is really no reason not to allow discontinuities.
(FRCVOPT=X'10')
- Format File During CREATE: FILEMGMT formats the file during file creation. Valid values are
Y
andN
. Rocket Software recommends that you use the default value,Y
, in order to maintain file integrity. - Verify Disk Updates: FILEMGMT verifies all updates made to the file during file creation. Valid values are
Y
andN
. Rocket Software recommends that you use the default value,N
. The computer does its own verification of disk updates, so this option is no longer necessary and likely to cause overhead.
Recreating files
A file recreate is necessary if, for example, you want to increase a table size that cannot be increased in the existing file. Recreating a file deletes all the data and procedures in the file, but leaves the field, record, and field group definitions intact. To preserve the data and procedures, you must dump or display the files and procedures. You cannot recreate a file from the primary screen, which has entities staged with commands.
To recreate a file:
Select the File Maintenance Recreate function from one of the following:
- Primary screen if the file is an existing file.
- File Size Definition screen if the file is existing or staged, and if the sizing calculations show some tables are so large that the file needs to be recreated. (See Sizing an existing file.)
When you select the Recreate function, FILEMGMT creates a version of all field, record, and field group definitions and stages them for DEFINE. The steps for recreating a file are thereafter similar to the steps for creating a file described in Overview of creating files.
The Recreate function uses the same Definition screens as the CREATE function.
You can select the Size function to resize the file after you redefine the file on the Definition screens.