× 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 use this feature a lot. It's great for writing from a work file to the
production file and things like that. I also like use it when purging data
to a history file.

Here's a quick example of a purge program.

dou (%eof(myFile));
reade (inCompany:inVendor:inStatus) myFile current;
if (%eof(myFile));
iter;
endif;
reset history;
// monitor for errors - don't want day end to blow up
monitor;
eval-corr history = current;
history.adate = %date();
history.atime = %time();
history.auser = syuser;
write myRec history;
delete myRecCurrent;
on-error;
// do nothing for now, just leave the errored record in the current
file
endmon;
enddo;
*inlr = *on;
return;

James R. Perkins



"Jon Paris" <Jon.Paris@xxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
25.09.2007 06:46
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
<rpg400-l@xxxxxxxxxxxx>
cc

Subject
RE: READ with DS as result







I now have MyDS.CLT_Name = "Smith" but CLT_Name is no longer filled.
Why
is this?

Two different fields in different spots in memory. The original fields
will
only get populated if you do it yourself.

If you are on V5R4, then EVAL-CORR is a nice way of handling this _but_
both
sets of fields have to be in DS. So if you are trying to populate a
display
file for example you might have a DS defined as LIKEREC the subfile record
and do an EVAL-CORR from chainDS to displayDS.

The ability to go straight to the DS _without_ touching the original
fields
is a great feature as you can - for example - read the next record without
disturbing the original data. It is also usually faster to read this way
and it can make a difference in a batch program or a subfile fill read
loop.

Jon Paris
Partner400

www.Partner400.com


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.