Ask the Expert

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.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

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 first published in May 2005

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: