Solved

cpytoimpf  csv file has a blank (space) for empty fields - I need to remove

Posted on 2008-11-03
3
2,216 Views
Last Modified: 2013-12-06
I have an AS400 file.  This file has an external descripton on it.  I created a cpytoimpf to send it to a ahared drive that the PC user can acess to get the CSV file.  My only problem is that it is putting a blank space between the commas (, ,)when it should be just comma comma.  I have changed the cpytoimpf to take out all of the leading and trailing spaces, but still get at least one blank for an empty field.  The receiving program takes that as a character....  Other wise known as an error!  What can I do?
0
Comment
Question by:JanSrIt
3 Comments
 
LVL 4

Expert Comment

by:rward
ID: 22869594
We use the free CRTCSVF command from http://homepage1.nifty.com/uzaemon/

It works much faster than CPYTOIMPF and does not leave spaces for blank fields.
0
 
LVL 16

Accepted Solution

by:
theo kouwenhoven earned 250 total points
ID: 22881891
0
 
LVL 27

Expert Comment

by:tliotta
ID: 22892244
JanSrIt:

> My only problem is that it is putting a blank space between the commas (, ,)when it should be just comma comma.

Are you wanting [comma comma] for character fields or numeric fields? If it's for character fields, does that mean that you are not using any delimiters such as quote marks? Do you want quotes around character fields when a non-blank value is there?

If you have Qshell installed, you can possibly use the db2 utility to format the lines any way you wish.

Or you might simply use sed from Qshell to edit the lines in your .CSV file, replacing [, ,] with [,,].

That is, generate the .CSV file with CPYTOIMPF as you're doing now; but run sed against it as soon as it's ready.

Tom
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now