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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top