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



This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
Could the file be double-buffered?  When it wrote one record, it switched to
the other buffer to prepare for the next record.  The next record wasn't
initialized.



-----Original Message-----
From: Dennis Lovelady [mailto:dlovelady@dtcc.com]
Sent: Tuesday, December 10, 2002 2:15 PM
To: COBOL400-L@midrange.com
Subject: COBOL WRITE after OPEN EXTEND results in CLEAR-AFTER-WRITE


Howdee!

I just debugged a strange situation, I thought I'd get the take of you
experts on it.

A COBOL400 (not ILE) program that's been working for years just showed a
deficiency, so I started debugging it.  OK, that's not too weird so far,
but it got interesting.  :)  One of the files is OPEN EXTEND within the
program, and that file started receiving blanks in some fields that we
initialized only at the beginning of the program.  So we have:

    0100-INIT.
        ...
        MOVE 'XYZ' TO SOME-FIELD
        ...

    2100-PROCESS.
        ...
        PERFORM 4200-WRITE-RECORD
        ....

    4200-WRITE-RECORD.
>>>    WRITE DETAIL-RECORD
>>>    ADD 1 TO RECS-WRITTEN



Using STRDBG ... OPMSRC(*YES), a breakpoint was set at the two lines
indicated by >>>

What I found was that just before the WRITE statement executed, everything
was cool.  SOME-FIELD had the "XYZ" in it that I expected.  Pressed F10 to
proceed to the next statement, and entered EVAL SOME-FIELD again.

I found that SOME-FIELD contained blanks.  In fact, the whole record
contained blanks.

Now maybe I'm confused, but my understanding of COBOL says that this should
not be.  I triple checked my results and found that this is consistantly
happening.  I don't know why.

We recently upgraded the OS from V4R5 to V5R1, but that was a few weeks
ago, and we've not seen this problem until today.

Anyone out here who can explain this to me?

Thanks,
Dennis



_______________________________________________
This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list
To post a message email: COBOL400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/cobol400-l
or email: COBOL400-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.


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.