e-RPG: Building Web Applications with RPG
Authors: Brad Stone
Venue:  (2000)

From the Book:The term e-business describes a new way of doing business. It's also part of a revolution. Just as the Industrial Revolution modernized manufacturing and production, today the technological revolution is changing the way we do business. A big part of the technological revolution includes doing business on the Internet. In the past, the Internet has been a place for people to gather information. Online resources such as Usenet, Internet discussion forums, search engines, and Web browsers allowed users to retrieve or discuss interesting information. Now, the Internet is a place to do business. It is estimated that by the year 2001, billions of dollars will be spent buying merchandise and services on the Web. People already purchase items such as books, cars, and stocks over the Web. The revenue from Web-based sales comprise, on average, 10 percent of a supplier's income. And companies also are using the Internet and intranets to conduct business in hundreds of other ways-from dealer support to customer inquiries to internal reporting. This is what makes e-business so important for you and your company. THE OLD STANDARD In the beginning, most companies embraced e-business technology foreign to AS/400 programmers. Companies created new divisions in their Information Technology departments devoted solely to this new technology. These new departments set up non-AS/400-based servers to distribute e-mail, provide Web access, and allow file sharing. AS/400 programmers lucky enough to have e-mail and Web browsing capabilities, soon discovered a new avenue of communication and information retrieval. Taking advantage of such services as newsgroups, discussion forums, andmailing lists, AS/400 programmers accessed the minds of colleagues and individuals to share operations and programming information about the AS/400. Through this initial contact, they experienced a small portion of the power of the Internet. As the Internet grew and e-business started to take shape, new applications such as Web-based order forms and electronic customer service sites started to emerge. Programs once run using tried-and-true green-screen applications were suddenly being ported to other systems to support these early ventures into Web-based business. Data was usually retrieved from a separate Web server and transferred to the AS/400 for processing. If the team that developed and maintained the original order-entry system was included in the development of these new Web-based applications, the transition was ideally seamless. If they were not, most users' first experiences with e-business most likely weren't pleasant. Although years of thoughtful work may have been put into developing a company's system, sometimes, in the rush to get connected, oversights and cut corners occurred. When Web-based systems were developed for the same purpose as existing AS/400 systems, duplication of data processes became a problem. Processes that should have been included in the front-end system were omitted, and data had to be reprocessed on the AS/400. Because Web development and AS/400 application development were traditionally viewed as separate endeavors, it was not easy to iron out these discrepancies. THE NEW STANDARD If I told you that today you can create and provide fully functional e-business solutions using just your AS/400 and the RPG programming language, would you call me crazy? For years, the AS/400 has been running multibillion-dollar businesses as well as mom-and-pop stores. When the Internet came onto the scene, it hit hard and fast. Suddenly, businesses required functionality that the AS/400 did not provide. Recognizing the innate potential of the AS/400 to evolve to meet the needs of its users, IBM acted quickly to close this gap in resources. Since the release of OS/400 V342MO and V347M0, the AS/400 can act as a Web server, not just a green-screen application server or a database server. In addition, you can solely use RPG to write programs to aid in your Web solutions. This is just the solution for which AS/400 programmers were waiting. A Whole New Ball Game You've depended on the AS/400 throughout the years to be a reliable machine that gets business functions done. As the AS/400 has become more powerful, more functional, and most important, more affordable, you can expand your horizons and apply that same trusted architecture to your e-business solutions. The AS/400 can now be a mail server, a file transfer protocol (FTP) server, a file server and, most important, a Web server. (Contrary to popular opinion, getting the Web server running-not programming Web applications-is the most challenging obstacle you will face. It's important to get your AS/400 programmers trained in Hypertext Transfer Protocol (HTTP) server functions before you begin the transition to AS/400-based e-business.) You may have heard the terms HTML, CGI, Perl, Java, and JavaScript used to describe Web programming, and you may have wondered how your development staff was going to master all these new languages. What if I were to tell you that to use the AS/400 as a Web server, your programmers need only learn one: Hypertext Markup Language (HTML)? HTML is the basic language needed to make the AS/400 a successful e-business machine. And HTML isn't even a programming language; it's a markup language that is easy to learn and easy to use. If you are wondering how HTML will perform all the functions needed for your Web-based business venture, the answer is sitting in the QRPGLESRC source physical file on your AS/400 right now. E-RPG E-RPG is a new term for a new era for the AS/400. RPG, or even COBOL (common business-oriented language), can be used to produce Web interfaces for your company. And the great thing is that there is only a small learning curve, if any. To produce applications on the Web, you really only need to modify your current applications. Programs that take orders and produce reports can be modified to run as Web applications and still use RPG. When you think about it, there isn't any real procedural difference between a green-screen order-entry system, and a Web-based order-entry system. The only significant difference is the user interface. The same holds true for reports. The process used to gather the information to produce the report will be the same whether it is printed on green-bar paper or displayed on a Web page. The purpose of this book is to provide the knowledge needed for your AS/400 staff to start developing e-business solutions for your company using your trustworthy machine. It will take you through the basics of HTML programming to JavaScript programming, through the setup of the HTTP server, and finally e-RPG programming techniques. It will be a great asset if someone on your development team understands how Web applications work, even if you use the AS/400 for a small portion of your Web business. When you are dealing with other programmers who are developing the front-end Web systems on another platform, you will have someone who understands the terminology and can speak with them. e-RPG will help you put the ball back in your court when developing e-business solutions by using the power and stability of the AS/400 to enhance your company's exposure and profitability with the resources that you already have available to you. Now let's get started!