Q
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.

==================================
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 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.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...

Close