Why move to Free-Form RPG?



Similar documents
Advantages of PML as an iseries Web Development Language

2 SQL in iseries Navigator

Rational Developer for IBM i (RDi) Introduction to RDi

What's New in ADP Reporting?

Base Conversion written by Cathy Saxton

Adobe Conversion Settings in Word. Section 508: Why comply?

Hypercosm. Studio.

2Creating Reports: Basic Techniques. Chapter

What's New in BarTender 2016

How to test and debug an ASP.NET application

Liaison EDI Notepad. Intuitive Views. envelope, group, or transaction node from the left pane, EDI Notepad displays its details in the right pane.

Website Development Komodo Editor and HTML Intro

Whitepaper - WebSphere Development Studio for iseries V5R2

Using Mail Merge in Microsoft Word 2003

Microsoft Migrating to Word 2010 from Word 2003

Installing C++ compiler for CSc212 Data Structures

The 5 New Realities of Server Monitoring

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

IBM Rational Developer for i. Maintain an ILE RPG application using Remote System Explorer Edit, Compile, and Debug

ACCESSING IBM iseries (AS/400) DB2 IN SSIS

Welcome to the topic on Master Data and Documents.

Using Microsoft Word's "track changes" editing feature: a short guide for authors and editors

quick start guide A Quick Start Guide inflow Support GET STARTED WITH INFLOW

PT AVENUE GUIDE OVERVIEW

Keep it Simple... 7 Transformation-based Development (2013 and Beyond)...7 Less Customization and More Innovation...8 Time to Market...

COMMON All Day Lab 10/16/2007 Hands on VB.net and ASP.Net for iseries Developers

BlueJ Teamwork Tutorial

Become A Paperless Company In Less Than 90 Days

Excel macros made easy

Lab 4.4 Secret Messages: Indexing, Arrays, and Iteration

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

THE SME S GUIDE TO COST-EFFECTIVE WEBSITE MARKETING

The VB development environment

Tune That SQL for Supercharged DB2 Performance! Craig S. Mullins, Corporate Technologist, NEON Enterprise Software, Inc.

CMS Training Session 1

Using VLOOKUP to Combine Data in Microsoft Excel

Microsoft Word Level 3

PharmaSUG Paper QT26

Designing a Graphical User Interface

PDF Primer PDF. White Paper

Lab 1: Introduction to C, ASCII ART and the Linux Command Line Environment

IBM s Rational software

FileMaker 14. ODBC and JDBC Guide

Web Portal User Guide. Version 6.0

Microsoft Migrating to PowerPoint 2010 from PowerPoint 2003

Focus on Essay Writing

Javadoc like technical documentation for CAPRI

File by OCR Manual. Updated December 9, 2008

Creating trouble-free numbering in Microsoft Word

SECTION 5: Finalizing Your Workbook

Test Generator. Creating Tests

<Insert Picture Here> What's New in NetBeans IDE 7.2

ADOBE DREAMWEAVER CS3 DESIGN, DEVELOP, AND MAINTAIN STANDARDS-BASED WEBSITES AND APPLICATIONS

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

Introduction to Microsoft OneNote

FileMaker 11. ODBC and JDBC Guide

CSE 308. Coding Conventions. Reference

TIA Portal vs Studio 5000

Parameter Fields and Prompts. chapter

Repetition Using the End of File Condition

A Sample OFBiz application implementing remote access via RMI and SOAP Table of contents

USER GUIDE. PowerMailChimp CRM 2011

About XML in InDesign

Configuring and Integrating Oracle

Driving Reuse in the Supply Chain

Section 1.4 Place Value Systems of Numeration in Other Bases

Single Mailbox Recovery 7.0 Administrative Server Administration Guide

WHAT S NEW IN MS EXCEL 2013

Reading and Taking Notes on Scholarly Journal Articles

Introduction to Eclipse

My Oracle Support Portal

Aspen Gradebook - Teacher

Access to a unified real-time solution enables your company to make informed decisions and maximize profitability.

Planning a Successful Visual Basic 6.0 to.net Migration: 8 Proven Tips

Understanding the IEC Programming Languages

Q&As: Microsoft Excel 2013: Chapter 2

Buying vs. Building Business Analytics. A decision resource for technology and product teams

Advantage of Jquery: T his file is downloaded from

Chapter 28: Expanding Web Studio

Microsoft Office Project Standard 2007 Project Professional April February 2006

Programming in Access VBA

Creating Mailing Lables in IBM Cognos 8 Report Studio

ebay Module for PrestaShop Seller guide

Performance Tuning with Oracle Enterprise Manager Session # S300610

Explore commands on the ribbon Each ribbon has groups, and each group has a set of related commands.

VIDA ADMIN HELP CONTENTS

High performance ETL Benchmark

1Steps to a Successful Core Vendor Evaluation & Selection

Linear Motion and Assembly Technologies Pneumatics Service. Understanding the IEC Programming Languages

Online Bulletin Boards An Introduction

Brock University Content Management System Training Guide

RemoteWare Software Manager

Developing and Implementing Windows-Based Applications With Microsoft Visual C#.NET and Microsoft Visual Studio.NET

Creating tables of contents and figures in Word 2013

Week 2 Practical Objects and Turtles

IT Governance In The Cloud: Building A Solution Using Salesforce.com

Organizing & Editing Digital Photos

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper

Word basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

Transcription:

Why move to Free-Form RPG? The free-form coding style has been available for RPG IV since IBM released V5R1 in the spring of 2001. Since that time, Linoma has used the free-form syntax extensively for in-house development. Based on positive feedback from our developers and well-known experts in the RPG community, we are highly recommending the RPG free-form syntax to our customers. We believe that the free-form syntax is a big improvement to the RPG language and has many productivity advantages. Developers are finally no longer bound by the fixed columns of traditional RPG calculations. Now you can simply enter your RPG logic in a natural left-to-right fashion, similar to the coding style in other modern languages (i.e. Java and Visual Basic). While the free-form syntax only is allowed in the area where C specifications are normally entered, it is definitely a huge step in the right direction. To give you a better understanding of why we are recommending the free-form RPG style, we have compiled a list of benefits we believe it offers over traditional fixed-format syntax: 1. Nested logic can be indented 2. Source code can be entered faster 3. More room to enter long expressions 4. Right-hand comments can immediately follow the logic 5. Free-form will cohabitate with fixed format specs 6. Growing number of source examples only in free-form 7. IBM is focusing its resources on free-form RPG 8. Easier to learn for newcomers 9. Enhances your career These benefits are detailed in the following pages. If you elect to use the free-form style, any existing RPG IV development processes (ie change control) should remain unaffected since the source member type and program behavior will not change. IBM s RPG compiler is intelligent enough to determine the difference between free-form and fixed-format specifications, so you can continue to compile your RPG IV programs as you always have. We believe there is only two reasons why you may not want to code in the free-form style. The first reason is if you have to deploy your programs to an OS/400 release lower than V5R1 since free-form RPG is only supported in V5R1 and higher. The second reason is if you depend on a field cross reference tool that does not recognize the free-form syntax yet (check with your vendor). Otherwise you will be well served by exploring this much-improved coding style. Once you re convinced that the free-form RPG style is right for your organization, we recommend using our RPG Toolbox product to convert your existing RPG logic into this new style. The Toolbox can be downloaded at www.linomasoftware.com. Besides bringing your source code up-to-date with the latest style and methods available, Linoma s RPG Toolbox will also help you easily learn the free-form syntax by simply reviewing your source code before and after the conversion. With Linoma s RPG Toolbox, you can additionally use our new SEU line commands and source code snippets to easily create, maintain and indent free-form RPG logic. Page 1

Free-Form Benefit # 1 Nested logic can be indented Understanding and maintaining nested logic can be very difficult in fixed-format RPG, especially when the logic is nested several levels deep. Trying to keep track of which logic is associated with which IF, ELSE and DO statements can be very time consuming. For example, try to quickly comprehend the logic in the following fixed-format example. If Test = 3 Eval Work = A + B If Work = 1 Eval A = A + 1 Else If Work = 2 Eval B = B + 1 EndIf EndIf Eval C = C 1 Else Return EndIf The above logic is hard to follow, even though it s nested only 3 levels deep. Unfortunately its columnbound nature does not make it easy to trace the logic. You may be tempted to print this example out and use a pencil to draw lines between the IF, ELSE and ENDIF statements for a better understanding. What if this same example was coded in the free-form RPG style: If Test = 3; Work = A + B; If Work = 1; A = A + 1; Else; If Work = 2; B = B + 1; EndIf; EndIf; C = C 1; Else; Return; EndIf; As you should see from the above free-form example, the power of indenting source makes the free-form logic easier to understand than its fixed-format equivalent. An RPG program will typically have a good deal of nested logic within it. By using the power of indenting nested logic within free-form RPG, your productivity will be greatly enhanced when analyzing and maintaining applications. Page 2

Free-Form Benefit # 2 Source code can be entered faster Instead of being concerned with entering operation codes and variables into the correct columns with fixed-format C specifications, the free-form style allows you to enter source in a natural left-to-right fashion. Just insert a new line and start keying your logic! As an added bonus to the free-form style, you don t need to key in the EVAL or CALLP when assigning values or calling procedures. These operation codes are assumed. Fixed-Format: Eval CallP Work = A + B Process(Work) Free-Form: Work = A + B; Process(Work); As an interesting exercise, we ve added up the number keystrokes it takes to enter one EVAL statement using both styles. For instance, to enter an EVAL statement using a fixed-format C specification within IBM s SEU source editor, a developer will most likely enter the following keystrokes: 1) Key in IPCX on a sequence number and press Enter to prompt (5 keystrokes) 2) Tab to the operation code column (3 keystrokes) 3) Enter the word EVAL into the operation code column (4 keystrokes) 4) Tab to the extended factor 2 column (1 keystroke) 5) Key in the expression 6) Press the Enter key (1 keystroke) Not considering the keystrokes to enter the expression itself, a single EVAL statement would require 14 keystrokes in fixed-format RPG. What if you keyed the same expression in free-form RPG: 1) Key in an I on a sequence number and press Enter to insert a new line (2 keystrokes) 2) Key in the expression without the proceeding EVAL since it is assumed 3) Key in a semicolon to end the expression (1 keystroke) 4) Press the Enter key (1 keystroke) Again, not considering the keystrokes to enter the expression itself, it would take only 4 keystrokes to enter the same line in the free-form style. Compared with the fixed-format example, you would save 10 keystrokes when entering this one line of logic. Considering the hundreds of lines of code entered into a typical RPG program, the total keystrokes saved using the free-form style could be significant. Less keystrokes equals more productivity. Page 3

Free-Form Benefit # 3 More room to enter long expressions In fixed-format RPG, there are 45 characters available in the extended factor 2 area. If your expression extends beyond 45 characters in a C specification, then you have to create a new continuation line to key in the remainder. However using the free-form style, you can enter up to 73 characters of an expression per line. Fixed-Format: Eval MailLabel = Name + Address1 + Address2 + City + State + Zip Free-Form: MailLabel = Name + Address1 + Address2 + City + State + Zip; By having more room for long expressions in the free-form coding style, the number of lines needed in your RPG program will be reduced and your expressions will be easier to read and maintain. Free-Form Benefit # 4 Right-hand comments can immediately follow the logic Using fixed-format RPG, right-hand comments must start in position 80. If your source file is 112 bytes in length, then you have only 20 characters of comment area. This narrow comment area will often force you to greatly abbreviate your comment text. Example: Eval Work = A + B rpt. total NE+IA Additional problems with traditional right-hand comments are: 1) You have to waste keystrokes in tabbing to the correct column to enter the comment 2) If your display session is set to a width of 80 columns, then you can t see the right-hand comments unless you window to the right 3) The excessive blank space between your logic and the right-hand comment may make it difficult to associate the two together (depending on the quality of your eyesight) These problems can be eliminated when coding in the free-form style since you can immediately follow your logic with comments using the // notation (this is the same notation used in Java). Notice below how much clearer the unabbreviated free-form comment is. Work = A + B; // report total for Nebraska and Iowa Since comments can be appended to your free-form logic, then more comment text can be entered. Free-form comments will also be visible within 80 column screens (if you don t go too far) and they will be easier to associate with your logic. Instead of inserting your detailed comments above your logic, this same-line approach for free-form comments will keep your source at a reasonable number of lines while making it just as readable and maintainable. Page 4

Free-Form Benefit # 5 Free-form will cohabitate with fixed format specs While it s generally recommended to have all of your calculation logic in either all fixed-format or all freeform style (for consistency and readability), the RPG compiler will allow you to easily intermix the two styles within the same program. You simply need to start your free-form logic with the /FREE tag and end it with the /END-FREE tag. Example: C MOVEA WORKA WORKB /FREE A = A + 1; B = B 1; /END-FREE Since almost every operation in fixed-format RPG has an equivalent free-form operation or built-infunction, then undoubtedly we believe 99+% of your calculation logic can be in the free-form style. The exceptions include only a handful of unique operations, such as the MOVEA (move array) operation. We re confident that IBM will address these few remaining fixed-format operations in future releases. Free-Form Benefit # 6 Growing number of source examples only in Free-Form If you re similar to most RPG developers, you ve learned a portion of your RPG techniques by reviewing code examples in IBM manuals, independent books and articles. Since free-form has been available for a couple years now (as of this writing), most of the RPG authors are now writing their books and articles in this style. You will also begin to notice that more-and-more downloadable RPG source code is in the free-form style. If you don t understand free-form RPG, then it will be difficult for you to take advantage these new RPG examples and downloadable source code. Free-Form Benefit # 7 IBM is focusing its resources on Free-form RPG IBM is attempting to shed the iseries stereotype as a legacy machine. This is evidenced by the somewhat recent iseries support of WebSphere, Java and other modern technologies. Since RPG is the predominant 3GL language on the iseries, we believe IBM thinks the free-form RPG syntax will also help give the iseries a more positive image in the I.T. industry. To modernize applications on the iseries and to keep skeptical customers from moving to another platform, we believe IBM is eager for more developers to move into the modern free-form RPG style. In V5R2, you can now retrieve records from a file using multiple keys without using a KLIST (key list). You can simply enter the multiple key fields within the CHAIN or READE operation. However this feature is only available in the free-form style. We believe that IBM will continue to add new techniques and operations, as illustrated in this example, which only work in the free-form style. Page 5

Free-Form Benefit # 8 Easier to learn for newcomers Most schools are training their students in free-form languages such as C, Java and Visual Basic. If you would like to bring junior-level developers into your shop, they will probably not be very excited about coding in a restrictive column-oriented language. The free-form style will help RPG trainees be more comfortable with the language since it will closely resemble the syntax they learned in school. On the other side of this equation, if experienced RPG developers are also performing some Java development, even hard-core fixed-format RPG developers will find it more productive to switch back and forth between the Java syntax and the free-form RPG style. Free-Form Benefit # 9 Enhances your career Besides the personal satisfaction of learning new technology, it is also important to remember that accumulating new skills will help ensure a long-term career in I.T. Failure to keep skills updated can lead to a static or downward career path. For existing RPG IV developers, the free-form style will only take a few days to learn. It s an excellent investment of time, considering the amount of return you ll receive. Page 6