Example: confidence

Who Knew You Could Do That with RPG IV? Modern RPG for …

RedbooksFront coverWho knew You Could Do That with RPG IV? Modern RPG for the Modern ProgrammerRich DiedrichJim DiephuisSusan GantnerJeff MinetteJon ParisKody RobinsonTim RowePaul TuohyInternational Technical Support OrganizationWho knew You Could Do That with RPG IV? Modern RPG for the Modern ProgrammerDecember 2016SG24-5402-01 Copyright International Business Machines Corporation 2000, 2016. All rights to Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Edition (December 2016)This edition applies to Version 7, Release 2, Modification 0, Technology Refresh 1 of IBM i (5770-SS1) and IBM Rational Development Studio for i (5770-WDS).

Redbooks® Rich Diedrich . Jim Diephuis Susan Gantner Jeff Minette Jon Paris. Kody Robinson. Who Knew You Could Do That with RPG IV? Modern RPG for the Modern Programmer the Modern Programmer. 1 1. 2. 3: Modern RPG programs and subprocedures. .

Tags:

  Knew

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Who Knew You Could Do That with RPG IV? Modern RPG for …

1 RedbooksFront coverWho knew You Could Do That with RPG IV? Modern RPG for the Modern ProgrammerRich DiedrichJim DiephuisSusan GantnerJeff MinetteJon ParisKody RobinsonTim RowePaul TuohyInternational Technical Support OrganizationWho knew You Could Do That with RPG IV? Modern RPG for the Modern ProgrammerDecember 2016SG24-5402-01 Copyright International Business Machines Corporation 2000, 2016. All rights to Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Edition (December 2016)This edition applies to Version 7, Release 2, Modification 0, Technology Refresh 1 of IBM i (5770-SS1) and IBM Rational Development Studio for i (5770-WDS).

2 Note: Before using this information and the product it supports, read the information in Notices on page ix. Copyright IBM Corp. 2000, 2016. All rights .. ixTrademarks ..xPreface .. xiAuthors .. xiNow you can become a published author, too! .. xivComments welcome.. xivStay connected to IBM Redbooks .. xvChapter 1. Introduction to RPG IV.. Why update this book on RPG IV now? .. Evolution of the RPG IV language .. Examples in this book are based on IBM i .. The future for RPG IV .. A future for RPG programmers .. A roadmap.. Step 1: RPG IV and RDi .. Step 2: Modularization by using ILE.

3 Step 3: Using database features.. Step 4: Modernizing the user interface .. RPG IV sources on the web .. 10 Chapter 2. Programming RPG IV with style .. Just another programming language .. RPG is free-form .. The Modern free-form RPG .. The basics of /Free coding .. Unsupported op-codes .. Op-codes that tend to produce unclear and error-prone source code .. Liberating data and file definitions .. Data declarations .. More on data definitions .. Defining prototypes and subprocedures .. Miscellaneous topics .. Moving to free-form .. Modern RPG programs and subprocedures.

4 Naming .. The names .. Case .. Special characters .. Underscore .. Named constants .. Naming conventions .. Comments .. Summary comments .. Detailed commenting .. Other commenting .. Positions 1 - 5 .. Structuring code .. 32iv Who knew You Could Do That with RPG IV? Modern RPG for the Modern Declarative code .. Executable code .. Multipath comparison .. Embedded SQL .. Using templates and qualified data structures .. Qualifying wherever possible .. Strings .. Subroutines .. Older functions .. RPG built-in indicators .. Compile-time arrays.

5 Multiple occurrence data structures .. Do not use GOTO, CABxx, or COMP .. Do not use obsolete IFxx, DOUxx, DOWxx, or WHxx opcodes .. Use SELECT, WHEN, OTHER, ENDSL for multipath comparison.. Embedded SQL.. Global definitions.. Parameters and prototyping and procedure interfaces .. Parameters .. Return value .. Copy members .. The Integrated Language Environment.. ILE programs .. Service programs .. Binding directories .. Activation groups .. 44 Chapter 3. Subprocedures.. Subprocedure terminology .. ILE modules .. Main procedure .. Built-in functions.

6 Subroutines .. Advantages of using subprocedures .. The anatomy of a subprocedure .. Subprocedure definition .. Procedure-interface definitions .. Order of coding the source elements .. Calling your subprocedures .. Moving from subroutines to subprocedures .. Why use subprocedures .. Subroutine example DATESUBR .. Transforming a subroutine to a subprocedure .. DATEMAIN1 subprocedure example .. Using subprocedures efficiently .. Using /COPY members for prototypes .. Prototype for the main procedure .. Subprocedures using subprocedures .. Using an ILE service program.

7 More on subprocedures .. The power of prototyping .. Parameter passing styles .. Using procedure pointer calls .. 72 Contents vChapter 4. An ILE guide for the RPG programmer.. Introduction to ILE .. Modules .. Service programs .. Binding: Creating programs and service programs.. Binding directories .. Service program exports .. Binder language source .. Activation groups .. CL commands used with ILE and RPG.. ILE tips for the RPG programmer .. Creating programs from modules (binding by copy) .. Binding service programs to programs .. Service programs, binder language, and signatures.

8 Using binding directories.. Activation groups .. Call stack and error handling .. Additional CL commands and useful ILE APIs .. Additional CL commands .. Some useful APIs to get information about ILE objects .. More information about ILE and shared open data paths .. 144 Chapter 5. Application programming interfaces .. Finding APIs .. C functions .. Prototype mapping example .. A more complex prototype mapping example.. POSIX interfaces.. Accessing the IFS .. IBM i system interfaces .. Standard techniques .. List objects (QUSLOBJ) API .. Creating a reusable API.

9 Making a web service .. Things to remember .. 164 Chapter 6. Database access with RPG IV.. Externalizing input and output .. What is meant by externalizing .. Putting theory into practice: An example of externalizing I/O .. Externalizing example: Overview .. Externalizing example: Separating database logic from display logic.. Externalizing example: Implementing changes.. Externalizing example: Other possibilities.. Summary.. Embedded SQL.. Rules for embedding SQL statements .. SQL preprocessor .. Error and exception handling .. Using a cursor .. An embedded SQL program example.

10 Source code for the SQLEMBED program .. Stored procedures.. Creating an external procedure .. 191vi Who knew You Could Do That with RPG IV? Modern RPG for the Modern Creating an SQL procedure .. Starting a stored procedure and returning the completion status .. A stored procedure example .. DB2 call level interface .. Differences between DB2 CLI and embedded SQL .. Writing a DB2 CLI application .. Initialization and termination .. Transaction processing .. Diagnostic tests.. Data types and data conversion .. Functions .. Introduction to a CLI example .. Trigger programs.


Related search queries