Ancient Technologies - RPG & AS/400

I just finished a school project in RPG. In the beginning I hated RPG and the AS/400 it was running on. When you're used to writing languages like PHP, C++, C#, Perl and even batch, RPG seems like a nightmare, crazy syntax, column based, numeric vs character variable handling, ...

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:

Ofcourse there were also a lot of obstacles getting to know RPG and the way it works with the system, especially in the capitalization departement, sometimes it's case sensitive when you don't want it, and another time it's back to case insensitive.

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.

8 Comments

  • This looks great. I know AS/400 is used a lot in the business world, and yes I know how difficult it is to program the AS/400. I've done it for 4 years.



    I don't know if you already know, but Microsoft has also a solution to use the AS/400 as back-end. it's named Host Integration Server 2004 (HIS). At this moment it's still in Beta 2. Whit HIS, you can call RPG programs from withing VS.net and visa versa;



    I have used HIS now for a few months, and we're implementing this server for a customer. The big advantage is that you can leave all your business logic and the database site on the AS/400. You just have to write an interface between the two in HIS and the front end in f.e. ASP.Net.



    You can find some information, troubles and there solution on my blog.

  • yeap! RPG! i think it stands for Role Playing Games.....:p

  • RPG



    Really

    Painfull

    &

    Gruesome



    :-)

  • Taking notes...

    could use it soon :p

  • Hi - i am a student and would like to learn a little about integrating different technologies. I am looking into the integration of technology of two different companies, here are some details...



    company 1 -

    win2000, pentium machines, UX

    switching tech in LAN

    leased line WAN

    Oracle Technology

    turnkey apps

    legacy apps (CICS, VSAM, IMS, MVC)

    company wide integrated internet and email (MS EXchange)



    company 2 -

    IBM host and SNA environment

    AS400 amd BPCS

    Near company wide email (Lotus Notes)



    my aim is to integrate the two in the best way.

    consolidate group communications (intra company WAN)

    extend network for voice and data integration

    enforcing security



    also, company 1 has sites worldwide and company 2 is in a different country.



    please could you advise me on a wise move for integration.



    thanks

  • Lucky you, we didn't get oledb to work at all at that time :/

  • I need sample RPG400, RPGILE programs pdf. You have any idea about this i mean say any sites or you collected some programs folder....let me know i will check that programs for my better capabilities.

  • take a look at free-format RPG IV...it's much more like "modern" programming languages and should be easy enough for any of you to understand....

Comments have been disabled for this content.