I am reminded of something I encountered early in may career. The COBOL reference at the time (and this may still be true) stated that if the target of a MOVE statement overlaps the source, the results are unpredicable. (my paraphrse.)
Back in the days of the 360, the COBOL compiler would compile a move of more than 256 characters into a series of MVC operations. The results of a series of MVC operations is well defined, and certain programmers in out shop had taken advantage of this to initialize arrays via an overlappping move. When we upgraded to a 370 and a compiler designed to run on the 370, the series of MVC operations was replaced by a single MVCL operation. The behaviour of the MVCL is also well defined, but quite different in the case of an overlapping move. The MVCL moves no data in this case and sets a condition code which was not checked by the compiled program. For all practical purposes, the MOVE had become a NO-OP. Needless to say, this had the potenetial of causing all kinds of problems. Fortunately, we were aware of this issue and were having to update and recompile everything due to DOS to OS conversion. We were on the lookout as we updated the programs. On Tue, 26 Apr 2011 07:37:18 -0500, McKown, John <[email protected]> wrote: I try to avoid doing things which are documented to have "unpredictable results". You'd be amazed at the number of times that some programmer will complain that the system is broken when something which is documented to have "unpredictable results" has "worked in the past" but was now "broken". I must then try to explain to them that getting the correct answer is covered by the phrase "unpredictable results" just as much as getting a wrong answer or an abend. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

