The Data Detective has several useful features but perhaps the most helpful one is the tool’s ability to scan through all of the file field descriptions in your database and display all of the fields with a description containing the search argument you entered. As an example of how this function is used, let us pretend that you are creating a program to display all of the open invoices for a customer. To do this you will need to know what files contain the invoicing information. It would also be helpful to know if your system has other programs where you can copy business and/or programming logic to reduce your coding time.
For the environment field we can enter in the name of the operating environment that contains the invoice data and programs we are researching. If the name of the environment is unknown, you can press F4 to bring up a listing of valid environments. For our example, we would like to search for the information from within the LAAMS Leasing System so we enter the environment ID “LAAMS”. See Exhibit A.
If you know the name of the library you may enter it in the library field. If you are unsure of the library, or would just like EASY400 to scan the entire operating environment, then you can leave this field blank or enter in “*ENVLIB”. *ENVLIB is similar to the AS/400’s “*LIBL” but it allows you to scan the library list of the selected environment without actually changing your library list.
The file name can be entered if you would like to hone your search to a particular file or would just like to see the fields, attributes and keys of a file.
In order to display a listing of the data fields for this environment that are related to invoicing, “INVOICE” is entered in the search for field. You may enter in a second search argument to further hone your search. Type “AND” in the And/Or field if the field description must contain both search arguments or enter “OR” if the field description can contain either.
Exhibit A – Example of how The Data Detective is used
If the field name is known, the search can be further honed by entering it into the field name field. If only the prefix or suffix of the field name is known, asterisks (*) can be used as a wildcards. In our example shown in Exhibit B we are limiting the search to contain only the field names that contain the characters “COD”.
Exhibit B – Using wildcards to narrow the search.
The Scan work files? field enables you to ignore files that have been identified as work files on your system. Files are identified as work files within The Object Usage Utility by typing a Y in the “Work File?” field next to the file name.
More information on the fields listed can be obtained by pressing F11=Toggle as shown in Exhibit C. Based on details such as the description, the frequency of usage and the file that is using the field you should be able to narrow your search for the correct file. The function keys displayed on the bottom provide shortcuts to other EASY400 tools and to AS/400 commands and functions. Press F24 to view more keys.
Exhibit C – View after F11=Toggle is pressed.
There are also several options available (listed in blue, press F23 to view more options) to assist in the research process and enhance the usability of the AS/400. The options are outlined in detail in section C on the following page. Simply enter the option next to the field name and press enter.
Remember, you can prompt all fields using F4. F12 will back you out one screen at a time.
CD=Custom Description
Allows users to create a custom description of a field within EASY400. This function keeps the description as it is already defined in the file while also creating a custom description for the field, which may be more meaningful to some users. Since the actual file is not changed, no recompiling of the file or the programs that use it is necessary.
CH=Create Header
This function will create a record in the file HEADINGS in library EASY400 that contains all of the field descriptions for the file. This function is a huge help when downloading files to a PC as they oftentimes do not download the field descriptions. Without these field descriptions the PC file just contains data, with the descriptions the PC file contains information. Typically, programmers or users have to go through the tedious and error-prone process of entering each of the field headings by hand. With the Create Header function, users can type CH next to a field name corresponding to the file they are downloading, download the HEADINGS file, scan for the file name that they need the headings for, and copy the heading record for the file into the downloaded file.
DF=Display Fields
Type DF next to a field to view a listing of all of the fields contained within the selected file.
DO=Display Object
Use this function to display object information such as size and creation date for the selected file.
FD=File Description
This function displays file specific information such as the files description, keys, file members, etc. related to the selected file.
KY=File Keys
Type KY to view the keys for the selected file and the key field's attributes.
LF=Logical Files
This option will display a listing of all of the logical files built over a physical file along with the keys used in the file and the key field's attributes.
RG=Reorganize Physical File
This function will reorganize the selected physical file. Reorganization frees up data space on your system by removing deleted records and compressing the file. Through reorganization, file-processing speeds can be improved greatly in instances where a program is reading sequentially a keyed file. EASY400 will handle most of the error handling associated with this process. NOTE: In the rare event of an abnormal system end or an abnormal end job (ENDJOBABN) you must rebuild the access path for the member.
SR=Select Records
This function enables users to select records from a file and display the selected records.
UB=Used By
Use this option to have EASY400 create a listing of every program that uses the selected file.
VF=View File
Use this function to display the data within a file.
VS=View Source
Use this option to view the source that was used to create the file.