RPG on i-series - WRITE op code writes but then deletes record fromfile! - IBM AS400

This is a discussion on RPG on i-series - WRITE op code writes but then deletes record fromfile! - IBM AS400 ; I've run into one of the strangest things I've seen with this problem. A program that should write to a log file is not. Originally I thought it might be records to force a write (FRCATIO) on the physical file. ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: RPG on i-series - WRITE op code writes but then deletes record fromfile!

  1. RPG on i-series - WRITE op code writes but then deletes record fromfile!

    I've run into one of the strangest things I've seen with this
    problem. A program that should write to a log file is not.
    Originally I thought it might be records to force a write (FRCATIO) on
    the physical file. It's not. In debug when I complete the WRITE
    operation line of code, the record is instantly written and deleted.
    I can't figure out why. I do a WRKF on the file and it says records
    zero, deleted records 1. Any ideas?

    SG

  2. Re: RPG on i-series - WRITE op code writes but then deletes recordfrom file!

    On Apr 23, 4:54 pm, SG wrote:
    > I've run into one of the strangest things I've seen with this
    > problem. A program that should write to a log file is not.
    > Originally I thought it might be records to force a write (FRCATIO) on
    > the physical file. It's not. In debug when I complete the WRITE
    > operation line of code, the record is instantly written and deleted.
    > I can't figure out why. I do a WRKF on the file and it says records
    > zero, deleted records 1. Any ideas?


    Not heard of this before, but is it possible that there is a trigger
    program linked to this file that is deleting the records? As you are
    able to run this through in debug mode, why not try a test where you
    write to a 'fresh' copy of the output file inserted higher in the
    library list - see if the same happens.

    HTH

  3. Re: RPG on i-series - WRITE op code writes but then deletes recordfrom file!

    Is it possible you are journalling the file or running commit comtrol
    and not COMMIT the write ?

  4. Re: RPG on i-series - WRITE op code writes but then deletes record from file!


    "SG" wrote in message
    news:e3be2ea3-6f10-4e04-991c-57808e6a522c@m36g2000hse.googlegroups.com...
    > I've run into one of the strangest things I've seen with this
    > problem. A program that should write to a log file is not.
    > Originally I thought it might be records to force a write (FRCATIO) on
    > the physical file. It's not. In debug when I complete the WRITE
    > operation line of code, the record is instantly written and deleted.
    > I can't figure out why. I do a WRKF on the file and it says records
    > zero, deleted records 1. Any ideas?


    If it's an LF - then it may have select/omit criteria which would exclude
    the record from the LF. Try looking at the underlying PF.

    Otherwise, I suggest you journal the file (*BOTH before and after images)
    and look in the journal for what's causing the delete. There may be a
    trigger on the physical file (use dspfd {PF} *trg to find triggers on the
    PF).


  5. Re: RPG on i-series - WRITE op code writes but then deletes recordfrom file!

    Graybeard wrote:
    > Is it possible you are journalling the file or running commit comtrol
    > and not COMMIT the write ?


    That was my first thought as well.

+ Reply to Thread