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



Thank you, Jerry.

You got me.  That's exactly what I was looking for.  I personally also use
the WS-RECORD concept for this sort of thing, but only because it seemed
like a good suggestion.  If I'd ever known the below, I'd forgotten it, and
it's good to see that others have good memories.  :)  Odd that this program
never suffered from that deficiency in the past.

Dennis ... ahem... stepping down from the bandwagon with his head hung
low...






"Jerry Thomas" <jerryt@ccslink.com>@midrange.com on 12/11/2002 09:43:53 AM

Please respond to cobol400-l@midrange.com

Sent by:    cobol400-l-admin@midrange.com


To:    <cobol400-l@midrange.com>
cc:
Subject:    RE: COBOL WRITE after OPEN EXTEND results in CLEAR-AFTER-WRITE


The information below was copied out of the IBM Cobol for AS/400 Reference
Manual.
here is the link.
http://publib.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/qb3ag302/6.2.42.1?SHELF
=&DT=19990312112008


MOVE identifier-1 TO record-name-1
WRITE record-name-1

The move is performed according to the rules of the MOVE statement, without
the CORRESPONDING phrase.

After the WRITE statement is executed, the information is still available
in identifier-1, even though it may not be in record-name-1.

After the WRITE statement is executed, the record is no longer available in
record-name-1, unless:

 The associated file is named in a SAME RECORD AREA clause (in which case,
 the record is also available as a record of the other files      named in
 the SAME RECORD AREA clause), or
 The WRITE statement is unsuccessful because of a boundary violation.

In either of these two cases, the record is still available in
record-name-1.


This is the Rule I have always followed.
Jerry

-----Original Message-----
From: cobol400-l-admin@midrange.com
[mailto:cobol400-l-admin@midrange.com]On Behalf Of Dennis Lovelady
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.

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