Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Is the CPYTOIMPF command the best option?

I'm using the CPYTOIMPF command, taking a physical file from the iSeries and putting it to the IFS as a .csv (for FTPing). The problem I'm having is that some of the fields have varying length data, and I'm getting the .csv fields with spaces. Is there a parameter on the CPYTOIMPF command that will trim the fields prior to creating each comma delimited field, or something that I can do in the RPG program when creating the physical file? Or do I have to create the PF as a flat file, trimming out the spaces prior to using the CPYTOIMPF?
The CPYTOIMPF command is not particularly good! There is a better command, CRTCSVF (Create CSV file), which is freeware and available here. I use this command myself, and it does exactly what you want. If you have problems getting to the site or getting the source onto your machine, I can send you the sources as e-mail attachments.

Uzaemon's site has a number of extremely good iSeries utilities, and I am soon going to have collected the set for my own Utility Library -– he/she is a great programmer, if a little untidy, and has some truly useful utilities that I have not seen for free anywhere else.


The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was last published in May 2005

Dig Deeper on iSeries application development tools

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.