How to: |
When you join two data sources together, they are subsequently treated as one logical structure. This structure results from appending the structure of the cross-referenced file to the structure of the host file. The segment in the cross-referenced file containing the shared value field becomes the child of the segment in the host file with the shared value field.
To display the joined structure, issue the following command:
CHECK FILE hostfile PICTURE
where:
Notice that the segments belonging to the host file appear as regular segments outlined by asterisks. The segments belonging to the cross-referenced file appear as virtual segments outlined by dots. The segments of the cross-referenced file are also labeled with the cross-referenced file name below each segment.
JOIN PIN IN EMPDATA TO PIN IN SALHIST CHECK FILE EMPDATA PICTURE 0 NUMBER OF ERRORS= 0 NUMBER OF SEGMENTS= 2 ( REAL= 1 VIRTUAL= 1 ) NUMBER OF FIELDS= 14 INDEXES= 1 FILES= 2 NUMBER OF DEFINES= 1 TOTAL LENGTH OF ALL FIELDS= 132 1SECTION 01.01 STRUCTURE OF FOCUS FILE EMPDATA ON 03/05/01 AT 12.22.49
EMPDATA 01 S1 ************** *PIN **I *LASTNAME ** *FIRSTNAME ** *MIDINITIAL ** * ** *************** ************** I I I I SLHISTRY 02 I KU .............. :PIN :K :EFFECTDATE : :OLDSALARY : : : : : :............: JOINED SALHIST
The top segment of the cross-referenced file structure is the one containing the shared-value field. If this segment is not the root segment, the cross-referenced file structure is inverted, as in an alternate file view.
The cross-referenced file segment types in the joined structure are the following:
The host file structure remains unchanged. The cross-referenced file may still be used independently.
To display a list of joined data sources, issue the following command:
? JOIN
This displays every JOIN command currently in effect. For example:
JOINS CURRENTLY ACTIVE HOST CROSSREFERENCE FIELD FILE TAG FIELD FILE TAG AS ALL WH ----- ---- --- ----- ---- --- -- --- -- JOBCODE EMPLOYEE JOBCODE JOBFILE N N
If the joined structure has no join name, the AS phrase is omitted. If two data sources are joined by multiple JOIN commands, only the first command you issued is displayed. The N in the WH column indicates that the join is not conditional. A Y indicates that the join is conditional.
Information Builders |