Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

completely equivalent sources in COBOL and PL/I

Status
Not open for further replies.

Crox

Programmer
Apr 3, 2000
892
0
16
NL
Hi,

Are there some sources on the web in COBOL and PL/I that are 100% equivalent?

Regards,

Crox
 
Here's one:

COBOL:
Move A to B.

PL/1:
B := A;

There were probably COBOL to PL/1 converters and PL/1 to COBOL converters at one time. PL/1 has many capabilities that COBOL does not such as local variables and dynamic mempory allocation. PL/1 has no equivalent to the SEARCH ALL verb in COBOL. So there are some programs that would have no equivalent.
 
B :=A; is only equivalent to MOVE A TO B if A and B are elementary fields. If A or B is a group (structure in PL/I), the statements produce completely different results.
 
webrabbit is of course right.

This type of questions keep creeping up every now and then. Why would anyone strive to find "equivalent" source code from two different languages? It's complete nonsense because if we could routinely do this, then why have more than one programming language?

COBOL and PL/I are different in their approach to data processing. Is there any benefit or use to finding "equivalent" code between them?

Dimandja
 
Is anyone writing in PL/1? If so, why? I thought it was discontinued by IBM a long time ago.

I wrote a simple PL/1 program in school in 1981 or so. Haven't seen it since.

Tom.
 
I see as many openings for ALGOL as PL/1. And if you know what ALGOL is you are a real old-timer. But PL/1 is still around. There was a company that produced a PC version for it. It is vastly superior to COBOL but could never breach COBOL's enormous installed base. You can do almost anything in PL/1 that you can do in Assembler.
 
Before Microsoft (yes, there was such a time), every computer manufacturer used to have a "native" language for its machine.

IBM had (still does have) PL/I. Tandem has TAL. Prime (RIP) had PL1/G (a stripped version of PL/I). And so on...

These languages are usually maximized to take advantage of the machine architecture. Because of this, these languages are not suitable for "alien" machines.

So, it is highly unfair to compare a "universal" language such as COBOL against a "local" language such as PL/I.

That's why I cringe everytime languages are willy nilly "compared" against each other. For what it's worth, "native" languages should not be compared against common languages. For one, "native" languages are designed for coding and maintaining the local operating system, although people like using them for common business applications also.

Dimandja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top