A text file is always read with a DATA step, so you must write the code for it. Writing code can be automated through different means, e.g. CALL EXECUTE or writing code to a temporary file you later call with %INCLUDE.
To automate code writing, you need to have the necessary information for creating the dynamic parts of the code in data.
Take an example for a text-reading DATA step, and inspect it for the parts that need to be made dynamic. Then you wiill know what to put into a metadata dataset.
... View more