

Commands (YPOPWSIPDD - Y2CALL) › YRTVPFMDL (Retrieve Physical Files Into Model) Command › Notes
Notes
The YRTVPFMDL command retrieves into a model all file and field definitions not already present in the model. For each named database file, the command proceeds in the following manner.
- The i OS command Display File Field Description (DSPFFD) is used to obtain the object's file, format and field definitions.
- The existing model is examined to determine if a file already exists in the model with a source member name that is the same as the i OS object name of the file. (The source member names for files are specified with the Edit Access Path Details display: the name is held on the PHY (Physical) access path).
If an access path of type PHY with the same member name already exists in the model, the retrieved file is ignored. If one does not exist, then a new file is added to the model as follows:
- The text (if any) of the database file is used as the name: for example, Customer file. If another file already exists with the text, then a number is appended to the text of the new file name to make it unique. For example, Customer file 01265. If the file has no text then the i OS object name is used as the Synon/2E name.
- The new file has a file type of REF.
- An access path of type Physical (PHY) is defined. The source member name held for the access path is the i OS object name of the retrieved file.
- The Assimilated file flag on the file details is set to yes.
- A Defined as relation is created for the file.
- For each field in the database file definition or column in the table definition, the YRTVPFMDL command proceeds in the following manner:
The existing model is examined to determine if a field already exists in the model with a DDS name that is the same as that of the retrieved field. The comparison is done as follows:
- If RMVFLDPFX(*YES) was specified, the field prefix is dropped from the retrieved DDS field name for purposes of comparison. For example, JJCUCD is compared with CUCD. The field names, against which the retrieved field name is compared, are the values (i.e., those shown on the Edit Field Details and the Display Field References displays).
- If RMVFLDPFX(*NO) was specified, the full DDS name of the retrieved field is used for the comparison. For example, JJCUCD is compared with JJCUCD. The field names against which the retrieved field name is compared are not the values, but rather old field names.
- If the name matches, a further comparison is made between the length and i OS data type (packed, zoned, or alphanumeric) of the retrieved field and the existing model fields.
- If a field of the correct name and type exists in the model, no new field is added. If one does not exist, then a new field is added to the model as follows:
- The text of the retrieved field is used as the name: for instance, "Customer code". If another field already exists with the text, then a number is appended to the text of the new name to make it unique. For example, Customer code 012654. If the retrieved field has no text, then the retrieved DDS name is used as the Synon/2E name.
- The new field is given a data type according to the i OS data type of the retrieved field as follows:
|
i OS Type
|
Length in Bytes
|
CA 2E Type
|
|
A
|
1
|
STS
|
|
A
|
2 - 10
|
CDE
|
|
A
|
11 or more
|
TXT
|
|
P
|
Any: integer
|
NBR
|
|
P
|
Any: real
|
VAL
|
|
S
|
Any: integer
|
|
S
|
Any: real
|
VAL
|
- If RMVFLDPFX(*YES) was specified, the truncated field name is stored as the field name. For example, JJCUCD is stored as CUCD.
- If RMVFLDPFX(*NO) was specified, Synon/2E allocates a new name as the DDS field name. For example, CUSNUM might be stored as ZQNB.
- A Has relation is added to connect every field with the file, unless the file is a field reference file, as specified by the REFFILE parameter.
- A physical file format entry is created. This is used to store:
- The old field name used in the particular i OS physical file.
- The sequence of the field within the retrieved PF record.
- The i OS data type and length of the old field.
This information can be used by Synon/2E to regenerate source for an i OS physical file that exactly matches the retrieved version. You can use the Edit Physical File Format entries display to examine and change the physical file format entries.
- Amending the retrieved file.
Having retrieved a database file into a model, you will need to add extra information to specify the key relations and to establish the file-to-file relations among the various files that you have retrieved. This should be done as follows:
- Change the field attributes of code fields that are the keys of files to be CDE. (Select Z2 to invoke the Edit Field Details display for the key fields, and use F8 to change the attributes).
- Alter the relation type of the relations that connect Synon/2E files with their own key fields from Has to Known by or Qualified by. (Type over the existing relation using the Edit Database Relations display).
- Alter the relation type of files containing fields that are the keys to other files from Has to Refers to, or Owned by, and change the referenced field of such relations to be the appropriate referenced Synon/2E file. (Type over the existing relation using Edit Database Relations display. Also delete superfluous relations using the D option).
You should also amend the field details in order to specify additional data types and to add field conditions:
- Change the field attributes of non-key fields to be the appropriate type (for example, TXT, STS). (Select Z2 to invoke the Edit Field Details display for the non-key fields, and use F8 to change the attributes).
- Use the Edit Condition Details display to add conditions. Use the Edit Field Details display to change the field attributes to specify a check condition.
- The removing of field prefixes that takes place if RMVFLDPFX(*YES) is specified is done by a CL program, YRTVPHYR1C, the source of which is supplied. You may modify this program if you wish. An example would be if you need to retrieve file descriptions from systems where a convention of appending a prefix to the end of field names, rather than the beginning, has been used.
- The use of the reference file parameter is not related to the Synon field reference files specified by the model value YFRFVNM.
Copyright © 2014 CA.
All rights reserved.
 
|
|