You are here: Commands > Join > Command Mode Syntax

Command Mode Syntax

Before issuing the Join command, open the primary table and then open the secondary table using the following command:

OPEN “Secondary_Table" SECONDARY

Then issue the Join command.

JOIN

{PRIMARY|SECONDARY|PRIMARY SECONDARY|UNMATCHED|MANY|SQL}

PKEY primary-key-field-list FIELDS primary-field-list

SKEY secondary-key-field-list <WITH secondary-field-list

<IF test> <WHILE test> <FIRST|NEXT range>

TO "create-table-name"

<OPEN> <NOFORMAT> <APPEND> <PRESORT> <SECSORT>Ώ

 

• PRIMARY includes matched records from the primary and secondary tables and unmatched records from the primary table in the output table.
• SECONDARY includes matched records from the primary and secondary tables and unmatched records from the secondary table in the output table.
• PRIMARY SECONDARY includes all records from both the primary and secondary tables in the output table.
• UNMATCHED includes only unmatched records from primary table in the output table.
• MANY includes matched records from the primary table and matched records from the secondary table in the output table. If there is more than one key field match in the secondary table, Analyzer uses all of the matched records it finds.
• SQL includes all record combinations (un-keyed) from the primary and secondary tables
• primary-key-field-list and secondary-key-field-list specifies the key fields/expressions in the primary and secondary tables.
• primary-field-list and secondary-field-list specifies the fields/expressions from the primary and secondary table to include in the output.
• PRESORT sorts the primary table on the primary key while SECSORT sorts the secondary table on the primary key before joining the tables. These presort options cannot be used within a Group command in a procedure.