MC Press Online
Welcome to the MC Press Online!
Need help with our eBooks?
Click here, to go to our main store

  MC Press Online eBookStore  

Free-Format RPG IV, 2nd Edition
preview of book Free-Format RPG IV, 2nd Edition
text of book Free-Format RPG IV, 2nd Edition

Free-Format RPG IV, 2nd Edition

Publisher: MC Press Online
Publication Date: Jun-2013
Category: Programming
Number of Pages: 225

Free Preview    Email to Friend   Add to wish list
 Available as: (for format`s description click on its name)
Individual E-Version (PDF) Individual E-Version (PDF) ISBN: :978-1-58347-347-4  
 Reg.: $
59.95 per N pages
 You Save: 
$14.08 (23%)
 Online  Open CopyPrint    
all time
Printed Edition   see MC Press Online    
About this title
Traditional fixed-format RPG 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—which is both a learning tool and handy reference guide—provides concise and thorough information to help you learn this powerful way of coding RPG IV.

Although free-format information is available in IBM manuals, it is mixed in with everything else, 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 will 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 modern 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.

In the second edition, this programming classic has been updated to V7.1 of the IBM i operating system on IBM Power. A new chapter shows the new way to code embedded SQL in free format. Throughout the book, updates have been made and paragraphs added that describe new techniques available for source program entry (LPEX editor in IBM RDp) and other items that have occurred in the years since the first edition.

Free format is the future of the RPG language, and knowing this method is quickly becoming a “must” for all RPG programmers. This book gives you the tools you need to upgrade your programming skills and bring your RPG programs into the 21st century.

Upon completion of Free-Format RPG IV, you will be able to:
  • Transition easily from fixed format to the free-format style of coding RPG IV
  • Know how to handle embedded SQL coding in free format
  • Possess a handy, easy-to-read reference guide for free-format coding
  • Understand that the free-format style is the future direction of the RPG language
  • Use this book as a learning tool to upgrade your programming skills and career opportunities
About author
Jim Martin
Jim Martin holds a BS degree in mathematics and an MS in computer science. For 26 years, he was employed by IBM, where he wrote RPG applications for customers and worked in the programming laboratory as a programmer on portions of CPF and the OS/400 operating system. After leaving IBM, Jim took post-graduate work in computer science and performed RPG training. He is an IBM-certified RPG IV developer and author of the bestselling first and second editions of Free-Format RPG IV, which, since the book's initial publication in 2005, have taught thousands of RPG IV programmers how to be successful with the free-format coding style.

Preface to the Second Edition
A Note About Source Entry

Chapter 1: Pre–Free-Format RPG IV
  Extended Factor 2
  Built-in Functions
Other Changes
Some “Baggage” That Came Along
The Future

Chapter 2: The Case for Free-Format RPG
Easier to Read and Maintain
  Good Field Naming
  Use of Comments
  No Goto Operations
A “Modern” Programming Style
  Free-Format RPG IV and C
  Free-Format RPG IV and Java
Being “Current”
  The Programmer's Perspective
  Management's Perspective
Check It Out

Chapter 3: Introducing Free-Format RPG IV
The Free-Format Code Block
  Coding Free-Format Operations
  Naming Variables
  Programming Style
  A Note About Case
Free-Format Operation Codes
  Controlled Looping
  Character Strings
Programming Style Issues
  Mixing Formats
  Keyed Access
  Named Indicators
  Naming File Indicators
Summing Up

Chapter 4: Input/Output Using Free Format
Database Input
  Data Area Input
Database Output
Workstation I/O
Printer Output
  Overflow Indicator

Chapter 5: Program Flow Using Free Format
The If Group
The Do Operations
  Do While
  Do Until
  Dow and Dou Differences
Loop Interrupt
The Select Group
Operations Absent in Free Format

Chapter 6: Embedded SQL Operations Using Free Format
Database and Embedded SQL
  Fixed-Format Method
  Free-Format Method

Chapter 7: Data-Manipulation Operations Using Free Format
Assignment Statements
  Eval Operation: Numeric
  Eval Operation: Character
  Evaluate Right (EvalR) Operation
  Eval Operation: IS,OC
  Evaluate vs. Move
Built-in Functions
  Converting Decimal to Character
  Converting Character to Packed Decimal
  Scan and Replace
  Concatenation and Trim
  Converting Character to Integer
  Extracting Size, Length, and Decimal Positions
  Number of Elements
  Looking for Something?
  String Translation
  Combining Built-in Functions
Date and Time Operations
  Converting Numbers to Date and Time
  Converting Date and Time to Character or Decimal
  Date and Time Arithmetic

Chapter 8: Math Operations in Free Format
Expressions in Assignment Statements and Elsewhere
  Four-Function Math
  Short-Form Math
  Mathematical Expressions Elsewhere
Eval Differences in Fixed and Free Format
  Naming Variables
Free-Format Math in RPG IV
  Numeric Data Types
  Changing Data Type

Chapter 9: Call and Return in Free Format
Call Prototyped (CallP) Operation
  Dynamic Call
  Bound Call
Parameter-Passing Options
The Return Operation
Accessing APIs
  API Examples

Chapter 10: Solutions for Problem Situations
Solution for the Fixed-Format MoveA Operation
  The Free-Format Solution
  The %Subarr Built-in Function
Solution for the Fixed-Format Move Operation
  Breaking It Down
  When Both Fields Are Character
  Data Type Differences
Solution for the Fixed-Format MoveL Operation
  Breaking It Down
  When Both Fields Are Character
Solution for the Case Operation
Solution for the Do Operation
  The Do Syntax
The   Free-Format Solution
Error-Handling Techniques
  The Monitor Solution
  ILE Exception Handler

Chapter 11: Sample Programs
An Investment and Loan Utility Program
A Customer Inquiry Program
A Customer Data Entry Program
A Sales Report Program

Appendix A: Free-Format Operations
Appendix B: Example Screens, DDS, and Programs
Appendix C: Free-Format Alternatives for Fixed-Format Operations

Related titles
Functions in Free-Format RPG IVFunctions in Free-Format RPG IV
Mastering IBM iMastering IBM i
Programming in RPG IVProgramming in RPG IV
Subfiles in Free-Format RPGSubfiles in Free-Format RPG
  Special Offer Code  
Enter your Special Offer Code here:
  Search for  

  Our Products  
Browse all »»
Mastering IBM i
System i Disaster Recovery Planning
Developing Web 2.0 Applications with EGL for IBM i

If download option is selected, Adobe Acrobat 5.0 or later is required to read our e-books*

Windows PC, Mac OS9/OSX, and Linux