Problem solve Get help with specific problems with your technologies, process and projects.

Read from a comma-delimited flat file

How do I read from a comma-delimited flat file into a physical file?

Use the CPYFRMIMPF to convert the data. It will allow you to read the flat file and convert to the native file. Fields must be in the exact position and of the same data type or it will generate an error. If that is not an option, you will have to write a program to read each record and scan for the commas. Convert the format of the incoming fields into your file format. (e.g. 125.03 is a string in the inbound file, so you have to separated at the decimal, or lack thereof, and convert into a numeric signed or packed field).


The Best Web Links: tips, tutorials and more.

Ask your OS/400 questions--or help out your peers by answering them--in our live OS/400 discussion forums.

OS/400 Discussion Forum: Post your questions, and get answers from other iSeries users as well as search400 experts.

Search400.com's targeted search engine: Get relevant information on V5R1.

Ask the Experts yourself: Our OS/400 gurus are waiting to answer your questions.

V5R1: Ready to upgrade?
Check out these resources to help you plan your upgrade.

Dig Deeper on Past Releases

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.