enskill.com iSeries Training Onsite classes
DVD training
Books
Online e-Learning
Home
Resources
Contact
(c)2002-2008

Bryan's RPG IV Journal


Prototype Problem with LIKE

Q. I'm trying to replace the *ENTRY PLIST with a prototype, so I can use CALLP and free format. But I'm running into a problem with the LIKE keyword. Here's my prototype:

D Dispatch        PR                   Extpgm('REZ517')
D                                 5U 0

D                                      Like(Availstatus)

The compiler is giving me the following error: "LIKE not allowed with specified Field-Location entries; keyword is ignored."

If I code a parameter name, the error disappears; but I thought the parameter names in the prototype were just for documentation. Why do the other unnamed fields work, and why does the LIKE keyword not work?

A. It's true that the prototype parameter names primarily serve a documentary purpose. But in this case, without a field length entry, you need a "separator" to help the compiler distinguish between the two parameters. Otherwise, the compiler will think that there is only one parameter, on two lines (i.e., it will treat the LIKE keyword as a continuation of the first parameter). Naming the LIKE parameter will provide the necessary degree of separation:

D Dispatch        PR                   Extpgm('REZ517')
D   Reservation                   5U 0

D   Availability                       Like(Availstatus)

The same requirement holds true for LIKEREC and LIKEDS keywords in a prototype.


Log of Journal Entries

Use this scrollable blog map to view other journal entries:
Journal Home
It is your responsibility to ensure procedures, techniques, and code used from this website are accurate and appropriate for your installation. No warranty or support is implied or expressed.
E-mail to Bryan Meyers
Privacy and Email Policy
 
AS/400®, eServer, i5/OS, IBM i, Integrated Language Environment®, iSeries, OS/400®, RPG/400®, System i5, VisualAge®, and WebSphere® are trademarks of IBM Corporation. Note: IBM® System i is the latest member of the family of eServer iSeries. This site might refer to System i as System i5, iSeries, or AS/400.
 

If you are having trouble navigating the menu at the top of this page, you may use the following scrollable site map instead:
 

Self-paced DVD Training
DVD: RPG IV for RPG Programmers
DVD: RPG IV Modules, Procedures, and Service Programs
 
In association with Amazon.com
Programming in RPG IV
RPG IV Jump Start
Power Tips for RPG IV
Control Language Programming for the AS/400
VisualAge for RPG by Example
 
International visitors: click hereInternational visitors:
Click here!