× 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.



Testing my understanding.....
Prefix() on both files would change field names from SRACCT and SSACCT
to XACCT (for example). thus, they are assigned the same area in
memory. The qualified delete operation uses the filename, thus acts
on the proper data, since record format is not involved.

Now, fly in ointment (maybe). There is another program. This program
sends the initial data, and also writes the same date to the fix-up
file if a specific set of conditions exist. I can't remember, would
need to get to my work computer - same technique would work where
incomplete data must be written to two files - transmit file and
re-work file. Somehow, I thought the WRITE op-code used a record
format name or a data structure. Couldn't remember if it used a file.
Of course, COBOL (at least from 20 years ago, and not from IBM) did
not allow a file name to be used with the write verb - read file,
write record. Getting confusing trying to keep the two separate.

John McKee


On Sun, Jan 15, 2012 at 9:41 PM, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

On Jan 15, 2012, at 8:09 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

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?

Use the record format name and define the DS as being LikeRec(...)

Then copy one to the other.

Of course if all the fields indeed have the same name except for the prefix then it is even simpler.

On the F-spec for each file specify something like Prefix('X':2) which will change all field names to X... instead of xx... and yy...

Read the record from the file then apply your selection criteria using the new field names and simply write the appropriate new records - no evals no nutin' - RPG will do all the work.

No need for a DS or anything.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com




--
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 ...

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.