10th International Rexx Symposium May 3-5 1999 Jacksonville, Florida, USA Sponsored by the Rexx Language Association Using Rexx to Publish Mainframe Reports to the Web by Nash R. Radovanovic www.bgdsoftware.com/rexxsym ![]() Copyright © 1998, 1999. All Rights Reserved. |
I N D E X
Introduction Powered by Rexx     Powered by Rexx? Do not be surprised if you see more of these in years to come. In the land where once ruled Perl, Tcl, Python and other server-side scripting languages, the landscape has changed. In the world of large servers, Solaris, HP-UX and UTS, move on, make some space, OS390 is coming. What is common among all these server side, scripting languages ? They are more or less popular especially among the UNIX developer community and web site administrators. All of these very powerful tools are not easy to learn, but easy to copy and modify enough to do some basic tasks, like mail forms and access counters. They are tightly integrated with UNIX operating system but with limited support for large scale database access. CGI scripts are not multi-threaded, therefore performance and scalability are known issues. New kid on the block comes from Java shops in a form of Java servlets. Applets that run within a web server. Main characteristic is that Java servlets are platform independent and provide for multi threading. They also provide database connectivity through JDBC. They are web server dependent and their performance and scalability are still to be proven. Java is still a new and non-native environment. Java is platform independent and because of that does not integrate easily with underlying operating system. Each vendor has their own set of tools that integrate their products with the outside world. Some examples are ORACLE's PL/SQL and LutuScript. These tools are proprietary, vendor and platform dependent. They are geared toward integration of single-vendor line of products and can be very hard to deploy and use enterprise wide. Eating the cake and having it too ? Yes, with OS390 UNIX services you can take the advantage of S390 platform and architecture and at the same time reuse the knowledge base and strengths of UNIX. Mainframe ? Dead ? Mainframes are not dead. We finally realized that processing power, reliability, availability and security of the mainframe should be used in a new way. So, the mainframe Rexx survived as well, but the process changed its nature. For the better. It just went through the metamorphosis from an obscure, system programmers' magic tool to main stream, mainframe-server, scripting powerhouse. There is really no need to explain these pillars of S390 success. S390 provides unparalleled performance that is still unmatched by other vendors. S390 provides stabile, predictable and tunable large scale environment. 99% of uptime is standard in S390 shops, not something that is being set as an optimistic objective year after year. S390 remains the environment that provides the most flexible, adequate level of security for all users and resources. It can be as secure as one needs it to be without affecting productivity.
Opportunity Use IT or Lose IT All the technology in the world is worth nothing if it is not applied to real life problems. Common wisdom ? Not so. Many people in IT industry take a long time to realize that. They do not teach this at school, and it is so easy to get caught in the "IT for the purpose of IT" catch-22. This is where experience counts. The more levels of IT that you work on, more industries that you get involved with, more business users that you talk to, the closer you come to understand your own purpose. I have found my purpose through my experience during past twelve years. I have worked with number of life, health, property and casualty insurance companies, banks and investment brokerages, power utilities, human resources, manufacturing, travel and telecom corporations. In all my experience with various clients, I have noticed that financial industry clients, tend to have the huge amounts of data being printed daily. Forest after forest. Ecologist or not, just vast amount of printed paper and effort associated with distributing it in a large organization has always been amazing to me. Not to mention the nightmares of recipients that are just to begin when they need to search and locate information in huge piles. Yes, it was the 70's approach that lives even today. The architecture of the Information Systems of the 70's left us with legacy of almost every information worth anything being printed. At the time when the computers were considered to be an innovation and a change to the business process on a grand scale, it was understandable why all the paper "interfaces" had to be built. Simply, to integrate new computer systems with existing workflow it was necessary to do so. This legacy that still lives today can be characterized with data redundancy, data inaccuracy due to manual re-keying of data, manual data filtering and searching and various other potential bottlenecks in the business process. Any justification of such a process today, would be unimaginable. Today, we have networks that are meant to be the backbones of our business. To carry the information from department to department and from employee to employee. Paper should be used as one of the media for communication with the customer, not to convey information through the business workflow. So, when you think of a network, an ultimate network of all networks, the one that exists today and not in the years to come, the one that is affordable and reliable, that can provide your company with a backbone for world wide operations, you think of Internet. Internet represents the media for fast, cost-effective data distribution. Internet is accessible anywhere in the world where telephone line exists. Internet uses standard transport protocol, which enables all clients, wherever they are in the world to talk the same electronic language. Internet can be as secure and private as you need it to be. And last but not least, as claimed by the creators, Internet was designed to be able to survive nuclear war grade damages to the network. What can I add ? Let's use it. Number of companies already do. Books, magazines, manuals and tutorials are all being published on-line on a regular basis. Some of the mentioned documents are being published only in "soft" copy. Distribution ease and immediate delivery have driven the demand for this method. Now if you just combine that with mainframe processing power... just let your imagination free.
Printout Scraping Printout what ? Well, if you can do the "screen scraping" by creating new screens without touching underlying applications, why wouldn't you be able to replace printout layout without changing anything in the report generation process? Screen scraping is a well known paradigm. Printout scraping is similar process, except easier to set up and use. Printout scraping provides immediate benefits with no transition period. It causes minimal disturbance to existing workflow. It is absolutely non exclusive, meaning that it can peacefully co-exist at the same time with current workflow with minimal overhead. KISS or Keep It Simple Stupid is a famous American saying and even that it sounds funny it should be taken seriously. Simple things do work. Period. Complex things may work. If a simple thing breaks it is easy to fix or replace. Complex things are, er, well, complex. So, some examples of simple approaches to printout scraping are publishing of mainframe report files as plain text files just converted to ASCII or converting them to plain HTML. No bells, no whistles. Remember to focus on the fact that the business has been functioning for years based on paper. So what else does the business need apart from the raw information ? Hardly anything if we are talking about business continuation. If your project objective is to keep the same workload but to decrease cost of delivery, the simplest solution will be the best. There is no need to overdo IT. But, simplification can have some rather costly ramifications, too. For example, one simple solution would be to try to implement a "new" architecture by changing all mainframe based source code to write out HTML output. Simple ? Right ? Yes, but imagine implementation nightmare of trying to change 20-30 year old code just for the sake of changing output records. In some companies, you'd wish for year 2000 to come again. One other, "simple" idea that would definitely drive you towards the dangerous grounds is an attempt to develop a "simple" program that will convert your documents from proprietary formats (such as AFP or Documerge) to PDF. Not just that it would be hard to develop, but maintenance and support would prove to be enough to drive everyone crazy. So, the simple, but not simplistic, is the solution.
Our Solution The Solution Our solution uses Rexx scripts that intercept and convert existing mainframe data/reports from plain text to HTML code, and automatically publish the HTML to web server. What a simple solution ! Yes, all the years of legacy reporting should not go to waste. There was a lot of hard work and time devoted to it. What could be simpler than just "printout scraping". And best of all, the conversion from text to HTML is the same for each report, so you can standardize your HTML layout to include company logo, address, product photo and anything else that you might think of. Why Rexx, you ask ? Simple answer. Rexx is the best tool for the task. It is well integrated with OS to make it easy to determine input file DCB characteristics, capture system output from JES class, interface with ftp and so on. At the same time, Rexx remains simple, readable, easy to learn and program, language. Rexx script parses through the report and formats it with pre-defined HTML tags, while obeying FBA, carriage control characters and splitting the report into pages. When it finishes formatting and splitting, it creates an Index page with links to all report pages. Each page has a link to previous and next page to provide for easy navigation. In the last step, Rexx invokes ftp to publish the report to your web server. This web server can be either a separate NT or UNIX box or it can be just the "other" side of your OS390 machine. All recipients that would normally be receiving printed report would have access to it through the corporate intranet. By utilizing this solution, your company or your client will gain the ability to centrally store and manage the reports. You will eliminate the need for huge printouts, double data-entering, microfiche storage, remote printing, etc. At the same time, you will cut the distribution time from days to seconds. Access to old reports will be instant as opposed to days required to order re-print of a report. Your business will emerge from an old fashioned, slow response, 20th century organization to modern, agile and responsive 21st century enterprise.
Case Study International insurance company example Departments analyze the report and re-enter key figures as input into their own programs. Whenever they need a historical report, they have either to seek it on a microfiche or to request a reprint from systems department, which can take several days. This server can be accessed via corporate LAN at head office and via WAN from overseas offices. All departments that would normally be receiving printed report now access it through the network. The company saved close to $100,000 per year in printing and distribution costs. The savings resulting in streamlining of the business process, faster turnaround time and other intangible benefits were not quantified.
Demo Architecture This architecture is represented through: Strengths Weaknesses Here's the description of all three logical layers. Note that Tier 2 and Tier 3 both "live" on S390 box: Strengths Weaknesses Application     This stand alone demo uses Javascript to simulate 3270 screens and programs behind it. It has no real functionality and works with static data. UNIX server based DEMO that can be found on our web site (http://www.bgdsoftware.com) is running Perl CGI to simulate back end Rexx execution.
Real application (MAINFRAME/Web Reports) runs Rexx scripts on S390. All this shows you the potential for creativity and should hilight the fact that there are no miracle tools, but just the appropriate tools for the appropriate tasks. Always try to put all available tools in perspective and use the best tool or combination of tools to achieve your goals.
Resources Free Rexx samples Download Statistics for 1998 Server www.bgdsoftware.com Free Rexx samples download Notice about the author Nash has been in the IT industry since 1988 working on various platforms with dozens of clients. Nash believes that only technology that makes a business difference for your client is the technology that is worth the investment.
Page 2
![]()
Page 3
Page 4

Scheduled batch job is changed to send a copy of the report to JES output class X (or some other, dedicated class) instead of printing it. After the report is sent to output class, our Rexx script is being run to capture the report and convert it.
Scheduled batch job creates the file that is later on being sent to printer. After the job creates the file Rexx script is being run to convert the files content.
Page 5

International insurance company prints thousands of pages of agents sales data each week. 1200 agents and independent brokers have their pages printed. The 1500+ page report goes to various departments, including Agency Services, Human Resources, Payroll, Accounting, Marketing and other. Some of the departments are in the head office, while regional offices, agents and brokers are worldwide. Each week, scheduled batch job runs and prints eight copies of this report at the home office. These copies are then being distributed to all departments. Two extra copies are being sent through dedicated channels to remote printers in UK and Hong-Kong. Additional 10 copies of microfiche are being produced for departments archive and distributed from home office.
Batch jobs changed to print to specific, dedicated output class. Rexx scripts installed and running on a scheduled basis after batch jobs, against dedicated output class and converting output to HTML. Converted reports being sent via ftp to an NT server.
Page 6


![]()
Page 7
