OK, maybe I should fill in the background...
This is to be a short term solution (so they say). The only thing manual
will be the user initiating the process. The file being input is dropped
on the IFS through a separate process. I had the process working but the
users have now changed the requirements. Instead of deleting the
unwanted records, they want record status fields updated. To further
complicate, the resulting csv file format is not something I can
duplicate with any utilities I currently have. So it looks as if in
order to get the control I need, I will have to write the file as you
recommended.
Thanks...
- Steve
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[
mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, June 04, 2007 12:31 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Deleting Records within a CSV file on the IFS
Hi Stephen,
That's actually what I'm going to end up doing. I'll probably do it
with MS ACCESS though.
Are you serious? Since this is the RPG forum, I assume you're looking
to do this programatically, rather than through a manual, user-driven
process.
I realize that it's somewhat cumbersome to copy the entire file in order
to delete a record, but let's look at the alternatives you've been
given:
a) Copy the entire file to a physical file, delete the record, then copy
it back. This process involves copying the file TWICE (instead of
once, like I suggested) as well as transforming it's format, potentially
doing character set translation, potentially doing field type
conversions... it's a much, much, much more convoluted, CPU intensive,
and disk intensive than copying everything except the one record.
b) Downloading it to a PC (thus copying the file, not just on disk, but
across a network). Opening it with Excel or Access. (Which loads the
entire copy into memory) deleting the record in memory, saving it back
to disk, and copying it back across the network.
Sorry, but these solutions are much more complicated and much more
cumbersome. They also run a higher chance of failure (because there are
more steps -- including network communications) they also are more prone
to object sharing/locking issues.
All of this might make sense if this is a one-off program. But if this
is intended to run as a program, you're creating a mess.
All Excel or Access or EDTF or the PF are going to do is what your
program should be doing in the first place. They'll copy the file
without the extra records. Why not simply write a loop (it's like 12
lines of code) and be done with it?
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.