Advanced Integrated RPG - Softcover

Snyder, Thomas

 
9781583470954: Advanced Integrated RPG

Inhaltsangabe

Written for experienced RPG programmers who want to take advantage of the latest technologies&;such as Excel spreadsheets, Adobe files, and e-mail&;from within their existing applications without buying costly software, this manual illustrates how to integrate RPG and Java in easy-to-understand code and with cost-effective options. Currently, there exists a very distinct line of expertise between IBM I programmers and Windows and Internet programmers, and this reference breaks through those obstacles to show common development tools for sharing information and building more compatible interfaces. Filling a very crucial gap, this resource shows programmers how to automatically e-mail reports using RPG and JavaMail, how to embed SQL and create text and XML files from within RPG, and how to migrate existing green-bar reports to Excel spreadsheets. An essential reference, this guide covers hard-to-find yet crucial information and introduces RPG programmers to modern environments.

Die Inhaltsangabe kann sich auf eine andere Ausgabe dieses Titels beziehen.

Über die Autorinnen und Autoren

Thomas Snyder is a computer programmer and analyst who has been developing RPG applications for more than a decade, working to modernize them as well as to integrate them with other technologies, such as Java and QShell. He is a Sun-certified Java programmer and formerly worked at Intel as a hardware engineer. He lives in Scranton, Pennsylvania.



Thomas Snyder is a computer programmer and analyst who has been developing RPG applications for more than a decade, working to modernize them as well as to integrate them with other technologies, such as Java and QShell. He is a Sun-certified Java programmer and formerly worked at Intel as a hardware engineer. He lives in Scranton, Pennsylvania.

Von der hinteren Coverseite

Written for experienced RPG programmers who want to take advantage of the latest technologies—such as Excel spreadsheets, Adobe files, and e-mail—from within their existing applications without buying costly software, this manual illustrates how to integrate RPG and Java in easy-to-understand code and with cost-effective options. Currently, there exists a very distinct line of expertise among IBM I programmers and Windows and Internet programmers, and this reference breaks through those obstacles to show common development tools for sharing information and building more compatible interfaces. Filling a very crucial gap, this resource shows programmers how to automatically e-mail reports using RPG and JavaMail, how to embed SQL and create text and XML files from within RPG, and how to migrate existing green-bar reports to Excel spreadsheets. An essential reference, this guide covers hard-to-find yet crucial information and introduces RPG programmers to modern environments.

Auszug. © Genehmigter Nachdruck. Alle Rechte vorbehalten.

Advanced Integrated RPG

By Thomas Snyder, Cindy Snyder

MC Press

Copyright © 2010 Thomas Snyder
All rights reserved.
ISBN: 978-1-58347-095-4

Contents

Title Page,
Copyright Page,
Dedication,
Acknowledgements,
Introduction,
1 - Learning to Provide Modern Solutions,
2 - The Integrated Language Environment,
3 - Advanced ILE RPG,
4 - Introduction to Java,
5 - Java and RPG,
6 - Java Native Interface,
7 - Excel Basics,
8 - Excel Formatting and Properties,
9 - Excel Formulas and Charts,
10 - PDF Basics,
11 - PDF Formatting,
12 - PDF Images and Bar Codes,
13 - Sending E-Mail,
14 - JavaMail Formatting and Attachments,
A - EBCDIC/ASCII/Hexadecimal Translation Table,
B - Data Formats for Use with HSSFDataFormat,
C - References and Resources,


CHAPTER 1

Learning to Provide Modern Solutions

Over the course of this book, you will learn to enhance your existing applications to modernize the output of the system. To do this, we'll take advantage of the modern capabilities of ILE RPG that you can incorporate into your existing code. The Integrated Language Environment (ILE) enables you to write code in a much more modular way, which means you can write code in small, reusable components that are better encapsulated and easier to maintain.


Providing Solutions to Meet Today's Industry Standards

When you look at your Original Program Model (OPM) programs and think about why these programs were developed, the goal was likely to provide comprehensive software that would withstand the test of time and produce solid, reliable results as the backbone for business-critical operations. If you were to focus solely on this aspect, you might not see the need to even bother using ILE. After all, you have a programming language that works, it has been around for a very long time, and it is easy to understand. So, let's consider some of the limitations of this way of programming and define the reasons why modernization of the code is necessary.

The first thing that comes to mind when discussing modernization is aesthetics. When you have a system that provides indisputable data that is necessary for business processes, you may consider the ability to create "modern" reports in Microsoft Excel or Adobe PDF form as being an unnecessary enhancement. After all, the data is being generated, the information is being audited, reporting is being performed, and the company is generating revenue. How important is it to make the reports look better? Well, there are other factors beyond appearance that you need to consider when evaluating the need for spreadsheets and PDF files.

Portability

Portability is a big one. To address this issue, your initial thought might be to generate ASCII text files. If you've been working with RPG for a few years, there's a good chance you've already tried this approach.

However, if you delimit the ASCII data using a special character, you must make the user aware of which delimiter you're using, and the user must process the data properly. This means you need specifications that identify the fields and how they should be separated. In the end, the data is likely to be imported into an Excel spreadsheet anyway.

When you provide an ASCII text file, you may have different formats for multiple records in the file. For example, you may have a header that displays a title and possibly user information that does not match the layout of the data, requiring you to identify when record formats change.

There is also the issue of delivering the file to the users. Will you use a data transfer that must be defined for each user to download the correct physical file member? Will you use File Transfer Protocol (FTP) and require a user name and password?

If you e-mail the text file, its carriage returns and line feeds might be altered during conversion through MIME format. Will you zip the file to avoid this issue, or will your e-mail application embed the text into the e-mail message and force the user to copy and paste the data from there? You could make the data available using a Web server, but if you're going to go that far, you might as well use HTML.

The bottom line is that unless you're dealing with another programmer or a power user, you will likely encounter users who resist using ASCII text files, especially given the other options available today.

PDF files are built specifically to overcome these issues. With PDF files, all that users need is a reader, and they can view any PDF file without any of the preceding concerns. PDF readers are typically free and work on most operating systems. In fact, one is probably already installed with your OS.

Even though PDFs are portable, they can be difficult to modify, which can be a good thing or a bad thing depending on your intentions.

Microsoft Excel files offer the same portability as PDF files. A free viewer available from Microsoft lets users view these files in read-only mode. And with the availability of several open-source options, you can easily create and change such files using software that is supported on most operating systems.


Usability and Standardization

Another reason to provide electronic documents is usability. When you furnish data in an Excel spreadsheet, users can easily search and sort the data, creating ad hoc reports and performing "what if" scenarios. They can also create graphical representations of the data using charts and graphs.

Last, Excel and PDF are two of the most commonly used types of data. Providing data in these standard formats makes the work of your users much easier to use and share with others.


Evolving Your RPG Development Skills

In the following chapters, we'll explore the evolution of RPG from OPM to ILE and discuss how to exploit the new capabilities of the IBM i platform. Our discussion is structured in a logical direction, first building on your existing RPG coding skills by explaining the new features available in ILE and the new concepts involved with scoping and modular coding practices.

We'll start by converting some sample OPM source to an ILE-compatible format and implementing the use of the ILE compilers. With ILE, there are some new concepts to cover that involve the binding of components and the differences between an OPM program and an ILE program. The primary objective of the book is to integrate RPG with Java, so we'll focus our efforts on capabilities that directly lead us to this goal.

Once we have the code in an ILE format, we'll begin to discuss procedures, service programs, and activation groups and why you may want to use them. For the purposes of this book, we'll look at how you can access Java objects and methods.

We'll discuss the definitions of objects and methods thoroughly in upcoming chapters. But on the simplest conceptual level, you can think of an object as being similar to a program that is called and put onto the call stack. It will be initiated to be contained in memory and will have variables initialized to specific values based on their data types.

Java methods are similar to the subroutines that are available to a mainline program. Each subroutine has a specified name and function designed to make the subroutine a reusable resource to the mainline program. Java methods are actually more like procedures because they have clearly defined parameters — one of the new ILE RPG capabilities we'll discuss. So, learning to use this new feature will also...

„Über diesen Titel“ kann sich auf eine andere Ausgabe dieses Titels beziehen.