Special characters that are placed in a file can get misinterpreted, because the world is expected to support 100.000+ characters, which are covered in so-called code pages. A code page is effectively the "translation table" for a set of characters. Some you you know ASCII or EBCDIC, which is code page league.
When you are writing a file with the TRANSFER
statement, you may well want to specify which code page is to be used, to make sure the file content is composed the way it is expected to be received. You can specify
OPEN DATASET .. ENCODING DEFAULT.
or
OPEN DATASET .. ENCODING utf-8.
which will cater for most cases, but whey you find that the â becomes â and the ä becomes ä, you have encountered a code page issue.
If you know which code page should have been used, you can specify it, like in a Windows NT environment this one worked for me once:
OPEN DATASET .. IN LEGACY TEXT MODE CODE PAGE '1160'.
But there are many many many other codepages possible.
This thread may also be useful.