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  

preview of book RPG TnT
text of book RPG TnT


Publisher: MC Press Online
Publication Date: March 2011
Subject: Computer: Programming
Category: Programming
Number of Pages: 305

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: 9781583473641  
 Reg.: $
65.00 per N pages
 You Save: 
$15.28 (23%)
 Online  Open CopyPrint    
all time
Printed Edition   see MC Press Online    
About this title
Bob Cozzi's résumé is truly impressive: nearly 20 years of AS/400, iSeries, and System i experience; more than a decade of RPG IV development; and nearly 30 years of RPG programming. He has confronted, evaluated, and circumvented nearly every roadblock RPG programmers can experience. He not only blasts through RPG IV's shortcomings, but he also creates extensions that provide features that are simply not available in standard RPG IV.

With these 101 Dynamite Tips ‘n Techniques, Cozzi provides the solutions to dozens of technical dilemmas, gives you insights into resources formerly available only to a select few, and exposes RPG IV extensions that use his vast knowledge of System i MI instructions—all with easy-to-use wrappers that even the most inexperienced RPG IV programmer can implement. Lift the code right out of the book and into your applications! RPG TnT provides a nearly endless supply of must-have solutions and simple yet powerful RPG tips and tools.

With this book, you'll learn how to:
  • Implement an alternative to QCMDEXC
  • Use QUALIFIED and nested data structures
  • Embed compiler parameters into source members
  • Calculate end-of-month dates and day-of-week names
  • Create an auto-extend user space
  • Use C runtime functions in RPG IV
  • Use the secret ‘X' edit code to convert numeric to character
  • Improve performance when accessing user space data
  • Retrieve the function key used on a display file
  • Use EXTFILE to avoid needless overrides
  • Debug variables that have debugger command names
  • Read and encrypt save files in RPG IV
  • And a whole lot more!
About author
Robert Cozzi Jr.
Robert Cozzi, Jr., has been an RPG programmer since 1978. He is the author of several books on RPG programming, including The Modern RPG IV Language. Bob is Webmaster for the popular Web site and produces several RPG training events each year, including the annual RPG World® Conference. His production company, Crooked Jaw Productions, produces the “i5 TV” and “Shoot'n iT” podcasts.

Over the years, Bob has consistently helped System i5 and RPG IV programmers to be more productive by creating and publishing tools, tips, and techniques for their programming arsenal. Bob's original publication, Q38 Technical Journal, had the tag line “Providing the Solutions,” and with his latest writings he continues to excel in that mission. For more information, visit Bob's Web sites:,, and

1. Prototype Everything
2. Prototyping a Call to a Program
3. An Alternative to QCMDEXC
4. Subprocedure-style Entry Parameter List for Programs
5. Add NOMAIN to the Header Specification of Secondary Modules
6. Monitoring C Function Runtime Errors
7. Use PSDS to Retrieve Job Information
8. Use QUALIFIED Data Structures
9. Copy Subfields Between Qualified Data Structures
10. Nested Data Structures
11. *ALL and *ALLX ‘xx' — The Repeating Constants
12. Embed Compiler Parameters into Source Members
13. Avoid “Surprise Initialize”
14. Qualified Externally Described Files (1)
15. Qualified Externally Described Files (2)
16. Calculate the End-of-Month Date
17. Using Free-Format Comments in Fixed-Format Code
18. Get Day-of-Week Name
19. Run CL Commands from an FTP Client
20. Put Your Program to Sleep
21. Use VARYING to Improve Performance
22. Converting Numeric to Character with %CHAR
23. Converting Character to Numeric
24. Easier Text Concatenation
25. Create an Auto-Extend User Space
26. Declare Data Structures as Arrays
27. Initialize Fields to Job Date, System Date, or User Profile
28. Use C Runtime Functions in RPG
29. Compare and Ignore Case
30. Free Online Prototypes for APIs, C Functions, MI Instructions
31. Checking for Valid Dates with the TEST OpCode
32. Using the Secret ‘X' Edit Code to Convert Numeric to Character
33. %ADDR — Address of a Variable
34. Understanding API Documentation — Bin(4) Parameters
35. Understanding API Documentation — Pointer Parameters
36. Better Performance when Accessing User Space Data
37. Integer Data-types — More Efficient than Packed Decimal
38. Sending a Program Message in RPG
39. Retrieve the Function Key Used on a Display File
40. Copying More than 64k of Data
41. Use %XFOOT with %LEN
42. Use %SUBARR to Subscript Arrays
43. Use EXTFILE to Avoid Needless Overrides
44. Subprocedure Parameters Rule 1 — Default Behavior
45. Subprocedure Parameters Rule 2 — Const Parameters
46. Subprocedure Parameters Rule 3 — VARYING
47. Subprocedure Parameters Rule 4 — Optional Parameters
48. Subprocedure Parameters Rule 5 — Skipping Parameters
49. Data Structure Templates
50. Boolean Assignment
51. Creating Even-Length Packed Fields
52. Sorting Arrays with SubArrays
53. Convert between Lower- and Uppercase Letters
54. Overlapping Data Structures
55. Dynamic Arrays — Dynamically Allocated Array Elements
56. Converting Date Formats with the QWCCVDT API
57. Converting Date Formats with the CEExxxx APIs
58. Calculated Day of Week — Zeller's Congruence
59. Calculated Day of Week — API Method
60. LIKE Keyword Misbehavior — Zoned to Packed
61. Default Data-type: Not So Consistent
62. Debugging Variables that Have Debugger Command Names
63. Viewing Field Contents in Hex in Debug
64. Display the First Few Bytes During Debug
65. Display Contents of Local Variables with %LOCALVAR
66. Convert Character to Numeric — Using MI
67. Converting To and From Hexadecimal
68. Using Decimal Fields as Real-Date Values
69. Check Object Existence
70. Supporting Qualified Object Syntax
71. Explained: Bytes Provided, Bytes Available, and Bytes Returned
72. Converting to/from ASCII and Other Character Sets
73. Register an Exit Routine for a Program or Service Program
74. Specifying IFS File Names Correctly
75. Checking if IFS Files Exist
76. RC4 Encryption Using Encryption APIs
77. Writing Text to the Joblog
78. Reading Save Files with RPG IV
79. Encrypting Save Files in RPG IV
80. Global and Local Variables
81. Create Source Members Used to Create Service Programs
82. Binder Source for a Service Program
83. Create Binder Language the Easy Way
84. Linking to a Service Program from an RPG IV Program
85. Swap Bytes — Big Endian to Little Endian in RPG IV
86. Dumping the Call Stack with Qp0zDumpStack
87. Using Subprocedure Return Values
88. How Does the %EDITC (Edit Code) Built-in Function Work?
89. Solid Parameter Testing
90. Create ASCII Text Files on the IFS
91. High-level Math in RPG IV
92. Program Described Print File with Dynamic Spacing
93. Aligning or Centering Text in a Character Field
94. Debug a Batch Job
95. Find and Replace with Regular Expressions
97. Use a FOR Loop to Allow Multiple Exit Points
98. Source-level Debugger for Legacy RPG III
99. Set and Get Environment Variables from within RPG IV
100. Simple Scan with Ignore Upper/Lowercase
101. Set the CLASSPATH for Java within RPG IV
Appendix: Source Member RPGTNT in QCPYSRC
Related titles
Advanced, Integrated RPGAdvanced, Integrated RPG
Flexible Input, Dazzling Output with IBM iFlexible Input, Dazzling Output with IBM i
Free-Format RPG IV, 2nd EditionFree-Format RPG IV, 2nd Edition
Free-Format RPG IV, 3rd EditionFree-Format RPG IV, 3rd Edition
Functions in Free-Format RPG IVFunctions in Free-Format RPG IV
Programming in RPG IVProgramming in RPG IV
iSeries and AS/400 Programmer's Guide to Cool ThingsiSeries and AS/400 Programmer's Guide to Cool Things
  Special Offer Code  
Enter your Special Offer Code here:
  Search for  

  Our Products  
Browse all »»
HTML for the Business Developer
Understanding AS/400 System Operations
IBM Mainframe Security

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