Books by Bryan Meyers

Programming in RPG IV

Control Language Programming for IBM i

RPG IV Jump Start

Power Tips for RPG IV

VisualAge for RPG by Example

 
Frequently Asked Questions


Defining a Data Area Data Structure Print E-mail

Q. What is the best way using D-specs to define a data area, where I want to get the value from the data area and never lock the data area? We use a data area to hold an encryption key. Other programmers are using the old *DTAARA DEFINE, directly followed by an UNLOCK because they say the D-specs can't handle it without locking the data area. Is there a better way?

Read more ... Defining a Data Area Data Structure
 
Replacing *ENTRY PLIST with a Prototype Print E-mail

Q. I am trying to find the /Free replacement for the *ENTRY PLIST. The conversion tool in WDSc doesn't touch this code. Is it possible to do this in /Free code?

Read more ... Replacing *ENTRY PLIST with a Prototype
 
Using %DEC to Convert Character to Numeric Print E-mail

Q. In your December 2004 article, "10 Cool Things About RPG IV," I could not get the %XLATE('$*,':' ':Amount) line to work. Testing the %XLATE with constant fields and stepping through it, I found the $ would be replaced by a space, but the asterisk and comma were left in. The only way it would work was to do three %Xlate functions - removing only one of the characters at a time. Did I do something wrong?

Read more ... Using %DEC to Convert Character to Numeric
 
Embedded SQL Using a Cursor Print E-mail

Q. I've decided to start using embedded SQL in my RPG programs, but I have a question. When I embed a SELECT statement which would normally return more than one record from a file, the RPG program only gets a single record. Is there a way to "wrap" the SELECT statement inside a loop, so that I can process all the records in the SELECT statement?

Read more ... Embedded SQL Using a Cursor
 
Free Format Alternatives to TIME Print E-mail

Q. In fixed format RPG IV, I used the TIME operation code to get the current date and time; but TIME is not supported by free format. You mentioned that the %DATE, %TIME, and %TIMESTAMP functions can replace TIME, but I'm not sure how to use them for this purpose.

Read more ... Free Format Alternatives to TIME
 
Free Format Alternatives to MOVE Print E-mail

Q. I've been trying to convert a series of RPG IV programs to free format, but I've been very frustrated, because free format doesn't support the MOVE operation. I don't want to switch back and forth between fixed format and free format (the result is ugly). What can I do? Is there an easy alternative?

Read more ... Free Format Alternatives to MOVE
 
Dynamic Memory Allocation and Arrays Print E-mail

Q. How do I declare an array with a dynamic number of elements?

Read more ... Dynamic Memory Allocation and Arrays
 
<< Start < Prev 1 2 3 4 5 6 Next > End >>

Page 1 of 6