I have a requirement to receive the CSV file
in the IFS folder
and then copy
that CSV file
into a physical file
, and then process it in my program. I know how to process a physical file in my RPG program, but for that first, I need to copy a CSV file data into a physical file and I am not clear how can I do this.
We copy a
CSV file
into aphysical file
or table on the IBM i using theCPYFRMIMPF
command.CPYFRMIMPF FROMSTMF('/ifsfolder/filename.csv') TOFILE(libname/filename)
RCDDLM(*CR)
Note: The physical file/table must exist before copying the CSV file to it. Also, the table or file structure should match the fields in your CSV file which you would receive in the IFS folder.