Go Back   System iNetwork Forums > Development > RPG

Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2006, 06:41 AM
Bhuvan Bhuvan is offline
Member
 
Join Date: Oct 2006
Posts: 11
Question Difference b/w RPGIII (RPG/400) and RPGIV

Hi,

Can anyone please tell me the differences between RPG III and RPG IV. Apart from date-time stamp calculation, what all differences do these have ?
Reply With Quote
  #2  
Old 11-30-2006, 07:37 AM
Tomholden's Avatar
Tomholden Tomholden is online now
System iNetwork Forum Pro
 
Join Date: Sep 2005
Location: Lebanon, TN
Posts: 2,252
some of the major differences

RPG III is OPM (Original Program Module) only where RPGIV can be ILE (integrated language environment).

RPG III does not provide for internal subprocedures, RPG IV does. RPG III does not allow prototyping. RPG III does not have a way to utilize local variables. RPG IV (using ILE functionality) provides a better interface to programs written in other languages (C, C++, etc.)

RPG IV also provides much better string manipulation than RPG III. RPG IV allows free-format code where RPG III does not. RPG IV is still being enhanced where RPG III is no longer being enhanced. RPG IV provides better null support. RPG III does not provide a "real" means of utilizing pointers RPG IV does.

There's many more things that make RPG IV more attractive, these are just a few off the top of my head.

HTH
__________________
Tommy Holden
Experience has it's benefits...unfortunately by the time you acquire it you've forgotten what you needed it for...
Reply With Quote
  #3  
Old 11-30-2006, 07:58 AM
spitcher spitcher is offline
Member
 
Join Date: Apr 2006
Posts: 53
Thumbs up

As well, in my opinion, free form RPG is hell of a lot easier to read.
Reply With Quote
  #4  
Old 11-30-2006, 08:16 AM
SteveK SteveK is offline
Member
 
Join Date: Oct 2005
Posts: 69
Difference b/w RPGIII (RPG/400) and RPGIV

Besides the fact RPGIII programs run in an emulated environment (The old OPM) the differences are night and day.

I have been working with an older RPGIII based ERP recently. First time using RPGIII in over 7 years.

Just off the top of my head:

6 char field names; 50 file limit per program; string manipulation; date manipulation; encapsulation of business rules; code reuse; I-specs vs D-specs. Conditional limitations vs extended factor 2 (ie IFEQ ANDEQ ANDNE). Pure readability.

RPGIII pales in comparison
Reply With Quote
  #5  
Old 11-30-2006, 11:22 AM
Scott Klement's Avatar
Scott Klement Scott Klement is offline
 
Join Date: Jul 2005
Location: Milwaukee, WI, USA
Posts: 10,387
RPG IV advantages:

a) More useful/powerful H-specs.

b) No limit to the number of files in the F-specs.

c) All definitions controlled with D-specs instead of some being in I-specs, some being on C-specs, etc.

d) The ability to use variables with names longer than 6 characters. (In current releases of RPG IV, you can code variables up to 4096 characters long! Not that you'd ever want to make one that long...) The ability to use meaningful variable names by itself, without any other advantages, makes RPG IV a much better choice than RPG III.

e) The ability to do proper string manipulation. This is another feature that, by itself, is enough to make me use RPG IV instead of RPG III. String manipulation is one of the most basic features of any programming language, and the fact that it was SOOOOOOO unbelievably awkward in RPG III made that language extremely frustrating to work in.

f) The ability to use numeric expressions. X = (Y * 3) / 100 instead of Y MULT 3 TEMP, TEMP DIV 100 X.

g) The ability to perform date/time/timestamp calculations.

h) The ability to directly call subprocedures or methods written in other languages as if they were subroutines inside the same code. This means that you can download an open-source routine written in C or Java, install it on your iSeries, and call it as a piece of your program. This enables all sorts of capabilitites! Such as the ability to create graphs and charts. Create spreadsheets. Access Windows files directly from your RPG program, even across a network. Parse XML. The list goes on and on and on and on...

i) Activation groups to control the scope of resources and close them all down together.

j) Increased ability to build modular reusable components instead of monolithic programs.

k) Easier to read and maintain syntax, both with "extended factor 2" and with free-format code.

l) The ability to access/work with large objects (LOBs) in databases.

m) The ability to use data structure features such as OVERLAY and QUALIFIED that can let the system do more of the work for you, and greatly simplify coding efforts.

n) The ability to best data structures inside each other.

o) The ability to use prototypes and procedure interfaces that let the system take much of the pain out of calling other programs, Java methods or ILE subprocedures. They protect you against errors. They let the system automatically do variable conversions. The list goes on and on... This alone would be adequate reason to use RPG IV instead of RPG III.

p) The ability to perform file operations without using indicators. And to put screen i/o indicators into a data structure where they can be given valuable names. This feature alone would be adequate reason to use RPG IV instead of RPG III.

RPG IV is a superset of RPG III. Everything you can do in RPG III you can also do in RPG IV using almost identical syntax (the columns are a little different, that's the only difference. And the source code editor (SEU or WDSC) will tell you where the columns should be as you're typing them.) So everything you can do in RPG III will also work exactly the same in RPG IV. Plus, RPG IV gives you mountains and mountains of new features that RPG III doesn't have. There's absolutely no reason whatsoever to stick with RPG III today.

Remember, IBM stopped adding new features to RPG III. The only new feature they've added in the past 15 years has been Y2K compatibility. Every new feature they've added to the RPG language in the past 15 years has been added only to RPG IV. You're REALLY missing out if you continue to use RPG III.
Reply With Quote
  #6  
Old 11-30-2006, 11:37 AM
Lynne Noll Lynne Noll is offline
System iNetwork Forum Pro
 
Join Date: Jul 2005
Location: Gloucester MA USA
Posts: 2,782
I know people who won't use ILE, or /free, or SQL, or API's. But I don't know anyone who did more than a month of RPG/IV who would voluntarily go back to RPGIII. The dates are nice, but they aren't that important to me.

I really like:

1) Simple character fields longer than 256 bytes. (64K is not quite long enough!)
2) All the natural string expressions.
3) Constants as long as they need to be.
4) Field and routine names over 6 bytes.
5) Normal equations for arithmetic. Parentheses!
6) Support for all the kinds of data you can put in a DDL defined data base (even if you need SQL to get there.)
7) Support for all the kinds of variables you can use in C. (And the ability to call anything you can call from C.)
8) Support for Java objects.
9) Parentheses in IF statements.
10) Support for searching only part of a array.


I'm getting really attached to the way RPG/Free indents and does I/O, as well. But that's just gravy.
Reply With Quote
  #7  
Old 11-30-2006, 11:39 AM
Barbara Morris Barbara Morris is offline
Member
 
Join Date: Sep 2005
Location: Toronto Canada
Posts: 807
Quote:
Originally Posted by Bhuvan
Hi,

Can anyone please tell me the differences between RPG III and RPG IV. Apart from date-time stamp calculation, what all differences do these have ?
Besides the additional functions in RPG IV that others have already listed, there are a few behavioural differences between RPG/400 and ILE RPG. They are listed in Appendix A of the ILE RPG Programmer's Guide. http://publib.boulder.ibm.com/infoce...htm#HDRRPGDIFF
Reply With Quote
  #8  
Old 12-12-2006, 06:58 AM
Bhuvan Bhuvan is offline
Member
 
Join Date: Oct 2006
Posts: 11
Thumbs up Reply to original qry.....

Hi all,

Thanks a lot....this proved to be of great help to me....
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:37 AM.