I had a programmer as whether a PERFORM could be recursive. The answer is
"No". I even tried to explain why. But he says that if he could do it, it
would save some "really messy" coding. So I thought that I'd ask here if
anyone has ever heard of a way to do something which would be similar to a
recursive PERFORM. I've always heard that recursion can be replaced with a
stack and iterative programming. But I've not come up with a way to do
this, nicely, in COBOL. Perhaps that is the "messiness" to which the
programmer was referring. Perhaps because COBOL doesn't implement stacks
either. So a stack must be implemented with a array and a
current-index-value variable, perhaps defined as INDEXED BY.

I was looking into using nested programs which were recursive. But that
turns out to not be possible. RECURSIVE programs can't have nested
programs. And nested programs can't be RECURSIVE.


-- 
This is a test of the Emergency Broadcast System. If this had been an
actual emergency, do you really think we'd stick around to tell you?

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to