2

DB2 AS400 & RPG

Please explain relationship in simple way since I'm quite confuse after doing some research

So far I understand DB2 is a kind of database for AS400 System written in RPG programming Language.

Is this correct?

4
  • 3
    RPG is a programming language that's present on a number of different systems (a fair number of which are not related to the AS/400 family). DB2 on the AS/400 (current machines being part of System i) is integrated with/layered over pre-existing parts of the OS (this has a number of interesting effects in places). RPG can use SQL to talk to the database, but it doesn't have to (there are other access methods available). You can also use other languages to talk to DB2 on the box. Were you looking for something in particular? Mar 24, 2014 at 10:30
  • 1
    Actually, the current machines are "Power Systems" and "Pure Systems", using server POWER7, 7+, or the upcoming POWER8 chips.
    – WarrenT
    Mar 24, 2014 at 14:58
  • thx all for answer me Mar 25, 2014 at 8:12
  • @Clockwork-Muse: While it's true that RPG has been ported to a few other systems, it's misleading to portray RPG as having any real presence on them. For all intents and purposes, RPG is exclusively an IBM i (and predecessors) language.
    – John Y
    Mar 27, 2014 at 22:28

1 Answer 1

7

The AS/400 series (consisting of AS/400s at first, and then iSeries, System i and later systems) has DB2 as the DBMS. DB2 is tightly integrated with the OS and with all compiled languages used on the system. DB2 is a relational DBMS that may be accessed and maintained via SQL.

RPG is a programming language and is the most commonly used language for business programming on the AS/400 series. There are two most common "flavors" of RPG on AS/400s: the older RPG III and newer RPG IV. (There can also be even older RPG II, but it's mostly irrelevant for this question.) You'll usually see RPG III referred to as RPG/400 or OPM RPG, while RPG IV is referred to as ILE RPG.

OPM stands for 'Original Programming Model'. ILE stands for 'Integrated Language Environment'.

Those two terms generally apply to many compiled languages on the AS/400 series. So, there is also ILE COBOL and OPM COBOL, as well as ILE C/C++ and others. The implementation of the ILE in 1994 allowed the various language compilers to compile "modules" that could subsequently be bound together to create "bound programs". Any ILE language could then call procedures in bound modules compiled from any other ILE language. So, one "program" might consist of procedures written in C, RPG, COBOL and even CL (the compiled 'Control Language').

Database access by RPG (and most other compiled languages) can be done through "native" access methods using verbs such as READ, WRITE and others; or standard SQL statements can be embedded such as SELECT, FETCH, INSERT/UPDATE/DELETE, etc. Either way, the database that is accessed is a DB2 database.

The OS is 'object based'. Because of that, tables and views are also compiled 'objects', either compiled from source code known as DDS or created with SQL by CREATE TABLE and CREATE VIEW statements. The compiled languages can generally use either older 'native' methods or SQL to access data in DDS or SQL-generated files. The underlying implementation is essentially the same, so both access methods work either way.

In short, DB2 is a DBMS. It's all about creating and maintaining tables, views and related database objects. It may be compared to Oracle or SQL Server.

And RPG is a compiled programming language, somewhat like C or COBOL. Programmers code RPG programs in order to control how users interact with DB2.

4
  • so as400 is both OS & hardware system with integrate DB2 Mar 25, 2014 at 8:15
  • 1
    Not exactly. AS/400 is the hardware. OS/400 is the corresponding OS. The current name of the OS is IBM i The current release is 7.1 TR6 Mar 25, 2014 at 12:19
  • 1
    @jmarkmurphy: Not quite true. As a specific technical name, "AS/400" refers to the combination, and integration, of both system hardware and system software. Until after "AS/400"s were phased out, it wasn't possible to have a working "AS/400" without OS/400, nor to have a working version of OS/400 without the appropriate "AS/400" hardware. As iSeries and later systems came along, the separation became possible. But aside from technical definitions, much of the world still considers current hardware to be "AS/400"s regardless of correctness. Mar 26, 2014 at 8:28
  • 3
    I think we are straining at gnats here. You are right about the original AS400's, the term included the whole package, but the OS was still named OS400 even then. But now the OS is totally separate from the hardware, and while people still say AS400 in relation to current equipment, they mean Power Systems or Pure Systems running IBM i. Mar 26, 2014 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.