On 14/11/08 21:55, John Culleton wrote:
> On Friday 14 November 2008 03:51:47 pm Tony Mechelynck wrote:
[...]
>> Using the example above, and remembering that I worked on computers
>> which didn't know about lowercase,
>>
>>      COMPUTE A = ((B + C) / D)
>>              * ((E * F) + G).
>>
>> is a perfectly valid COBOL sentence provided that it appears in the
>> PROCEDURE DIVISION, both its lines start no earlier than column 12
>> (and end no later than column 72 in fixed-form COBOL), and that all
>> the data items it uses are defined in the DATA DIVISION. No
>> column-7 dash is required, but there must be a period followed by a
>> space somewhere (no later than the end of the paragraph, which is
>> just before the next procedure-name i.e. label) to end the
>> sentence. In slightly more verbose COBOL, the above sentence is
>> equivalent to
>>
>>      COMPUTE A = ((B PLUS C) DIVIDED BY D)
>>              MULTIPLIED BY ((E TIMES F) PLUS G.
>>
>> or even, in a somewhat older version of the standard where the
>> COMPUTE verb didn't exist, and with two more WORKING-STORAGE
>> SECTION data items of appropriate PICTURE:
>>
>>      ADD B C GIVING TEMP-1.
>>      DIVIDE D INTO TEMP-1.
>>      MULTIPLY E F GIVING TEMP-2.
>>      ADD G TO TEMP-2.
>>      MULTIPLY TEMP-1 TEMP-2 GIVING A.
>>
>>
>> Best regards,
>> Tony.
>
> Since we are talking the original fixed format, would not the problem
> be solved if line numbers actually appeared in columns 1-6?
>
> Writing the COBOL program that takes the source program and renumbers
> it is left as an exercise for the student.  I have mine :<).
>

When given a source with columns 1-6 blank overall (or even just blank 
in the IDENTIFICATION DIVISION header), the compiler I used (and the 
librarian I used to move the source from Hollerith cards to magnetic 
tape) would renumber them in steps of 10 starting at 000010 :-). But I 
forgot the closing paren after PLUS G


Best regards,
Tony.
-- 
     A KNIGHT rides into shot and hacks him to the ground.  He rides off.
     We stay for a moment on the glade.  A MIDDLE-AGED LADY in a C. & A.
     twin-set emerges from the trees and looks in horror at the body of her
     HUSBAND.
MRS HISTORIAN: FRANK!
                  "Monty Python and the Holy Grail" PYTHON (MONTY) 
PICTURES LTD

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to