In this section:
You can customize an existing Join by changing the files or fields involved. If no default Join was created, you can use the same technique to specify a connection explicitly.
You can also change the Join name, make the Join a single instance, use a virtual field as the Join field, and add tag names to the Join files.
For related information, see Working With Joins.
If you delete the host file, all cross-referenced files are automatically deleted.
You can also select the Join connector line and click the Delete button on the toolbar, or press the Delete key.
The files remain in the window with no connector line between them.
To create your own Join (after deleting the existing Join, if necessary):
A Join connector line appears.
You can leave the Join window open and create another Join by:
You can define up to 63 concurrent Joins that will have a maximum of 64 segments in the new join structure.
By default, each Join is a multiple instance.
To make the Join a single instance:
A default name is automatically assigned to each Join.
You can use the Join name to later clear the Join and to prevent another Join from overwriting it. If you remove the Join name completely, any subsequent unnamed Join will overwrite this Join.
You can also provide a description. This is not used in the Join command. It is used for reference purposes. A comment (-*) is added to the procedure. For example, -*JOINDESC J0.
Note: The following words cannot be used as a Join name: ALL, AND, AS, IN, JOIN, TAG, TO, WITH.
A virtual field is a temporary field that you describe in a Master File or procedure. The value of the virtual field is calculated and treated as part of the data source.
Consider the following factors before making a virtual field the host field in a Join:
The Join Define in File dialog box opens.
The virtual field appears in the Fields window of the host file.
You cannot join multiple fields with this option. The virtual field must be the only Join field.
The Join Define in File dialog box has the following fields and options:
Identifies the virtual field that is the host field in the Join.
Associates the virtual field with a segment in the data source. Select any field from the segment in which you want to place the virtual field.
Tag names provide a way of making identical field names a single instance. They function as aliases for the file names in the Join. Tag names are useful when you join a file to itself because in such a Join all field names, segment names, and file names are the same in the host and cross-referenced files. For more information, see Joining a Data Source to Itself: The Recursive Join. Tag names are also useful if a file is used as a target more than once in the join structure.
A procedure can use the tag name of a file as a qualifier for field names and aliases in the file.
If you create a report using a recursive Join without tag names, the field names in the cross-referenced file are prefixes with the first four characters of the Join name.
To add a tag name to a file in the Join:
The following example illustrates the effect of tag names on the Join syntax:
JOIN JOBFILE.JOBSEG.JOBCODE IN jobfile TAG tag name Job TO ALL JOBFILE.JOBSEG.JOBCODE IN jobfile TAG tag name Jobc AS J4 END
If you add the tag name FILE1 to the host file, and the tag name FILE2 to the cross-referenced file, the following Join is created:
A report can refer to the field names in the host file with the qualifier FILE1 and in the cross-referenced file with the qualifier FILE2, for example, FILE1.JOBSTART and FILE2.JOBSTART. For additional information, see How to View Join Syntax.
Tag names are not supported in Report Painter. You can use qualified field names in Report Painter to differentiate fields and identify the table from which you want to retrieve data.