On Tue, 29 Jul 2008 10:05:15 -0500, Paul Gilmartin <[EMAIL PROTECTED]> 
wrote:

>>
>Copout!  This is irresponsible language design.  If the JCL developers
>had any pride of craftsmanship, they would remove all references to
>"unpredictable" and "unsupported" from the language specification
>by variously either:
>
>o Specifying clearly the predictable behavior of supported constructs
>
>o Reporting as JCL errors all remaining (unsupported) constructs.
>
>As for the compatibility implications of reporting as errors use
>of constructs that "might not work in the future", better that
>progammers foolishly exploiting such constructs be informed today
>rather than "in the future".
>
I quite agree. I have been in IT for a long time. (We didn't call it IT when I 
started.) My first job was on an IBM 360, coding in COBOL. I haven't looked at 
a COBOL reference manual lately, but back at that time it stated that if the 
source and target fields of a MOVE statement overlapped, the results were 
unpredictable. However, the compiler did not generate an error - it simply 
compiled any character move statement (numerics were another matter) as 
one or more MVC commands. (More than one would be needed if the move 
involved more than 256 characters.) Programmers would routinely initialize 
large arrays by initializing the first row and doing an overlapping move. 

Problem came when the 370 arrived and we upgraded to a new COBOL 
compiler. Now, a character moveof more that 256 characters were compiled 
as a MVCL. For MVCL, when source and target fields overlap, a condition code 
is set and no data movement occurs. The new COBOL did not check the 
return code, the COBOL move statement effectively became a NO-OP. No 
error statments in the COMPILE and the program would either abend when it 
later found some field uninitialized or it would produce incorrect results.

IBM's out was that they had said that the results of the overlappping MOVE 
were unpredictable, so this did not violate their compatablity statement that 
programs would be source level compatable if they were coded according to 
the language reference. As we commented at the time, the results were 
predictable (the compiler does not take random actions), but the results might 
change with future releases.

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

Reply via email to