× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I was thinking that. But, (dumb question) how is that done? I mean,
how is DS set up? Is it as simple as putting the file name on the DS,
and then it is magically populated?

John McKee

On Sun, Jan 15, 2012 at 3:48 PM, Harman, Roger <Roger.Harman@xxxxxxxxxx> wrote:

What about a DS based on the formats and  eval Ds2=Ds1 ?

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of jmmckee flinthills.com
Sent: Sunday, January 15, 2012 12:40 PM
To: RPG programming on the IBM i / System i
Subject: Re: Copy record from one format to another

Can't use CPYF.  Not all records need to be copied.  Specifically, file 1
has records has records that need to be updated when data is ready in
another file.  Once the missing data is available, my thought was to update
the record with mising data, copy that record to a transmittal file, and
then delete the original record.

If this can't be done entirely in RPG IV without needing to move separate
fields fron one format to the other, another approach would be to update
file 1, and after the RPG IV program finishes, do a CPYF with record select
to the transmittal file and then copy file 1 to a temp file and copy back
only those records that still are incomplete.

Field names in the "rework" file start with ss.  Fields in the transmittal
file start with sr.  Otherwise, they are identical.  I seem to vaguely
remember (over 20 years ago) doing this in COBOL.  I was thinking I was
going after it the wrong way.  Reason for the nealy identical files is
several files are accessed to build the record.  Then, I find out that one
field is not populated as yet.  Seemed pointless to redo all the I/O for
the 40+ fields when only one is in need of change.  Currently, there is a
backlog on that single field of about three weeks.  Outfit that I am
sending the data to wants data, even if incomplete, ASAP, with an update
when available.  Seems like an odd way to run a railroad, but that is what
it is.

Maybe I am just getting lazy.  Just didn't want to code 40+ data moves if
there was a better approach.

John McKee

On Sun, Jan 15, 2012 at 2:13 PM, sjl <sjl_abc@xxxxxxxxxxx> wrote:

John -
are the field names different in the two files?
- sjl


"jmmckee flinthills.com"  wrote in message
news:mailman.3900.1326653110.2619.rpg400-l@xxxxxxxxxxxx...

I have two files.  Same record length.  Same number of fields.  Fields
are same length and data type.  There are over 40 fields involved.

Do I have to move the fields one at a time from the first format to the
second?

I tried moving the record format name, but that is invalid.  I
attempted to write thw swcond file using the first file format - but
if that is possible, I may have gotten the syntax incorrect.


Thanks,

John McKee

--
This is the RPG programming on the IBM i / System i (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.


--
This is the RPG programming on the IBM i / System i (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.

--
This is the RPG programming on the IBM i / System i (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.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.