  We present results of the comparative analysis of the two wide binary systems
-- 16 Cyg, with a giant gas planet orbiting around 16 Cyg B, and HD 219542
without planet detected. Atmospheric parameters of the binary components and
the Sun were determined using their high-resolution spectra and the SME tools
for automatic spectral analysis. By applying the synthetic spectrum method, we
derived abundances of 29 and 23 chemical elements in 16 Cyg and HD 219542,
respectively. For 19 of these elements, our results are based on the non-local
thermodynamic equilibrium (NLTE) line formation. For both 16 Cyg and HD 219542,
we obtained a small abundance difference between the A and B components:
+0.019$\pm$0.012 and -0.014$\pm$0.019, respectively, suggesting only a weak
influence of the giant gas planet formation on chemical composition of the host
star atmosphere. For HD 219542 A and B, trends of the relative-to-solar
abundances with the dust condensation temperature are similar to the literature
data for the solar analogues without detected planets. The components of 16 Cyg
reveal very similar behaviour of [X/H] with the condensation temperature,
however, it is different from that for HD 219542. This indicates a specific
chemical composition of the cloud from which the 16 Cyg binary system formed.
