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

Cobol vs. RPG

2,283 views
Skip to first unread message

Leocadia

unread,
Jul 27, 2001, 12:47:31 PM7/27/01
to
In what situation Cobol is better than RPG and vice versa ?

Leokadia


Mark Soulje

unread,
Jul 27, 2001, 6:34:24 PM7/27/01
to
"Leocadia" <nina_h...@hotmail.com> wrote in message news:<DWg87.63459$pH2.1...@typhoon1.gnilink.net>...

> In what situation Cobol is better than RPG and vice versa ?
>
> Leokadia

I have coded with both COBOL and RPG on the 400. I used to really
prefer COBOL when I had to do a lot of string manipulation. But with
the newer releases of the ILE RPG compilers, that differentiation is
not as significant. The big difference for me is the volume of
support and references you can get when coding in RPG v. COBOL. It
seems that the default to understanding anything in terms of
application programming on the 400 is RPG. I really saw this when it
came to learning subfile programming. The references for subfile
programming in COBOL were scarce, but when I learned RPG, there was
plenty of readily available material on the subject. I know when I
worked on Mainframes I had an instructor who said that COBOL compilers
produced the most efficient machine code without exception. I would
be interested in knowing if that distinction applies on the 400 as
well.

SJ Lennon

unread,
Jul 27, 2001, 8:19:28 PM7/27/01
to
I believe that RPG is a better fit for the AS/400. Cobol needs some
extensions to work. Cobol might be a bit better in array handling.

Caveat: I'm an RPG programmer at heart who only modifies Cobol code. I
find the stuff I modify wordy to an extent that hides the intent and
flow of the code, but that may be due to the style used and it can
happen in any language.

Sam

"Leocadia" <nina_h...@hotmail.com> wrote in message
news:DWg87.63459$pH2.1...@typhoon1.gnilink.net...

Daniel Gross

unread,
Jul 28, 2001, 3:56:25 AM7/28/01
to
Hi!

"Leocadia" <nina_h...@hotmail.com> wrote:
> In what situation Cobol is better than RPG and vice versa ?

I hope this will not start a sort of "religious war", but I think the
question is not "which language is better?".

Any programming language is only a tool to tell the machine what it should
do.

The real important questions are:

- Which language do I prefer?
- Which language is mostly used in my shop?
- Which language was used for "our" sw package?

But for the most IT shops with an AS/400 the questions 2 and 3 are answered
with "RPG". I've only seen some (ok correctly 2) IT shops with an AS/400
which are using COBOL, and for those guys question 3 was answered with
"COBOL". As someone else stated, you will get more support for RPG on the
AS/400, because more people are using it.

The advantages of COBOL in the past (array handling, string manipulation)
are now catched up thru RPG IV (ILE-RPG). So if you can decide on your own,
test both languages, and make your decission. With the new LICPGM
"WebSphere Development Studio" you get both languages (and C, and Visial
Age for Java + RPG, and CODE/400, and ...) so it's easy.

HTH and Bye
Daniel

Thomas Kine

unread,
Jul 28, 2001, 3:11:18 PM7/28/01
to
I use both COBOL and RPG.

- I prefer RPG's syntax for arrays, although COBOL can handle
multi-dimensional arrays more gracefully.
- RPG manages screens a little better.
- The MOVE CORRESPONDING in COBOL is handy.
- COBOL is certainly wordier, but I don't mind typing and make my code
self-documenting.
- Sticks in my mind there are a few issues with non-local data areas in
COBOL.
- I use embedded SQL in both. I'm not crazy about COBOL's file-handling
op-codes, but SQL equalizes this.

I'd be hard-pressed to say one is clearly superior to the other. Both are
3GLs oriented towards procedural programming and, as such, are relatively
easy to move between. You can apply algorithms or techniques from one
pretty much directly to the other.

If you were comparing RPG and COBOL to C, C++, Java, or Pascal, you would
see more dramatic differences and likely get more opinionated responses to
your question.

Thomas Kine
www.RighteousSoftware.com

"Leocadia" <nina_h...@hotmail.com> wrote in message
news:DWg87.63459$pH2.1...@typhoon1.gnilink.net...

Dale Berta

unread,
Jul 29, 2001, 8:27:33 PM7/29/01
to
For batch type work, I generally prefer RPG. Of course this presumes
knowledge of logic cycle programming, which seems to be missing from current
RPG curricula.

For interactive work, I think COBOL has a slight edge. When you do
workstation I-O, you can use the INDICATORS ARE phrase (both input and
output). This means you can define (if you want to) a separate set of
indicators for each format that is input, and another set for each format
that is output. Although recent changes in RPGLE change this a little, it
still isn't as easy or obvious as COBOL.

"Leocadia" <nina_h...@hotmail.com> wrote in message
news:DWg87.63459$pH2.1...@typhoon1.gnilink.net...

D. Martin

unread,
Jul 29, 2001, 9:57:35 PM7/29/01
to

If you are using the RPG cycle for your Batch RPG programming, then I
understand why you still favour Cobol.

RPGLE does change the whole idea of using indicators.

D.Martin

On Sun, 29 Jul 2001 20:27:33 -0400, "Dale Berta" <da...@fast.net>
wrote:

Walter

unread,
Jul 30, 2001, 2:09:54 AM7/30/01
to
> In what situation Cobol is better than RPG and vice versa ?

The main difference is IMHO staff availability and building programmer's
skill.

Cobol: Someone who knows any programming language learns it by reading some
example programs. Be it an old mainframe guy coming with PL/1 knowledge or
one who learned Visual Basic on his PC. Both will be productive Cobol
programmers after a few days.

RPG ist the main midrange language since /38, more programs on the AS/400
than Cobol.
If your situation is a staff of experienced RPG programmers with few
changes, then it's your language. But new people need much more time until
they are productive programmers. And many will refuse spending months of
learning into something they might call a proprietary technology, going down
in the long run, be it like that or not.


Walter


Lee Allen

unread,
Jul 27, 2001, 4:16:04 PM7/27/01
to
On Fri, 27 Jul 2001 16:47:31 GMT, "Leocadia"
<nina_h...@hotmail.com> wrote:

>In what situation Cobol is better than RPG and vice versa ?

Others may address the technical aspects of this issue, but I will
share two issues, based on our company's Cobol experience on the
AS/400.

- It's easier to get things done on the AS/400 in RPG (it is better
supported and better documented)
- RPG code is not portable to other platforms, Cobol is. RPG skills
are not applicable to non-IBM shops.

-Lee Allen

0 new messages