Rich kids are into COBOL

Sean Conner spc at conman.org
Wed Feb 18 10:55:45 CST 2015


It was thus said that the Great Chuck Guzis once stated:
> Is there any other language (save PL/I for obvious reasons) that has an 
> equivalent to the COBOL PERFORM...THRU statement?
> 
> That one always struck me as being a bit offbeat.  Example: Consider a 
> section of a program with 4 consecutive paragraphs, named PARA-1 through 
> PARA-4.  One can say in the same program:
> 
> PERFORM PARA-1 23 TIMES.

Um ...

  for i = 1 , 23 do
    para_1()
    para_2()
    para_3()
    para_4()
  end

> PERFORM PARA-1 THRU PARA-4.

  para_1()
  para_2()
  para_3()
  para_4()

> PERFORM PARA-1 THRU PARA-2.

  para_1()
  para_2()

> PERFORM PARA-2 THRU PARA-3 WITH TEST AFTER VARYING INDEX-1 FROM 10 BY 3 
> UNTIL FLAG-1 > 0.

  repeat
    para_2()
    para_3()
    index_1 -= 3
  until flag_1 > 0

> It's that variable scope of a PERFORM that I don't recall seeing in any 
> other language.

  Am I missing someting?

  -spc (I might have the logic messed up on that last one, not knowing
	COBOL)



More information about the cctalk mailing list