|
I use this feature a lot. It's great for writing from a work file to thedata
production file and things like that. I also like use it when purging
to a history file.record
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
WhyI now have MyDS.CLT_Name = "Smith" but CLT_Name is no longer filled.
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
and do an EVAL-CORR from chainDS to displayDS.without
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
disturbing the original data. It is also usually faster to read thisway
and it can make a difference in a batch program or a subfile fill readlist
loop.
Jon Paris
Partner400
www.Partner400.com
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxxlist
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 AS400 / iSeries (RPG400-L) mailing
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 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.