Solved

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

Posted on 2008-11-03
3
2,362 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
IBM i - CL Array 5 135
if i remove my mail account from MAC OS, will it delete the downloaded files from its Harddrive? 4 69
wireless name in LAN adapter 14 89
Chrome VM 1 31
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 …
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
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.

736 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