Solved

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

Posted on 2008-11-03
3
2,323 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just about everyone has an old PC laying around.  Ask anyone in the IT industry, whether they are a professional or play in it as a hobby.  From outdated Desktops to cheap "throwaway" laptops, they are all around and not as hard to "fix up" as you m…
As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

820 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