Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Programming for the Web on the IBM i, what is possible

The AS/400 has many options for Web enablement, despite the green-screen image. Learn what Web languages are available and get resources to use as you embark on your Web journey, such as RPG, Net Dev, Java, PHP, Tomcat and others.

Andrew Borts

"How dost I program on thee Web using IBM i, let me count the ways!"

People ask me what I do on the iSeries, and I tell them I program mostly for the Web on an AS/400, and they giggle. They don't know what's available until I explain everything – and I mean everything is available – you just need to understand where to look. There's even a surprise or two waiting in the wings.

Browser languages for the Web
How we communicate using a browser is not too different from the old days of programming screens using DDS. The only difference is, there are more choices in how you present the information. I can communicate to my users using a cornucopia of elements, including video, graphics, and mice, I can show them maps, I can use external sources for other items from other companies. I may communicate using XML to external sources using software to push these "packages" and receive information that I can serve to people. There are loads of tools available, and all I need to do is know what's there, and I can sew applications and solutions together. All of this can be communicated using secured communications.

Lets start with the universal language for the web, HTML – we need hyper-text-markup-language to deliver our message. This language, like its ancient cousin has a beginning (the <html>, <head>, <,/head>) middle (<body>, </body>) and end (</html>) that wraps everything together. But, it's not necessary to program with these elements in your page, as nearly all browsers will react, and output your results. The problem is – your results may vary. Unless you adhere to the basic rules of HTML, you may not get the same results between all the browsers. Stick to standard HTML, and you're going to be fine in most cases.

Javascript is another portion of every Web page you're going to write. Why? It's your first line of defense for keeping the data kosher. Every input field on the Web is a nasty text only representative of what it should be. Numbers all are sent as texts, and your job is to put them into the format needed to save in your files. How do we achieve this? First, you can prevent people from entering and pasting numbers into the fields. You do this through small mini local "events," which get fired when people are inputting into a text field. You can do this or you can thoroughly test the data before it is submitted as a form into your pages, it's your choice. Regardless, you're going to become friends with Javascript, and possibly VBScript. Also remember, you have friends that have done this before. Javascriptsource.com is a great location to see exactly what you can do with your pages to make them shine.

Communicating with Web browsers from IBM i
Now we understand the language of the browsers, but what can you do with the IBM i?

Apache: (a play on words with "a-Patchy") is an essential part of serving at least 85% of the Web. You need this component to "talk" to the browsers hitting you. Getting the latest PTF's is highly recommended, as you will receive security patches frequently. Once you get this down, you need to setup your Web server for serving common gateway interface (CGI) programs, where the back end serves data to the Web dynamically.

Getting the latest Apache PTF's is highly recommended, as you will receive security patches frequently.

RPG: RPG has been on the Web from the very beginning when the AS/400 could serve to a browser. We were using programs as examples to play with, called the CGIDEV libraries, and now it's younger cousin, the CGIDEV2 libraries. Both toolsets were written by the Rochester, Minn., IBM team, but then shown to the world by GB Peroti in Italy. Go to Easy400.net and you'll see the results of some amazing programs written in RPG. These programs are living proof that RPG can do more then we've expected. RPG is using "C" API's (advanced programmer interfaces) to read what we webbies call "standard input" and respond with "standard output" (the basic "rhythm" of the Web). Once downloaded, and observed, your CGI programs could be in RPG?!? Bet you never thought that could happen. But it's been a snappy quick way to talk to the Web for over 10 years.

Net.Data: A basic macro language shipped with every iSeries system, and it has been there for over 10 years. Net.Data isn't the swiftest kid out there, but it'll do its share of quick written applications. Why? It's quick to get started: All of the materials are on the CDs delivered with your OS. You can serve dynamic things, get used to it, but I suggest if you start here, you graduate as quickly as you can to other Web tools. Please keep in mind, the IBM i is one of many OSes that have Net.Data available.

PHP: Yes, PHP! Zend technologies now offers a Zend core, PHP runtime, free download for IBM i.

Zend technologies now offers Zend Core, the PHP runtime, as a free download for IBM i.
Zend's offering actually is now shipped with the i5 OS for free since V5R3, the PASE environment where you actually have a version AIX running (can anyone say Qshell?). This environment runs a parallel copy of Apache to serve PHP pages, and MySQL all from IBM i. The neatest part of this is the HUGE amounts of sample code available to download that you can run right on your i without modifications. This is also a very fast and efficient way to serve on the internet. PHP offers tools you see on mature modern systems, such as PDF creation tools, verifications tools to make sure there's a person on the other side of the browser (you've seen those weird looking graphics you need to type the letters for verification?). All this and more plug-ins and software than you can shake a stick at.

Other: After this, who could ask for more? Well, Java has been a friend on the i that is very robust, enterprise worthy, and you don't need to break the bank to use it. Tomcat is a functional part of Apache, and is included when you install Apache. Tomcat can be configured to serve JSP pages as long as you don't get too fancy. Once you graduate into tougher software, and need more robust tools, graduating into WebSphere isn't a bad thing. WebSphere is a standard, robust toolset to help you get your jobs on the Web done.

So many Web options for IBM i, so little time
We've only spoken about a fraction of the capabilities of what you can do. iSeries Express also offers tools to open up .Net and VB programming, or ASP pages running from a Windows server isn't out of the question. Within each of these toolsets opens up a HUGE world of communications you can do with other web servers all over the world. You can screen scrape Web sites with an AS/400 if you need to in order to get your job done. Now is this Lazy? No, but it opens up a bag of tricks that you can show to people when they ask what you can do with your "i for business."

ABOUT THE AUTHOR: Andrew Borts is Webmaster at United Auto Insurance Group in North Miami, Fla. He is a frequent speaker at COMMON and is past president of The Southern National Users Group, an iSeries-AS/400 user group based in Deerfield Beach, Fla.

This was last published in May 2009

Dig Deeper on Web Tools

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.