Q: I am writing procedures to look up and return names and so forth, based on a customer number that is passed in. Here's my problem: When I define the procedure interface, I want to define the return value with LIKE so that if the field definition changes all I have to do is recompile the programs. Otherwise, I have to go in and change the hardcoded return lengths. Can I use LIKE or something similar so that I don't have to modify the code for file changes?
I've tried LIKE and the compiler says "not expecting a return value for procedure." I copied a working procedure and prototype and then changed to LIKE, so I'm pretty sure I have everything-besides the LIKE part-defined correctly.
A: If I understand your problem, you have a procedure called, say, RtvName defined as in Figure 6, and you would like to use it as shown in Figure 7. To replace the 50A definition with LIKE(CustName), an alternative approach is to define RtvName as illustrated in Figure 8. Then, use RtvName as seen in Figure 9.
- John V. Thompson
Figure 6: Procedure RtvName
D RtvName PI 50A
D Cust# 7P 0 value C eval CustName = RtvName(Cust#)
D RtvName PI
D CustName@ * value
Figure 7: The way you want to use RtvName
Figure 8: An alternative method of defining RtvName
D Cust# 7P 0 value *
* Local variables
D Name S like(CustName) based(CustName@)
C callp RtvName(%addr(CustName):Cust#)
Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.
IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn:
LATEST COMMENTS
MC Press Online