Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

local variables in cobol

131 views
Skip to first unread message

David Cabana

unread,
Jan 30, 1990, 6:26:33 PM1/30/90
to
Can anyone out there tell me why cobol still doesn't have local
variables?

--
David Cabana
d...@beach.cis.ufl.edu
UUCP: ...!gatech!uflorida!beach.cis.ufl.edu!drc

Julia Rodriguez

unread,
Jan 31, 1990, 7:39:36 PM1/31/90
to
COBOL does provide local variables. COBOL 85 allows nested subprograms.
The variables declared in these subprograms are local, unless explicitly
declared global.

In addition, COBOL 85 allows external variables and files. COBOL
programmers have been looking for a way for years to share files among
separately compiled programs. External files provides this mechanism.

Robert Claeson

unread,
Feb 1, 1990, 3:59:54 AM2/1/90
to
In article <22...@uflorida.cis.ufl.EDU>, d...@beach.cis.ufl.edu (David Cabana) writes:

> Can anyone out there tell me why cobol still doesn't have local
> variables?

Easy. COBOL is an object-oriented language with an arbitrary limit of
1 object per application. And as you maybe know, all data items within
an object are accessible to all methods that belongs to the object.

--
Robert Claeson E-mail: rcla...@erbe.se
ERBE DATA AB

Eric Conrad

unread,
Feb 6, 1990, 1:26:11 PM2/6/90
to
From article <22...@uflorida.cis.ufl.EDU>, by d...@beach.cis.ufl.edu (David Cabana):

> Can anyone out there tell me why cobol still doesn't have local
> variables?

COBOL does support local variables. Since the 1974 standard, COBOL has
supported separate compilation. Until the 1985 standard, externals were
not supported so communication between modules had to use parameters.

Since called procedures are static like FORTRAN subprograms rather than
recursive like Algol or Pascal, the variables retain their values from
activation to activation unless their has been an intervening cancel
statement. I guess mathematically, COBOL supports abstract
state machines rather than abstract data types.

-- Eric Conrad
+----------------------------------------------------------+
| Eric Conrad - Wright State University |
| "Progress was all right once, but it went on too long." |
+----------------------------------------------------------+

0 new messages