Internal files

From 2EWiki

Jump to: navigation, search

2E stores the metadata of the model in its internal files, whose name start with the letter Y. To list these files, you can enter the following command:

WRKOBJ OBJ(myModelMDL/Y*) OBJTYPE(*FILE)

Useful internal files

There is a wealth of information stored in the internal files. However, not all the internal files contain useful information for the application developer, or they are multi-member or multi-format, thus they are difficult to query. Despite that, there is a number of physical and logical files that are easy to query and include easy to read information. Here is a list of useful internal files, and a brief description:

File Description
YACPDTARFP Access paths
YFLDDTA0JL Fields and its attributes

Querying the internal files

Among other uses, querying the available fields helps to avoid creating unnecessary new field names, by reusing existing fields in the model that can perform the same function and have a descriptive and useful name.

Example

Let's suppose that we are looking for a field that we want to use as a description. The field should be at least 30 characters long, but not longer than 40 characters. The text of the field should contain the word "description", but it could be abbreviated as "desc" or "dsc". Here is a SQL statement to retrieve some useful candidates:

SELECT * 
FROM YFLDDTA0JL 
WHERE (upper(FLD) like '%DESC%' or upper(FLD) like '%DSC%') 
       and EXTLEN between 30 and 40
Personal tools