Replace the second FILE subcommand with TABLE, and you get a left join (ie all the records in table_A, with info from table_B where they match on id.)
DATASET ACTIVATE table_A.
MATCH FILES /FILE=*
/TABLE='table_B'
/BY id.
EXECUTE.
If you subsequently only want the shared records in both table_A and table_B, use above with the IN subcommand, and then select out cases that were matched.
DATASET ACTIVATE table_A.
MATCH FILES /FILE=*
/TABLE='table_B'
/IN Flag_B
/BY id.
SELECT IF Flag_B = 1.
EXECUTE.
Also the STAR JOIN command might be of interest.