× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Defining a return variable like a procedure name is possible within pure
RPG, but the SQL precompiler won't accept it.
As someone already suggested, define Rtn LIKE(SFCLB2CTmp.Lbl) and it should
work.

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von darren@xxxxxxxxx
Gesendet: Wednesday, 09. September 2009 18:35
An: midrange-RPG RPG message board
Betreff: Precompiler doesn't like the LIKE


I have the following subprocedure, at OS level V6.1. The precompiler
chokes, saying that 'Rtn' is not defined, or not usable. RPGLE seems to
have no trouble, as I've defined return values like this before, just never
a variable used as a host variable in an SQL statement. Is this just a
Pre-Compiler shortfall, or is there something I'm doing incorrectly?



D $GetLblMod PR LIKE(SFCLB2Ctmp.LBL)
D InCust LIKE(ECLtmp.LCUST) CONST
D InShip LIKE(ECLtmp.LSHIP) CONST
D OPTIONS(*NOPASS)
....
....
....
P $GetLblMod B
D $GetLblMod PI LIKE(SFCLB2Ctmp.LBL)
D InCust LIKE(ECLtmp.LCUST) CONST
D InShip LIKE(ECLtmp.LSHIP) CONST
D OPTIONS(*NOPASS)
D*-------------------
D Rtn S like($GetLblMod)
D Ship S like(ECLtmp.LSHIP)

/FREE

if %parms>=2;
Ship=InShip;
endif;

exec sql
select LBL into :Rtn
from SFCLB2C
where ID='ID'
and Cust=:InCust
and (Ship=:Ship or Ship=0)
order by Ship desc
fetch first row only;

RETURN Rtn;

/END-FREE
P $GetLblMod E


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.