MC Press Online
Welcome to the MC Press Online!
Need help with our eBooks?
Contact PublishersRow.com
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

Author:
Publisher: MC Press Online
Publication Date: Jun-2013
Subject: PROGRAMMING: RPG
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  
$45.87
 
 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.

Contents
CONTENTS
Preface to the Second Edition
A Note About Source Entry

Chapter 1: Pre–Free-Format RPG IV
RPG IV
  Extended Factor 2
  Built-in Functions
  Subprocedures
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
  Indenting
  Use of Comments
  No Goto Operations
  Conclusions
A “Modern” Programming Style
  Free-Format RPG IV and C
  Free-Format RPG IV and Java
  Conclusions
Being “Current”
  The Programmer's Perspective
  Management's Perspective
  Conclusions
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
  Evaluate
  If
  Controlled Looping
  Mathematics
  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
  %Eof
  %Found
  %Error
  %Equal
  Data Area Input
Database Output
  Write
  Update
  Delete
  Except
Workstation I/O
  Write/Read
  Write
  Read
  ICF I/O
  Dsply
Printer Output
  Overflow Indicator
  Write
  Except

Chapter 5: Program Flow Using Free Format
The If Group
  If
  Else
  Elseif
  Endif
The Do Operations
  Do While
  Do Until
  Dow and Dou Differences
  For
Loop Interrupt
  Leave
  Iter
The Select Group
  Select
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
  Substringing
  Replace
  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
  Exponentiation
  Precedence
  Mathematical Expressions Elsewhere
Eval Differences in Fixed and Free Format
  Naming Variables
  Semicolon
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
  Value
  Const
  Options(*NoPass)
  Options(*Omit)
  Options(*Varsize)
  Options(*String)
  Options(*RightAdj)
  Options(*Trim)
The Return Operation
  Subprocedures
Accessing APIs
  API Examples

Chapter 10: Solutions for Problem Situations
Solution for the Fixed-Format MoveA Operation
  History
  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
Index

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
RPG TnTRPG TnT
Subfiles in Free-Format RPGSubfiles in Free-Format RPG
 
  Special Offer Code  
Enter your Special Offer Code here:
  Search for  

  Our Products  
Browse all »»
DB2 11: The Ultimate Database for Cloud, Analytics & Mobile
DB2 10 for z/OS Database Administration (Exam 612), Chapter 08: Recovery and Restarts
Enterprise Web 2.0 with EGL

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