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.
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...
"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
- 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...
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...
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:
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
>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