0

I have to evaluate the legacy software used by a company my employer intends to buy. The software was originally programmed in RPG II (or III?) for IBM System/38 and been continuously expanded since. It now resides on a brand new i Series server with i5/OS and runtime environments for RPG II, III, IV/ILE. I'm not really worried about the software, but the data storage. I know that i5/OS includes a DB/2 relational database, but DB/2 only came to the midrange in the 1990ies. The software predates that by about a decade. System/38 featured an integrated database as well, but I could not find any details, or even the name.

The company resides in a heavily regulated business segment and I know for a fact that massive reporting changes are to be expected in the next three years. I would prefer to solve the reporting issues on a relational database since SQL experts are more readily available than RPG experts.

So I want to know:

  • Can I easily access legacy RPG II OPM traditional system database files via the integrated DB/2?
  • Do these database files show up automatically in the DB/2?
  • Do I need to "import" them in any way?
  • Do I need to change the software that creates/accesses them in any way to be able to use them from inside DB/2?
  • Or am I completely on the wrong track and the system works in a totally different way?

I don't want to replace the existing data storage method, I'm just looking for SQL based ways to access existing data periodically in a read-only/copy-to-report-database-cube fashion.

I browsed the IBM knowledge base and some redbooks, but neither "Modernizing IBM i Applications" nor "IBM i Database programming" were of much use in solving this question. All of the literature I found assumes detailed knowledge of the legacy systems and explains high-level language and SQL concepts, but none explains the legacy system in terms of a modern highlevel language & SQL view. So pointers to "RPG & i5/OS for the Internet Generation" would be highly appreciated, too.

leisurelarry
  • 353
  • 2
  • 12
  • i've seen RPGII using table in QS36F with name like AB.CDE. For SQL just add " e.g. `select * from qs36f."AB.CDE"`. We create normal index/views in normal library to easily access/update this qs36f."AB.CDE" using newer RPG IV,SQL or other languages. – lamLam Jun 11 '15 at 04:35

1 Answers1

4

On IBM i (formerly AS/400, System i, & iSeries), databases are databases. You can access them in just about any language regardless of how they were originally defined.

The database called 'DB2 for i' is the same basic database that was in the first release of the AS/400 (it's gotten faster, more efficient, gobs more features, etc., but the basic functionality is still the same).

You can access older style database files (physical & logical files) using SQL, and you can access SQL defined files using traditional RPG functions (chain, read, reade, etc). You may not be able to use some of the more advanced features, but the basic functionality will always be there.

IBM i biggest value proposition is backwards compatibility ... you can upgrade from one release to another and 99.9% of your application code will run unmodified (that .1% only applies if you try to do things that break the rules, few applications do that).

David G
  • 3,940
  • 1
  • 22
  • 30
  • Um, one minor caveat to that ... you did mention RPG II ... which often uses flat files with program described file layouts. Those aren't going to be able to be used very easily in SQL. RPG III programs generally uses externally described files (DDS or SQL). If the application in question uses DDS or DDL defined files, then there is no problem. – David G Jun 10 '15 at 15:57
  • Thank you, this very helpful (and relieving ;-). I don't know whether there are any RPG II programs about, there certainly seems to be a RPG II runtime installed. Is there any quick and reliable way to identify RPG II? I guess I'm in the soup, if I see a program cycle? Anything else I need to watch out for? Is porting a RPG II program from flat file to database very complicated, or something that can be done in a week, or so? The software is a type of specialised accounting software and any components this old, must be fairly basic customer or record master data. – leisurelarry Jun 11 '15 at 05:19
  • 2
    All RPG programs, regardless of version, can use the cycle (although few do these days). Converting a program from flat file to externally described isn't hard. The hard part is converting the data. You can tell if the file is flat or externally described by doing a DSPFFD on it ... if you see many fields, it's externally described, if you see only one field, it's flat. – David G Jun 11 '15 at 14:06
  • Also FWIW flat files can be redefined (aka externally described) using DDS or SQL and still accessed by RPG II... the big question to your vendor would be did they do that or not. Even if they didn't you could create logical files on top of them to expose the data more easily to SQL but it's less than ideal. Ask if they have any multi-member files. Those are a big pain to access using SQL... if they do that will make you crazy. – Brandon Peterson Jul 15 '15 at 15:17