|
Marco Facchinetti wrote: > > Barbara, what are the risks if the activation group ends and the files are > not yet closed? > The only thing I can think of (a somewhat farfetched scenario) is that you might have an incomplete block of records waiting to be written out to a blocked output file. When the file gets closed automatically because of the activation group ending, the block of records will be written out. If the block contains a record with a data mapping error, that record and all the records following it will not get written out to the file. If you don't want to close your output files, you can still write out any incomplete blocks by using FEOD on your blocked output files before you return. (Use FEOD(N) for best performance.) If you use FEOD, you'll get an exception in your program if there are any data mapping errors, instead of possibly having to wait until RCLACTGRP time and missing the errors. It's not that easy to get a data-mapping error on output. The only way I know to do it using RPG is to have a file with a date, time or timestamp field, and get RPG to write out the record without checking the d/t/z. You can do this either a) by incorrectly program-describing the file to have character fields, or b) by using a result DS for an externally-described file, and not putting a valid value in the d/t/z subfield. Example: * File JUNK A R REC A DATE L * RPG program JUNKPGM H dftactgrp(*no) actgrp('JUNK') FJUNK o f 10 disk F#junkf o f 10 disk D ds ds 10 C eval ds = '2005-01-01' C write junk ds C eval ds = 'bad date' C write junk ds C eval ds = '2005-01-03' C write junk ds C return ===> CALL JUNKPGM ===> RCLACTGRP JUNK - check the joblog - it will say 2 records were lost - check the file - it will only show 2005-01-01
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.