O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Free-Format RPG IV

Book Description

What could be more important than upgrading your RPG skills? Traditional fixed-format style RPG IV programmers everywhere are embracing the increased productivity, better readability, and easier program maintenance that comes with the free-format style of programming in RPG IV. This book, a "how-to" guide and the first of its kind, will provide you with concise and thorough information on this powerful new way of coding RPG IV.

Though free-format information is available in IBM manuals, it is not separated from everything else, thereby requiring hours of tedious research to track down the information you need. With this book, your search is over. Free-Format RPG IV is the "one-stop" resource that will save you time and frustration. In it, you'll find everything you need to know to write RPG IV in the free-format style.

Author Jim Martin not only teaches rules and syntax, but also explains how this new style of coding has the potential to improve overall programmer productivity—from initial development through maintenance. He methodically covers the "how to" involved in free-format RPG IV, including many style issues, such as named indicators and built-in functions. He also addresses input and output, program flow, data manipulation, and math operations. There is even a chapter on prototyping and APIs.

Free-Format RPG IV is the definitive guide on the topic and just what you need to get started with this exciting, powerful style of programming.

With Free-Format RPG IV you will:

- Learn not only the "how-to," but also the "why" of free-format RPG IV

- Acquire essential, free-format style tips to help you write good, maintainable code

- Find complete-program solutions for specific problems, including associated display and printer files

- Discover how upgrading your RPG skills to free-format can take your programming career to the next level.

Table of Contents

  1. Copyright
  2. Acknowledgments
  3. Pre–Free-Format RPG IV
    1. RPG IV
    2. Some “Baggage” That Came Along
    3. The Future
  4. Introducing Free-Format RPG IV
    1. The Free-Format Code Block
    2. Free-Format Operation Codes
    3. Programming Style Issues
    4. Summing Up
  5. Input/Output Using Free Format
    1. Database Input
    2. Database Output
    3. Workstation I/O
    4. Printer Output
  6. Program Flow Using Free Format
    1. The IF Group
    2. The Do Operations
    3. Loop Interrupt
    4. Select Group
    5. Operations Absent in Free Format
  7. Data-Manipulation Operations Using Free Format
    1. Assignment Statements
    2. Built-in Functions
    3. Date and Time Operations
  8. Math Operations in Free Format
    1. Expressions in Assignment Statements and Elsewhere
    2. Eval Differences in Fixed and Free Format
    3. Free-Format Math in RPG IV
  9. Call and Return in Free Format
    1. Call Prototyped (CallP) Operation
    2. Parameter-Passing Options
    3. The Return Operation
    4. Accessing APIs
  10. Solutions for Problem Situations
    1. Solution for the Fixed-Format MoveA Operation
    2. Solution for the Fixed-Format Move Operation
    3. Solution for the Fixed-Format MoveL Operation
    4. Solution for the Case Operation
    5. Solution for the Do Operation
    6. Error-Handling Techniques
    7. The Monitor Solution
  11. The Case for Free-Format RPG
    1. Easier to Read and Maintain
    2. A “Modern” Programming Style
    3. Being “Current”
    4. Check It Out
  12. Sample Programs
    1. An Investment and Loan Utility Program
    2. A Customer Inquiry Program
    3. A Customer Data Entry Program
    4. A Sales Report Program
  13. Free-Format Operations
    1. Expression Operators
    2. Operation Extenders
    3. Free-Format Operations
  14. Additional Elements Used by the Sample Programs
    1. Investment and Loan Utility Program
    2. Customer Inquiry Program
    3. Customer Data Entry Program
    4. Sales Report Program
  15. Free-Format Alternatives for Fixed-Format Operations