File Link Maintenance |
|
The File Link Maintenance utility allows you to define and maintain the cross-reference linkages that exist between application data files. Based on existing files with embedded dictionaries defined in Data Dictionary Maintenance, you can specify which files have fields that can be used to populate keys to read cross-reference files to obtain more information. A one-to-one relationship is supported between the files where the fields from one file match the key for the cross-referenced file. For example, an Invoice Header file may contain a client code that can be used to read the Client Master File to obtain the client's name and address, as well as the sales code to obtain the name of the sales representative from the Salesperson file.
The purpose of this utility is to provide link definitions that can be used to simplify specifying relationships in Query Definitions and Views Data Source Definitions, as well as Input Source Definitions in the Report Designer.
With the File Links Express utility, you can quickly create new cross-reference file links to other files in the data dictionary based on the primary key or other unique alternate key of the file being linked to.
(The File Link Maintenance utility was added in PxPlus 2016.)
(The File Links Express utility was added in PxPlus 2023.)
To invoke this utility, use one of the following methods:
Location |
Method |
From the PxPlus IDE Main Launcher |
Expand the Data Management category and select File Link Maintenance. |
From the NOMADS Session Manager |
From the Dictionary menu, select File Link Maintenance. |
From the PxPlus Command line |
Enter: LINKS |
This window consists of the following:
File To Link |
If no File To Link is specified, the default is to display All links. Enter a logical file name to show just the links related to that file. To query the logical file name by Group or by Name, use any of the following methods:
| ||||||
Link Express |
Button that invokes the File Links Express utility for creating multiple links to other files in the data dictionary based on the primary key or other unique alternate key of the file being linked to. (The Link Express button was added in PxPlus 2023.) | ||||||
File Links |
Displays a list of all currently existing link definitions. This list consists of the link description, the file being linked from, the file being linked to, and the key used to read the latter. | ||||||
Add |
Invokes File Link Definition for adding a new link definition. | ||||||
Edit |
Invokes File Link Definition for editing an existing link definition selected from the list. | ||||||
Delete |
Deletes an existing link definition selected from the list. | ||||||
Test |
Button that is used to test a selected link definition. Click on a link definition row to select it and then click the Test button to display the results in a separate window. (The Test button was added in PxPlus 2023 Online Update 0001.) | ||||||
Close |
Closes File Link Maintenance. |
File Link Definition is used to add, edit, delete and test file link definitions. You can perform multiple updates in one session.
This window consists of the following:
Link From |
Logical file name of the main file whose fields can be used to populate a key to read a cross-reference file.
To display information about the selected file, hover the mouse pointer over the information button. | ||||||
Link To |
Logical file name of the cross-reference file.
To display information about the selected file, hover the mouse pointer over the information button. | ||||||
Access Key |
Key by which to read the cross-reference file (i.e. Link To). To display a more detailed key definition, hover the mouse pointer over the information button. | ||||||
Record Prefix |
A string used to prefix the field names of the cross-reference file record in case there are duplicate field names in the main file. The prefix can be a maximum of 10 characters. Example: The main file and link file may both have a field called ProductCode$. To differentiate the fields, a record prefix of prod would result in the fields in the cross-reference file being prefixed by prod., e.g. prod.ProductCode$. Note: | ||||||
Key Expression |
A PxPlus expression comprised of fields from the main file, functions, literals and/or global variables that is used to populate the key of the cross-reference file when reading it. A key expression may be string or numeric. Examples: TRN_CUSTID$ "D"+FLD#2$(1,3) PAD(Company$,5,$00$)+PAD(Department$,10,$00$)+STR(EmployeeNum) KEY(__fileFN,KNO=0,KEY=Company$:Department$:EmployeeNum) When dealing with multi-segmented keys (i.e. keys made up of more than one field), you can use a + (plus sign) to concatenate multiple string segments of a key when entering a free-form expression. Be sure to add the correct padding logic to the initial key segments. By default, the initial segments of native PxPlus keys are padded with $00$ characters, and the final segment is not padded. Such a key definition might look like this: PAD(Company$,5,$00$)+PAD(Department$,10,$00$)+STR(EmployeeNum) Individual applications can pad key segments with other characters, such as spaces; therefore, knowledge of the key architecture of individual files is a must. Knowledge of segment characteristics is not necessary; however, if the key expression uses the KEY(__linkFN,KNO=n,KEY=FLD1$:FLD2$) format where __linkFN is a special channel variable used by the system when evaluating the key, n is the key number used by the file, and FLD1$:FLD2$ are the key segment variables. The latter format is also more flexible as it can handle changes in key segment length if keys are updated for a file. In addition, this format allows a mixture of string and numeric segments. An easy way to build a key expression is to use the Key Expression utility, which is invoked by clicking the Tool button next to the Key Expression.
The key expression is built by specifying key segments to match the target key definition. These segments can consist of fields from the parent file, literal values and variables. Partial items can be defined, and segments can be padded, have characters stripped, or be converted to upper/lower case. In the case of multi-segment keys, a Generate a KEY=F1$:F2$ expression check box option is available:
Simple numeric keys can be built using a numeric field. Multi-segment numeric keys should be built using the Generate a KEY=F1$:F2$ expression option. (The Generate a KEY=F1$:F2$ expression check box was added in PxPlus 2023.) | ||||||
Link Description |
A unique description to identify the file link definition. | ||||||
Test |
Tests the current file link definition and displays the results in a separate window. | ||||||
Save |
Saves/updates the file link definition. | ||||||
Delete |
Deletes the selected file link definition. Prior to deleting the file link, a message will display. | ||||||
Clear |
Clears the fields and leaves the File Link Definition window open. | ||||||
Close |
Closes File Link Definition and returns to File Link Maintenance. If any unsaved changes are detected, a message will display. |
The File Links Express utility allows you to quickly create new cross-reference file links to other files in the data dictionary based on the primary key or other unique alternate key (see Defining Keys) of the file being linked to.
Example:
The primary key (Country$) for the Countries file may exist in a number of other files in the data dictionary that are not currently linked to it. This utility will search the data dictionary for all files that contain a Country$ field and list them as possible cross-reference files.
Options for each cross-reference file can be defined individually, or the Edit All feature (in top row) can be used for a specific column to apply the option for all the tables in the list.
(The File Links Express utility was added in PxPlus 2023.)
(The ability to select other unique alternate keys, besides Primary key, was added in PxPlus 2023 Online Update 0001.)
To invoke the File Links Express utility, click the Link Express button in File Link Maintenance.
This window consists of the following:
File to Link to |
Enter the table to search for potential links to other files in the data dictionary based on key information. | ||||||||||||
Select Key |
Select the table key from a list of unique keys on which to base the link definition. (The Select Key drop box was added in PxPlus 2023 Online Update 0001.) | ||||||||||||
(Links Grid) |
Grid that is used to add or edit file links. This grid consists of the following:
| ||||||||||||
Test the selected link |
Button that is used to test a selected link definition. Click on a link definition row to select it and then click the Test button to display the results in a separate window. (The Test button was added in PxPlus 2023 Online Update 0001.) | ||||||||||||
Add a new link |
Button that is used to add a table to the list. | ||||||||||||
Remove selected table from list |
Button that is used to remove the selected table from the list only. Does not remove the file link definition from the system. To remove a file link definition, select the table in File Link Maintenance and click the Delete button. | ||||||||||||
View Log |
(Available when additions or changes have been applied) Displays the log file that contains a list of link definitions that have been added or updated. The contents are displayed as a PDF, which also provides options for printing or saving the log, if desired. | ||||||||||||
Apply |
Saves the file link definitions that are indicated by the Make Link entries. Whenever link definitions are applied, a log file is updated. The log entries are cumulative as links to different files are applied. | ||||||||||||
Exit |
Closes the File Links Express utility. If changes have been made to the file link definitions but not applied, a message will display. If records exist in the log file, a message will ask if you want to view the log. |