In YBa2Cu3O6+x compound the tetragonal to orthorhombic transition occurs around x equals 0.3, followed by a continuum variation of lattice parameters. Hence both, the structural and superconducting properties, depend upon the oxygen content in CuO chains. Conversely, the epitaxial stress, exerted by the substrate on YBCO films, modified the lattice parameters influencing the oxygen stability in the chains. The understanding of this mechanism is essential when growing epitaxial films for in- situ photoemission studies as well as for tunneling experiments, since the oxygen stability up to the top surface unit-cell is a central issue. We have studied this effect on c-axis oriented YBCO films grown by laser ablation on (001) STO single crystals. Accurate x-ray diffraction analysis of thick films (t GRT 500 angstrom) indicates the presence of two distinct layers, one strained and the other relaxed. Detailed analysis shows that the relaxed layer is as well oxidized as bulk samples, while the strained one is oxygen deficient. Furthermore, despite an oxygen content of about x equals 0.65, the strained layer is in the tetragonal phase (in bulk, the tetragonal phase exists for x < 0.3). We discuss these results in terms of competition between the chemical pressure induced by oxygen inclusion in the chains, and the uniaxial stress within the film.