Table A (File architecture): Difference between revisions

From m204wiki
Jump to navigation Jump to search
No edit summary
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Table A contains three structures:
Table A contains three structures: a file dictionary, a set of MANY-VALUED pages, and a set of FEW-VALUED pages. The first of these is a dictionary of the names and attributes of the file's fields and field groups. Some field attributes (notably <var>[[Field design#CODED and NON-CODED attributes|CODED]]</var>) require sets of values to be maintained. These values are stored either in the [[Field design#FEW-VALUED and MANY-VALUED attributes|FEW-VALUED or MANY-VALUED]] attribute structures.  
 
A dictionary of the fieldgroup / field names and their attributes.
 
Some attributes (notably '[[#Field Design (File Management)#CODED and NON-CODED attributes|CODED]]') require sets of values to be maintained. These values are stored either in the [[#Field Design (File Management)#FEW-VALUED and MANY-VALUED attributes|FEW-VALUED or MANY-VALUED attribute]]s structures.  


Table A usually is small in relation to the rest of the file.  
Table A usually is small in relation to the rest of the file.  


<div id="Internal File Dictionary">
==Internal file dictionary==
== <div id="Table A (File Architecture) Internal File Dictionary">Internal File Dictionary</div> ==
<p>
 
The internal file dictionary is a hashed file where each page contains as many as <var>[[ASTRPPG parameter|ASTRPPG]]</var> field or field group definitions. The exact number of pages in the internal file dictionary is defined by the <var>[[ATRPG parameter|ATRPG]]</var> parameter. </p>
<p>Defined by the [[ATRPG parameter|ATRPG]], the internal file dictionary is a hashed file where each page contains up to [[ASTRPPG parameter|ASTRPPG]] field or field group definitions.</p>
 
<p>Each entry contains the field code (the representation of the field as physically used in records); the field name; and the attributes as assigned by the [[DEFINE FIELD command]] (or by a redefinition).</p>  


<p>To understand all the possible content of any entry, please refer to the [[ZFIELD image]] (the structure definition is provided with the Model 204 product). This image is populated by the [[Data Maintenance#$FDEF|$FDEF]] or [[Data Maintenance#$LSTFLD|$LSTFLD function]]s.</p>
<p>Each entry contains the field code (the representation of the field as physically used in records), the field name, and the field attributes as assigned by the <var>[[DEFINE FIELD command|DEFINE FIELD]]</var> command (or by a redefinition).</p>  


<p>To understand all the possible content of any entry, refer to the [[ZFIELD image]] (the structure definition is provided with the Model&nbsp;204 product). This image is populated by the <var>[[$FDef|$FDef]]</var> or <var>[[$LstFld|$LstFld]]</var> function.</p>


=== Non FILEORG X'100' Files ===
===Non FILEORG X'100' files===
The maximum number of fields (the product the <var>ASTRPPG</var> and <var>ATRPG</var> parameter values) in a Model 204 file is 4000, unless the file is defined with the X'100' bit of the <var>FILEORG</var> parameter, as described in the following subsection. This limit might not actually be reached because of wasted entries (where <var>ASTRPPG</var> is defined as too large, you cannot fit the full number on any page) or due to vagaries of the hashing algorithm.


The maximum number of fields (the product of [[ASTRPPG parameter|ASTRPPG]] * [[ATRPG parameter|ATRPG]]) in any Model 204 file is 4000.  
===Enhanced Data Handling files (FILEORG X'100' files)===
In a <var>FILEORG</var> X'100' file (introduced in version 7.5 of Model&nbsp;204), the maximum number of fields (<var>ASTRPPG</var> * <var>ATRPG</var>) is 32000 (not the usual 4000). To support this increase as well as to support field groups, the overhead in these files for each field occurrence is 4 bytes (not the usual 3).


Even a number of 4000 or less might not actually be reached because of wasted entries (where ASTRPPG is defined as too large, you cannot fit the full number on any page) or due to vagaries of the hashing algorithm.
If the maximum number of fields (<var>ASTRPPG</var> * <var>ATRPG</var>) in a <var>FILEORG</var> X'100' file exceeds 4000, no fields can be defined as <var>[[Field design#KEY and NON-KEY attributes|KEY]]</var>, <var>[[Field design#NUMERIC RANGE and NON-RANGE attributes|NUMERIC RANGE]]</var>, or <var>[[Field design#FOR EACH VALUE (FRV) and NON-FRV attributes|FOR EACH VALUE]]</var>.


=== Enhanced Data Handling files (FILEORG X'100' files) ===
==MANY-VALUED and FEW-VALUED pages==
 
If a field has the <var>[[Field design#CODED and NON-CODED attribute|CODED]]</var> or <var>[[Field design#FOR EACH VALUE (FRV) and NON-FRV attibute|FRV]]</var> attribute, a complete list of the values that the field has ever had (since it was last created or reorganized) is held in the <var>FEW-VALUED</var> or <var>MANY-VALUED</var> sets of pages in Table A (<var>MANY-VALUED</var> is the default).
With the introduction of X'100' files (in version 7.5 of Model 204) the maximum number of fields (<var>[[ASTRPPG parameter|ASTRPPG]]</var> * <var>[[ATRPG parameter|ATRPG]]</var>) has been increased to 32000.
 
In order to support this increase as well as the additional attributes, the field code has been increased from 2 to 3 bytes.
 
Where the maximum number of fields exceeds 4000, no fields can be defined as <var>[[Field Design (File Management)#KEY and NON-KEY attributes|KEY]]</var>, <var>[[Field Design (File Management)#NUMERIC RANGE and NON-RANGE attributes|NUMERIC RANGE]]</var>, or <var>[[Field Design (File Management)#FOR EACH VALUE (FRV) and NON-FRV attributes|FOR EACH VALUE]]</var>.
 
== MANY-VALUED and FEW-VALUED pages ==
 
If a field has the [[#Field Design (File Management)#CODED and NON-CODED attribute|CODED]] or [[#Field Design (File Management)#FOR EACH VALUE (FRV) and NON-FRV attibute|FRV]] attribute, a complete list of the values that the field has ever had (since it was last created or reorganized) is held in either FEW-VALUED or MANY-VALUED pages in Table A (MANY-VALUED is the default).


Both of these sets of pages should be kept very small. If large numbers of values exist, the File Manager should consider making the field Ordered.
Both of these sets of pages should be kept very small. If large numbers of values exist, the File Manager should consider making the field Ordered.


==Parameters related to the use of Table A==
==Parameters related to the use of Table A==
 
<table>
::{|
<tr><td><var>[[ASIZE parameter|ASIZE]]</var></td>
|[[ASIZE parameter]]
<td>The size of Table A (the sum of the values of <var>ATRPG</var>, <var>FVFPG</var>, and <var>MVFPG</var>). View-only. </td></tr>
|A view-only parameter containing the size of Table A (the sum of ATRPG + FVFPG + MVFPG).  
|-
<tr><td nowrap><var>[[ASTRPPG parameter|ASTRPPG]]</var></td>
|[[ASTRPPG parameter]]
<td>The maximum number of field and field group definitions per page, and also the maximum number of field values per page in either the FEW-VALUED or MANY-VALUED section of Table A. </td></tr>
|The maximum number of field / RFG definitions per page, or maximum number of field values per page in either the FEW-VALUED or MANY-VALUED section of Table A.  
|-
<tr><td><var>[[ATRPG parameter|ATRPG]]</var></td>
|[[ATRPG parameter]]
<td>The number of pages containing field and field group definitions.</td></tr>
|The number of pages containing field / RFG definitions.
|-
<tr><td><var>[[FVFPG parameter|FVFPG]]</var></td>
|[[FVFPG parameter]]
<td>The number of pages containing FEW-VALUED field values.</td></tr>
|The number of pages containing FEW-VALUED field values.
|-
<tr><td><var>[[MVFPG parameter|MVFPG]]</var></td>
|[[MVFPG parameter]]
<td>The number of pages containing MANY-VALUED field values.</td></tr>
|The number of pages containing MANY-VALUED field values.
</table>
|}
 




[[Category:File architecture]]
[[Category:File architecture]]

Latest revision as of 20:11, 28 July 2014

Table A contains three structures: a file dictionary, a set of MANY-VALUED pages, and a set of FEW-VALUED pages. The first of these is a dictionary of the names and attributes of the file's fields and field groups. Some field attributes (notably CODED) require sets of values to be maintained. These values are stored either in the FEW-VALUED or MANY-VALUED attribute structures.

Table A usually is small in relation to the rest of the file.

Internal file dictionary

The internal file dictionary is a hashed file where each page contains as many as ASTRPPG field or field group definitions. The exact number of pages in the internal file dictionary is defined by the ATRPG parameter.

Each entry contains the field code (the representation of the field as physically used in records), the field name, and the field attributes as assigned by the DEFINE FIELD command (or by a redefinition).

To understand all the possible content of any entry, refer to the ZFIELD image (the structure definition is provided with the Model 204 product). This image is populated by the $FDef or $LstFld function.

Non FILEORG X'100' files

The maximum number of fields (the product the ASTRPPG and ATRPG parameter values) in a Model 204 file is 4000, unless the file is defined with the X'100' bit of the FILEORG parameter, as described in the following subsection. This limit might not actually be reached because of wasted entries (where ASTRPPG is defined as too large, you cannot fit the full number on any page) or due to vagaries of the hashing algorithm.

Enhanced Data Handling files (FILEORG X'100' files)

In a FILEORG X'100' file (introduced in version 7.5 of Model 204), the maximum number of fields (ASTRPPG * ATRPG) is 32000 (not the usual 4000). To support this increase as well as to support field groups, the overhead in these files for each field occurrence is 4 bytes (not the usual 3).

If the maximum number of fields (ASTRPPG * ATRPG) in a FILEORG X'100' file exceeds 4000, no fields can be defined as KEY, NUMERIC RANGE, or FOR EACH VALUE.

MANY-VALUED and FEW-VALUED pages

If a field has the CODED or FRV attribute, a complete list of the values that the field has ever had (since it was last created or reorganized) is held in the FEW-VALUED or MANY-VALUED sets of pages in Table A (MANY-VALUED is the default).

Both of these sets of pages should be kept very small. If large numbers of values exist, the File Manager should consider making the field Ordered.

Parameters related to the use of Table A

ASIZE The size of Table A (the sum of the values of ATRPG, FVFPG, and MVFPG). View-only.
ASTRPPG The maximum number of field and field group definitions per page, and also the maximum number of field values per page in either the FEW-VALUED or MANY-VALUED section of Table A.
ATRPG The number of pages containing field and field group definitions.
FVFPG The number of pages containing FEW-VALUED field values.
MVFPG The number of pages containing MANY-VALUED field values.