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


  • Subject: Re: SQLRPG error MONMSG possible ?
  • From: István Rudas <Istvan@xxxxxxxxx>
  • Date: Sat, 08 Apr 2000 17:44:59 +0200

Hi Peter, 
you are completely right, 
I use your method (good, I confess, in OPM) and that was also what I wanted
to describe: the COMBINATION is from my viewpint be the best you can do for
stability-robustness.
(in trying to make my previous mail not too long I skipped some details
which now turn against me and let me look like a greenhorn....)
Taking for the SETLL  a "cheated" second file with OVRDBF to the first for
not loosing record pointers, doing this as the last possible before the
WRITE, exactly like you say, because of a second program who could have
used the last key one millisecond before my program does; the WRITE
indicator is in OPM needed if you do want to handle errors yourself, which
you obtain in INFDS).
 
-- Today (shame?) I do not care much about job log length, I need the log
when testing or am searching a problem, otherwise it will be deleted
automatically by some clean-up job overnight, i guess.

In studying the (for me) new RPG-IV-Coding, I did not find a specific good
thing IBM should offer for RPG: defining in easy way a whole record format
with all different field names so I do not loose the content+pointer of the
"first file" if I do your recommended SETLL with the second "cheated" file. 
but maybe I find an answer in the next time when I get to the higher pages
.....  =:-)

Today (OPM) I know only the long way, KRENAME the record-format and
describing the fields with new names in I-specs (hey, István, what has an
I-spec to do with RPG-IV???) --- surely there is an equivalent with
D-specs, but this also is the long way if it is equivalent, n'est ce pas? 

Another RPG-IV-thing could be to use a PREFIX for the whole "second" file -
if this works for the topic above, I then should say, IBM DID offer a good
thing for RPG....yes, I am continuing learning.

Thank for your answer,
István 

At 22:47 06.4.2000 -0700, PETER DOW wrote:
>Hi István,
>
>I don't see a reply from Dan, so I'll jump in. A better practice than just
>using the error indicator on the write stmt is to check for an existing
>record with setll and an equal indicator. The reason? The last time I ran
>across a program that used the method you describe of adding 1 to a sequence
>nbr that was part of the key created a 5,000 page job log. If an error
>occurs during the write, the program goes into error handling mode which
>uses up time and job log. Better to use setll plus the write indicator. The
>reason for using both? As someone pointed out in another message, there is a
>remote possibility that after having checked for an existing record and
>before doing the actual write, another job could actually add that record,
>causing the duplicate error.
>
>Regards,
>Peter Dow
>Dow Software Services, Inc.
>909 425-0194 voice
>909 425-0196 fax

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.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.