I’m not sure what you mean by perfect method, but you can either define the file as externally described (if you need to read/update etc the data in the file). Or you can define the file as an externally described data structure (if you only need the field definitions from the file).
Of course there is a method. If there wasn’t, there would be no point to the concept of “externally-described” files in the first place.
In RPG, you simply reference the file on a F-spec and mark it as ‘E’xternally described:<pre>
FEFNAME IF <b>E</b> K Disk</pre>
In COBOL, you reference the file in a SELECT…ASSIGN statement, and you place a COPY statement wherever you want the fields defined, e.g., under a FD 01-level record name or under an 01-level WORKING STORAGE item:<pre>
copy ddr-all-formats of EFNAME.</pre>
In CL, you simply declare the file with DCLF and the fields are brought in below the DCLF.