02
Sat, Nov
2 New Articles

IBM's VRPG Hits the Street

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

If your training, like mine, is in traditional IBM midrange development techniques, client/server presents some challenges. For example, a graphical user interface (GUI) uses different design techniques than a green-screen, text-based application uses. Not only are client/server's visual elements foreign to most AS/400 programmers, so are the concepts of event-driven programming, and the distribution of program components between the client and the server. Even the language syntax is new-that's one of the reasons I like IBM's new VRPG product.

VRPG, officially VRPG Client/2, is a visual client/server development environment for OS/2 that has some unique benefits for AS/400 programmers. The compiler is based on the AS/400 ILE RPG compiler, which greatly reduces the issue of language syntax. I would say it eliminates the issue of language syntax-except that most AS/400 programmers are still learning ILE RPG. Fortunately, ILE RPG and VRPG are closely related to the previous generations of RPG/400; experienced AS/400 programmers will find that the learning curve is minimal. VRPG can ease you into client/server development, giving you some insight into the issues involved, even if you eventually decide to use a different set of development tools.

Because VRPG was designed specifically for the AS/400 market, it contains support for many critical AS/400 components. For example, VRPG supports a GUI subfile control that goes far beyond the list box functions delivered with a standard GUI design product. VRPG can take advantage of AS/400 file definitions to define files that are accessed in client/server applications. It integrates support for PC-to-AS/400 connectivity, making the communications link fairly transparent.

The current version of VRPG was released for general availability on December 31, 1994. It requires OS/2 (2.1 or Warp) and V3R1 of OS/400. IBM plans to develop a Windows run-time module for VRPG by the third quarter of 1995.

Sneak Preview

IBM announced VRPG on May 3, 1994, as part of the V3R1 announcement, and I was impressed with its potential (see "Visual Development Tools for RPG," MC, May 1994). In December, IBM invited the technical press to Toronto for an in-depth briefing on VRPG. At the briefing, I was able to develop an application using VRPG, to talk to the developers about their plans for the product, and to see some of the sample applications that have been developed using VRPG.

I was especially impressed by the migration examples; VRPG includes an import facility that will convert AS/400 display files to the GUI that VRPG uses. The migration facility is not designed to be a screen scraper that puts a GUI front-end on your AS/400 application. Instead, it converts the screen elements to their GUI counterparts. For example, the function keys that are defined will be converted to push buttons that you can connect to exit routines. (For more information on GUI controls, see "Graphical Controls: An Introduction" elsewhere in this issue.) The conversion is based on the information extracted from the display file definition.

As I discovered during my visit to Toronto, the only way to get a perspective on VRPG is to try it yourself. Client/server applications in general-and VRPG applications in particular-are not designed as a single monolith of code. They are built up by tying the graphical screen components to small sections of code that react to user input. All components are then bundled together during a build routine supplied as part of the development environment. To give you a perspective on how applications are built using VRPG, I'll start with an overview of the components of the development environment.

Magical Mystery Tour

Like most client/server development tools, VRPG is much more than a compiler- it's a complete development environment. Many of the components are borrowed from other IBM products-one reason IBM was able to bring this product to market so quickly. Logically, VRPG has six major elements.

o The GUI builder. o The source code editor. o Support for database connections. o PC-to-AS/400 connectivity. o The VRPG compiler. o The debugger.

All six components are built on the underlying structure of IBM's Workframe/2, which ships with VRPG and is essentially transparent to the programmer. Workframe/2 provides many facilities, such as the build utility that compiles and packages VRPG programs.

The GUI builder is where a VRPG developer spends most of his time. It is a typical OS/2 application that lets you build the user interface element of your application and attach sections of VRPG code to events. An event, in GUI terms, is any action that initiates a section of code. Most events are triggered by user input, such as clicking a mouse button, but events can also be caused by the program itself. For example, when a window is opened or closed, a corresponding event is processed by the program.

Using the GUI builder is a lot more intuitive than it sounds. Since most AS/400 programmers use PC applications, designing a GUI is essentially a matter of translating your experience as an end user into a design that adheres to accepted standards. Most of the difficulties I had with VRPG can be traced to lack of familiarity with OS/2.

1 illustrates the VRPG GUI builder with a partially built data entry window. Several controls have been placed in the window by dragging them from the palette of controls shown at the left of the screen. This component of VRPG is standard fare for client/server development tools. IBM incorporated some built-in components of OS/2 (e.g., color palette selection) into this portion of VRPG.

Figure 1 illustrates the VRPG GUI builder with a partially built data entry window. Several controls have been placed in the window by dragging them from the palette of controls shown at the left of the screen. This component of VRPG is standard fare for client/server development tools. IBM incorporated some built-in components of OS/2 (e.g., color palette selection) into this portion of VRPG.

After the window is designed, the events associated with various controls must be connected to the RPG code. VRPG uses two special opcodes-BEGACT and ENDACT-to isolate the code for an event. BEGACT and ENDACT are similar to the BEGSR and ENDSR operations except that these operations mark the beginning and end of a routine that is executed for an event.

To build the code for an event, click the right mouse button on the control, select EVENTS from the pop-up menu, and select a specific event from the list allowed for that particular control. For example, a push button control allows a "press event," but a text box control does not. As soon as an event is selected, VRPG transfers to the source code editor where the instructions that contain the BEGACT and ENDACT opcodes have already been created. All you have to do is key in the RPG source code necessary to process the event.

This is where VRPG really shines. The source code editor, based on the CODE/400 editor, includes syntax-checking capabilities and formats for RPG specifications. If you are familiar with CODE/400, you'll recognize the editor. Although in many cases the only code you will create for an event is the C- specs, you can add other program components, such as D-specs (see "An Introduction to ILE RPG: Part 2," MC, April 1994). Don't worry about linking the code to your database; that's done in a separate step. The partial code for the press event associated with the Add a Customer push button is illustrated in 2. Instinctively, an RPG programmer understands this code because the basic syntax is so familiar.

This is where VRPG really shines. The source code editor, based on the CODE/400 editor, includes syntax-checking capabilities and formats for RPG specifications. If you are familiar with CODE/400, you'll recognize the editor. Although in many cases the only code you will create for an event is the C- specs, you can add other program components, such as D-specs (see "An Introduction to ILE RPG: Part 2," MC, April 1994). Don't worry about linking the code to your database; that's done in a separate step. The partial code for the press event associated with the Add a Customer push button is illustrated in Figure 2. Instinctively, an RPG programmer understands this code because the basic syntax is so familiar.

The strangest part of developing an event-driven application is that you hardly ever see a program in its entirety. Although VRPG gives you the option to view the source code, a "complete" program is the antithesis of event-driven programming. With VRPG, you see each action (or subroutine) as it is built by joining a specific event, associated with a specific control, to a specific section of code. You can think of that one subroutine as totally self- contained. The way VRPG showed me code helped me understand the event-driven programming concepts.

Linking your program to the AS/400 database is a natural part of the design process. Just as SDA allows you to define fields based on externally defined database files, so does VRPG. Before you can reference a file definition, you must link your VRPG session to the AS/400.

VRPG currently does not require Client Access/400 (PC Support). It uses Communications Manager/2 or Communications Manager/400 to establish an Advanced Peer-to-Peer Networking (APPN) link with one or more AS/400s. Once the link is established, VRPG provides several ways to access a hierarchical list of AS/400 field definitions.

After you select the file and field reference, you can link the field to a particular control (typically a text box or a subfile column). VRPG uses the external file definition stored on the AS/400 to determine field attributes, such as character or decimal data, field length, and decimal positions. VRPG can also take advantage of any validations that are stored in the field definition.

Open for Business

When the design and the coding are complete, it's time to compile (or build) your application. Click on the icon on the toolbar and your program is compiled. The source code editor helps you find and correct any syntax errors.

The VRPG compiler is based on a compiler technology used throughout the Toronto lab-W-code. W-code is an advance on the original concept of high-level language (HLL) compilers. Most compilers have a front-end based on the language standard (e.g., COBOL, FORTRAN, or RPG) and a machine-specific back-end. W-code compilers separate these two elements. Each compiler writes to a common denominator-W-code. For each platform, there is one W-code back-end that translates the W-code into machine-specific instructions. All AS/400 ILE compilers and the newer OS/2 compilers use W-code technology.

To create the VRPG compiler, IBM used the ILE RPG compiler front-end to generate W-code and married it to the W-code back-end compiler developed for OS/2 C Set++. The only modification was the addition of several specific opcodes required for the event-driven design. Notable examples are the BEGACT and ENDACT opcodes discussed earlier.

VRPG provides a toolbar icon to test your application and a source level debugger, borrowed, like the editor, from CODE/400. This comprehensive debugging tool lets you see your code as it's executing, add and remove breakpoints with the click of a mouse button, and modify variables. If you've never used a source level debugger, you're in for a pleasant surprise. Source level debugging tools are a standard feature of many PC-based application development tools-a feature every programmer should demand.

The elements that make VRPG stand out as a choice for AS/400 developers are the familiar RPG syntax supported by the CODE/400 editor, the built-in interface to AS/400 file definitions, and the import facilities that give you a head start on converting your existing applications. Because the import facilities are the easiest way to get started with VRPG, I'll take a more detailed look at what's involved when you migrate an AS/400 application to VRPG. (In future articles, MC will provide additional details about VRPG features. We expect VRPG to become an important part of our development arsenal, and you'll find the results of our experiences in the magazine on an ongoing basis.)

Easy as...

To give you a feeling for VRPG's import function, I've chosen a simple subfile application that was published in MC several years ago (see 3). The display file contains three records-HEADER (the subfile control record containing the column headings for the subfile and the entry field used to position the subfile); DETAIL (the subfile record); and TRAILER (which displays the function key information at the bottom of the screen). I converted the display file for this application to illustrate how the VRPG import function works.

To give you a feeling for VRPG's import function, I've chosen a simple subfile application that was published in MC several years ago (see Figure 3). The display file contains three records-HEADER (the subfile control record containing the column headings for the subfile and the entry field used to position the subfile); DETAIL (the subfile record); and TRAILER (which displays the function key information at the bottom of the screen). I converted the display file for this application to illustrate how the VRPG import function works.

First, I located the display file on the AS/400 using the hierarchical library/file display shown in 4. When I selected the XRD002DF display file, VRPG listed all three records. HEADER is not available for import because VRPG does not use the concept of a subfile control record. In fact, the only record I needed to import was DETAIL. The import facility automatically incorporates the necessary components from the subfile control record. In this case, that includes the input field used to position the subfile, the column headings, and even the function keys because the valid function keys were defined at the file level in this display file.

First, I located the display file on the AS/400 using the hierarchical library/file display shown in Figure 4. When I selected the XRD002DF display file, VRPG listed all three records. HEADER is not available for import because VRPG does not use the concept of a subfile control record. In fact, the only record I needed to import was DETAIL. The import facility automatically incorporates the necessary components from the subfile control record. In this case, that includes the input field used to position the subfile, the column headings, and even the function keys because the valid function keys were defined at the file level in this display file.

The import facility creates a part for each record you import. A part, in VRPG terms, is any component of an application; it can be an entire window with multiple fields or a single pushbutton. By placing the DETAIL part in an empty window using VRPG's GUI builder, I could see the basic subfile design created by the import facility. A portion of the resulting screen is shown in 5. Some components are outside the screen window and cannot be seen in this initial view. Scrolling out to the edges of the window shows that all the subfile components are intact.

The import facility creates a part for each record you import. A part, in VRPG terms, is any component of an application; it can be an entire window with multiple fields or a single pushbutton. By placing the DETAIL part in an empty window using VRPG's GUI builder, I could see the basic subfile design created by the import facility. A portion of the resulting screen is shown in Figure 5. Some components are outside the screen window and cannot be seen in this initial view. Scrolling out to the edges of the window shows that all the subfile components are intact.

Although the basic user interface is converted, some cosmetic cleanup is required. For example, the SELECT column makes no sense in a GUI environment. This field should be deleted from the subfile as illustrated in 6. In 7, the subfile window has undergone some initial cleanup. The next step would be to write the code to display and process the subfile.

Although the basic user interface is converted, some cosmetic cleanup is required. For example, the SELECT column makes no sense in a GUI environment. This field should be deleted from the subfile as illustrated in Figure 6. In Figure 7, the subfile window has undergone some initial cleanup. The next step would be to write the code to display and process the subfile.

This application is hours (not days) from being a complete, working client/server application with logic residing on the PC, particularly if the AS/400 application is written in ILE RPG. In many cases, you can cut and paste sections of code that perform specific functions from the AS/400 application to the PC application.

A Look at the Crystal Ball

As it exists today, VRPG is a useful product for AS/400 programmers. By using a familiar language syntax, RPG programmers can get a faster start on learning the other skills needed in this new environment. If IBM follows through on the plans the developers discussed with the technical press late last year, VRPG has the potential to become an important player in the AS/400 client/server marketplace.

IBM has made a good start at providing transparent function for AS/400 developers by delivering support for field references and subfile parts. The development team intends to make VRPG a full-fledged PC tool. For example, IBM plans to allow third-party vendors to extend VRPG using a technique similar to VBX extensions for Visual Basic.

The biggest stumbling block that VRPG faces is OS/2. VRPG gave me a chance to learn more about OS/2, and I'm impressed-as I expected to be. However, an OS/2-based product in the current PC marketplace faces an uphill battle. The Toronto developers are well aware of the importance of Microsoft Windows in the desktop market, and plans are under way to create a Windows run-time version of VRPG later this year. A Windows development environment is a much larger project because so much of VRPG was created by taking advantage of existing OS/2 components. However, the Toronto developers are actively exploring ways to port VRPG to Windows.

The Final Analysis

Hundreds of client/server development tools are on the market. Choosing among them involves personal chemistry, good research, and a little bit of luck. Most shops will end up with multiple products that work together or separately, depending on the specific problem at hand.

VRPG provides some specific advantages particularly if you're just getting started with client/server. Its built-in AS/400 knowledge makes it easy to access and define your data, the familiar RPG syntax eliminates one new skill you'll have to learn, and the fully integrated package lets you get your first application up and running quickly.

Sharon Hoffman is the editor of Midrange Computing.


IBM's VRPG Hits the Street

Figure 1 VRPG GUI Builder

 UNABLE TO REPRODUCE GRAPHICS 
IBM's VRPG Hits the Street

Figure 2 Partial Push Button Press Event Code

 UNABLE TO REPRODUCE GRAPHICS 
IBM's VRPG Hits the Street

Figure 3 The Existing Subfile Application

 UNABLE TO REPRODUCE GRAPHICS 
IBM's VRPG Hits the Street

Figure 4 AS/400 Hierarchical Library/File Display

 UNABLE TO REPRODUCE GRAPHICS 
IBM's VRPG Hits the Street

Figure 5 The Imported DETAIL Record Format

 UNABLE TO REPRODUCE GRAPHICS 
IBM's VRPG Hits the Street

Figure 6 Deleting a Field From the Subfile

 UNABLE TO REPRODUCE GRAPHICS 
IBM's VRPG Hits the Street

Figure 7 The Subfile Example After Minor Cleanup

 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: