Ancient Technologies - RPG & AS/400
And then we had to do a project for that class. The teacher talked about a previous group doing something with HTML and CGI on the AS/400, so I decided to take on the challenge and write a complete website that uses the AS/400 as back-end with RPG as the language.
Some obstacles I encountered:
-
The website was going to be written in PHP, but our AS/400
didn't support it, so the decision was quickly made to
host the site on another server. But this adds the added
difficulty of communicating between site and AS/400. In
the end the site is running on Windows 2000 with IIS and
uses DB/400 for data storage on the AS/400.
-
The first communication attempt: DB/400 supports stored
procedures, so we'll just access the RPG programs trough
sprocs. But again, problems, at first we simply couldn't
connect to the server, we later figured out it had to do
with permissions. But after those permissions there was no
way I could call a sproc from PHP.
-
So I changed the way of communicating. First I created a
PHP class that can easily construct a command to call the
RPG program. It takes the program name and parameters and
execute it. What happens in the back is, a querystring is
constructed, it gets called on the AS/400, there a program
pulls in the querystring and parses it, after which it
calls the apropiate RPG program. Each RPG program has some
return value which gets send back to the PHP object that
initially made the call and then the returned info gets
processed on the website.
Here's how it goes in the final result:
But in the end, now it's finished, I'm amazed of the result. A fully working PHP website on a seperate server, running Windows, with an AS/400 back-end, using RPG as the language to talk with DB/400. It amazes me that a technology that old can play along with a new technology like PHP.
What do you think about ancient technologies? Do solutions like the one I just described still happen? Did you made one already?
I'd really like to know how much of these things still happen in the business world, because as a student I really have no idea.