I'm creating a .csv file using CPYTOIMPF Command.. I have a numeric Field in the File. I want to remove the zeros since i am not using it regularly. Pls help me
I want to remove the zeros since i am not using it regularly.
What do you mean "regularly"?
Does it mean that you don't often use the numeric field? Does it mean that you use the numeric field in an irregular way? Does it mean that you use the .CSV file in an irregular way?
CPYTOIMPF is intended as a DB2 database EXPORT function. It can be used for general .CSV creation, but that's not how it should be expected to work. If it doesn't work as you need, you have two general options.
First, don't use CPYTOIMPF. Use a different function such as downloading to Excel and saving the result as a .CSV from Excel, or searching the internet for one of the various .CSV creation tools that others have made available. Because you are the one who knows your requirements, you are the one who would know which tool works as you need.
Or create a new file description that presents the data in the column without leading zeros. You can create a SQL VIEW for example, that would do that. Then use CPYTOIMPF to export that VIEW.
Tom
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 2  Replies