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



Scott,

You are right, I didn't bother to read this very carefully.  I can't 
come up with any real world situation where you would want to 
do this.  It may have validity in a static key file with update only 
specified.  In that case you save yourself a chain and prevent 
a potential overlay of current field values.  Still very limited.

David Morris

>>> "Scott Klement" <infosys@klements.com> 04/27/99 10:12AM >>>
David,
     Actually, in this particular program, he only needs 2 deleted
     records, not 22,222.  :)

     (22222 is the just the value of a field he's puttin in the file,
     the highest RRN he's using, here, is 2)

     In fact, since his RRN variable is only 2 digits long he couldnt
     access any records over 99, anyway :)


Shen,
     In order to force a record to be written to a specific RRN, the
     file must already have records in it up to that number.  And
     since you're doing a WRITE operation, that record must have been
     previously deleted.

     I'm not sure why you'd want to force a write to a specific RRN,
     but, I'm assuming its because you want to look up records by
     that RRN, as well.

     If you're going to do that, please consider the following:

        -- If anyone ever does a RGZPFM or CPYF, or anything else
           to your file that changes its sequence, or removes deleted
           records, all your RRN's will be changed...

        -- You can do the same thing, (albeit slightly slower) with
           a key field that contains a "record sequence number",
           that doesn't need to match the RRN.  This would be safer
           than using an RRN because you wouldnt have to worry about
           file reorgs, copies, sorts, etc... and you also wouldnt
           need to maintain deleted records.    IMHO, the speed
           difference is not noticable.

HTH.



"David Morris" <dmorris@plumcreek.com> wrote:
> Shen,
>
> I don't understand what you are trying to do, but when you specify
> recno, the record must exist before the write.  If you want it to wo
> create 22,222 records in your file, delete them (don't reorganize)
> and run your program.
>
> David Morris
>
> >>> "Shen Jianjun" <ipacsjj@public.sta.net.cn> 04/27/99 05:58AM >>>
>
> I write one program to test RRN. When run at statement 6, error
>  message
> (I/O error CPF5006 was detected in file PF0828) happens. Below is th
> source of the PF and RPGLE.
>
> Thanks.
>
>
> FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++++++++++
>         *************** Beginning of
> data*************************************
> 0001.00 FPF0828    O    E             DISK    RECNO(RRN)
> 0002.00 DRRN              s              2  0 inz
> 0003.00 C                   EVAL      RRN = 1
> 0004.00 C                   EVAL      KEY = 22222
> 0006.00 C                   WRITE     REC1
> 0007.00  *
> 0008.00 C                   EVAL      RRN = 2
> 0009.00 C                   EVAL      KEY = 12345
> 0010.00 C                   WRITE     REC1
> 0011.00  *
> 0012.00 C                   move      '1'           *inlr
>
>
>  SEU==>
> PF0828
>  FMT PF
> ....A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++
> @        *************** Beginning of
> data*************************************
> 0001.00      A          R REC1
> 0002.00      A            KEY            5  0
> 0003.00      A            TEXT          10
> 0004.00      A
>          ****************** End of
> data****************************************
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.