× 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.



What is your CCSID (source vs job)? I've seen some weird things with embedded SQL related to CCSID. If you change that to a host variable, does it compile?

This compile parm helps with CCSID, but I'm pretty sure it's 7.3 only.
COMPILEOPT('TGTCCSID(*JOB)')



-----Original Message-----
From: Mark Murphy [mailto:jmarkmurphy@xxxxxxxxx]
Sent: Friday, May 25, 2018 1:18 PM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Odd Compile Error in SQLRPGLE Precompiler

I have this SQL statement embedded in RPGLE:

exec sql
declare C3 cursor for
select coalesce(g.ggpcd, 'OTHER') as ggpcd,
sum(case
when g.ggpcd = 'PROG' then
coalesce(p.lepoehr, 0)
else
0 <===
end) as lepoehr,
sum(case
when r.micno < 9000
and r.micno not in (8027,8028,8056,8061,8118,8010,8131)
then
r.repoh + (r.reunh * r.rqtdu) + r.reseh
else
r.reunh * r.rqtdu
end) as rtdhrs
from jcrwmp r
join jcoprf o
on (o.oprtn = r.ropcd)
or (o.oprtn = 'QCMI' and r.ropcd = 'PRGCM')
left outer join jcopgf g
on g.ggpcd = o.ogpcd
and g.gstat = 'A'
and g.gqstp = 'Y'
left outer join jcprgdlep p
on p.lejobyr = r.jobyr
and p.lejobno = r.jobno
and p.ledgpno = r.dgpno
and p.lerstep = r.rstep
where r.jobyr = :job.jobyr and r.jobno = :job.jobno
group by g.ggpcd;

I know it has compiled in the past as the program is in production. But now I am trying to compile it under 7.1 with most recent PTF's, and it is giving me an RNF0308 at the "<===". apparently it thinks that one of the e's in the vecinity is supposed to be a float literal, but none of them are formatted properly hence the RNF0308. If I enclose the 0 in quotes like this '0', it compiles properly. Interestingly, SQuirreL returns the correct output whether I leave the 0 plain, or enclose it in quotes.


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.