13
Wed, Nov
5 New Articles

Visual Development Tools for RPG

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Brief: Two major AS/400 vendors (IBM and ASNA) have announced plans to release visual development tools for RPG programmers. This article looks at some of the general design principles behind these products and specific plans for each vendor's product.

At present, AS/400 programmers in search of development tools for client/server applications are faced with a dilemma-learn a new programming language or use the PC as a front-end to AS/400 programs by emulating a 5250 data stream. Both approaches have major drawbacks, so I was excited to learn about two upcoming products that address this situation.

o Amalgamated Software of North America (ASNA) has announced a product called Visual RPG which builds on the popularity of Microsoft's Visual Basic product.

o IBM has announced a similar product, IBM AS/400 VRPG Client/2 (VRPG). (At some pre-announce demos the product was billed as Visual Development Environment for RPG.)

Both products should be released by late 1994, although neither company has announced specific dates. Extensive technology previews were shown to attendees at recent trade shows. The IBM and ASNA developers interviewed for this article provided demonstrations and information about their plans.

Programming Principles

If you think visual RPG is an oxymoron, these products will surprise you. Both ASNA's and IBM's products use a point-and-click interface to design the interactive, PC portion of an application. The resulting applications are fully compliant with Windows or OS/2 and include standard graphical user interface (GUI) elements such as scroll bars, buttons for mouse input and list boxes.

These products differ from other PC visual development tools when it's time to create the underlying program logic. A GUI lets the developer focus on the section of code he wants to work on. The big surprise is the code itself- standard RPG code with special op codes to handle GUI events. (See Figures 1 and 2.) As you can see from the illustrations accompanying this article, the RPG code is readily understood by any RPG programmer. The advantage of this should be obvious-although you'll need to learn some new design techniques, you won't need to struggle with new language syntax at the same time.

Both products can potentially be used to develop stand-alone PC applications. Access to AS/400 data is supported directly for op codes such as CHAIN, READ and WRITE. They are not intended for batch processing, although future releases may provide interfaces to host-based batch programs.

The largest issue facing developers who want to use these products is the question of event-driven programming. Central to GUI applications, event-driven programming is based on the idea that the user will control the sequence of screens presented. This is quite different from a traditional AS/400 program which presents a data entry panel and waits for input. The easiest way I've found to understand this is to relate it to the underlying principle of an interrupt.

Almost every computing process is interrupt-driven. For example, your program will continue to process until it needs data from disk. Then it issues an interrupt requesting the necessary data. Conversely, your program may be interrupted because its time slice expires or because a program of higher priority requires CPU resources. In either case, the system software which supports disk access and controls which programs can use the CPU is in a wait state until some event occurs-a disk request, a time-out or some other event. Application programs that use the event-driven model act like the system software-they are in a wait state until some event (initiated by a user rather than another program) interrupts them. For example, a user clicks a mouse button to open a new window.

I believe that as we begin to develop applications using the new visual programming environments, we will discover that event-driven programming is a non-issue. Because the tools are designed to support this style of programming, you will almost be forced to look at your program from the perspective of events. In the demos I saw, the progression from event to action was very natural. I'll take you on a short, guided tour of both products; when the products are released later this year, Midrange Computing will bring you more in-depth coverage.

ASNA's Visual RPG

To develop an application using ASNA's Visual RPG, a programmer begins with a blank form. Think of a form as a panel or, more precisely, a window displayed within the Microsoft Windows environment. The first task involves placing fields, constants and other controls such as graphs in the form. This has similarities to designing a panel using SDA except that fields are placed using a mouse and selected from a tool bar. Controls include items such as scroll bars and input buttons that the user can select using a mouse. The programmer can define specific properties such as colors and fonts for any portion of the form.

The next step is to write RPG subroutines to handle each specific event. For example, when the user clicks on a button labeled "Add Customer," you want to display an input window to collect detailed information about the customer. To build the application, the programmer double clicks on the Add Customer button. Visual RPG presents a portion of RPG code which initially contains only a BEGSR and an ENDSR op code. You can insert code to determine the next available customer number, display a blank customer entry form and provide any default values for the customer.

This process continues for each possible event, with each subroutine being a stand-alone portion of code. Variables can be defined locally for each event without affecting any other part of the application. Other variables and files can be shared by all the subroutines within a form.

Before the entire application can be assembled, you will have to write a small portion of code that defines global files and variables to be used and the initial form to be displayed. This section of code is considered the main program; each form has its own separate subprogram and each event within the form has a separate subroutine.

In most cases, the user will have complete control over the order windows are opened and closed. For example, he can open a customer master list, open three windows with information about specific customers and then open another window to display orders for a fourth customer. Each of the three windows for specific customer information will load a separate copy of the same form. (See 3 for a typical application.)

In most cases, the user will have complete control over the order windows are opened and closed. For example, he can open a customer master list, open three windows with information about specific customers and then open another window to display orders for a fourth customer. Each of the three windows for specific customer information will load a separate copy of the same form. (See Figure 3 for a typical application.)

ASNA hopes that this visual development environment will give programmers the best of two very different worlds. The ability to deliver GUI applications without an immense investment in Windows coding techniques and access to data using familiar RPG/400 op codes.

Visual RPG is stored in free-format and may be edited using any PC editor. The editor supplied with Visual RPG gives programmers a choice between free-format or a spreadsheet-like editor. The latter maintains the fixed format of RPG but lets the programmer set the width of each column. (See 1.) An integrated debugger and migration tools are included in the Visual RPG package.

Visual RPG is stored in free-format and may be edited using any PC editor. The editor supplied with Visual RPG gives programmers a choice between free-format or a spreadsheet-like editor. The latter maintains the fixed format of RPG but lets the programmer set the width of each column. (See Figure 1.) An integrated debugger and migration tools are included in the Visual RPG package.

Visual RPG can take advantage of a number of existing PC products. ASNA's DataGate is included with Visual RPG and provides access to the AS/400 database and other hosts such as Windows NT or UNIX platforms. Programs written in Visual RPG will also be able to take advantage of the vast library of Visual Basic Custom Controls (VBX controls) available from Microsoft and other vendors. VBX controls can be used to add specific functions such as video and audio output to any application. By taking advantage of a recognized standard, ASNA gives Visual RPG programmers immediate access to a broad spectrum of third-party products.

ASNA's Visual RPG is written in C++ and modeled after Microsoft's Visual Basic. ASNA's philosophy is to provide AS/400 programmers with an intuitive interface to event-driven programming.

IBM's VRPG Client/2

The greatest difference between ASNA's Visual RPG and IBM's VRPG is that VRPG is an OS/2 development environment. According to IBM, future versions of VRPG will probably support Windows as a run-time environment, but the first release will not contain this support.

VRPG consists of two components: the GUI builder and the RPG compiler. The RPG compiler is based on AS/400 ILE RPG, due for release later this year. Because all the ILE compilers have a common back-end (see "The Integrated Language Environment," MC, May 1993), the developers were able to use front-end portions of the AS/400 ILE RPG compiler and back-end portions of the OS/2 C++ compiler to implement ILE RPG on the PC.

The VRPG developers also took advantage of other OS/2 products to reduce the amount of new programming required to bring VRPG to market. For example, the editor provided with VRPG is the same editor used for CODE/400, and help screens use standard OS/2 help facilities. The OS/2 Workplace Shell provides functions to control colors, fonts and other screen properties (see 4).

The VRPG developers also took advantage of other OS/2 products to reduce the amount of new programming required to bring VRPG to market. For example, the editor provided with VRPG is the same editor used for CODE/400, and help screens use standard OS/2 help facilities. The OS/2 Workplace Shell provides functions to control colors, fonts and other screen properties (see Figure 4).

VRPG includes built-in communications to support AS/400 database access and several extensions to RPG. For example, the BEGACT and ENDACT op codes are used to mark the beginning and end of a subroutine associated with an event or an action. The %SETATR and %GETATR functions are used to examine and control GUI attributes such as colors and fonts.

In general, the development cycle is similar to any visual development tool and correlates closely with what I've described for ASNA's product. The programmer builds a window using icons and a mouse to place fields, constants and other controls; an RPG subroutine is written for each possible event in the window; and a main program displays the initial window and defines the global files and variables. In most cases, the user has complete control over which windows are open and how many copies of a window are open at a time.

IBM will provide a number of tools to work with applications developed in VRPG. For example, a function browser lets the programmer view the relationships between windows, controls, events and actions (subroutines); an import facility creates a skeleton GUI application based on existing AS/400 applications; and the OS/2 interactive debugger can be used on VRPG programs.

By taking advantage of many existing OS/2 tools, IBM makes it easy to add extensions to VRPG. For example, IBM will provide functions written in C++ for input buttons, scroll bars and other GUI controls. Additional controls could be created by the applications programmer or possibly purchased from other vendors in the future.

Choices for the Future

IBM's VRPG and ASNA's Visual RPG give AS/400 RPG programmers access to GUI development tools without sacrificing their investment in RPG skills. These products deserve serious consideration from any AS/400 shop considering client/server options. At press time, neither company had announced specific delivery dates or pricing but I would expect to see ASNA's and IBM's products on the market by late 1994. Pricing will surely be competitive with other PC- based development tools. Look for more in-depth coverage in future issues of MC.

ASNA: 800-321-2762 IBM: Contact your local representative Sharon Hoffman is the editor of Midrange Computing.


Visual Development Tools for RPG

Figure 1 ASNA's Visual RPG

 UNABLE TO REPRODUCE GRAPHICS 
Visual Development Tools for RPG

Figure 2 IBM's VRPG Client/2

 UNABLE TO REPRODUCE GRAPHICS 
Visual Development Tools for RPG

Figure 3 A typical Visual RPG application

 UNABLE TO REPRODUCE GRAPHICS 
Visual Development Tools for RPG

Figure 4 VRPG gives programmers control of screen propertie

 UNABLE TO REPRODUCE GRAPHICS 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: