There are essentially two methods to doing this. Firstly, you can copy the flat file into a database file. Why would you want to do this ? Well, if the data is stuff that you need to sort or query, then this is by far the best route. There is a CL command to do this which is CPYFRMIMPF, which copies data from a flat file held in the IFS into a database file. The default settings for this command will copy a CSV or Comma Separated Value file from the IFS into a database file. Very handy.
The alternative is to read in a file in RPG. Now RPG does not natively handle this, but the C programming language does. You can use the C library at runtime in RPGLE by binding to it in the H specs.