ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

WRITE does'nt work.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • WRITE does'nt work.

    Hi, seem to have a silly error/mistake here.

    I have defined the file in the f-specs. F Invmicl3 UF A E K Disk

    All I want to do is a straight WRITE of data to file Write RInvmic;

    Statement is executed, there are no errors. In debug I even have to press enter 5 times (number of fields in the record) so looks like the record is being written out to file. No error messages.
    But when I check the file, no record written.
    any ideas? thanks.

  • #2
    RPG supports "record blocking" which means that the data is put into a memory cache, and only when a certain number of records have been written will the whole thing be written to disk. This greatly improves performance. If you look at the file immediately after the WRITE but before the file has been closed (or the cache flushed) you will not see the record.

    You can turn off blocking by putting BLOCK(*NO) in the keywords section of your F-spec or DCL-F for the file.

    Alternately, you can use the FEOD opcode to flush the cache (force the blocked records to disk).

    Or, if nothing else, they will be written when the file is closed.

    Comment


    • #3
      Sounds like it may be the dreaded library list issue. Are you sure you're looking at the correct file? Have you checked with DSFD to see last change date/time?

      Cheers,

      Emmanuel

      Comment


      • #4
        UF A should disable record blocking. But if really that is the issue, like Scott said, BLOCK(*NO) or FEOD. Or FEOD(n).

        Ringer

        Comment

        Working...
        X