Solved

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

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Occasionally Windows/Microsoft Updates will fail to update. We have found a code that will delete all temporary files and re-register all dll's related to Windows/Microsoft Updates! This works 99% of the time to get the updates working again! The…
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
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.

803 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