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



Again... troubles with the dreaded "variable not usable"

I have the following **FREE format RPG :

**free

dcl-ctl option(*noshowcpy : *noexpdds : *srcstmt : *nodebugio);


dcl-ds REC extname(KO17FEXPRC);
end-ds;

dcl-s prcid packed(10:0);


exec sql
select max(PRCID17) into :prcid from KO17FEXPRC;

exec sql
declare sqlcur cursor for
select * from KO17FEXPRC
where EXCHID17 = 106 and INSTID17 = 4
and DATEFROM17 >= '2018-01-01' and DATEFROM17 <= '2018-09-30'
for read only;

exec sql
open sqlcur;

exec sql
fetch sqlcur into :REC;

dow (SQLCOD <> 100 and SQLCOD >= 0);

prcid += 1;
PRCID17 = prcid;
INSTID17 = 101;
insert into KO17FEXPRC values(:REC);

exec sql
fetch sqlcur into :REC;

enddo;

return;


The SQL compiler complains for the two fetch statements that REC is
undefined or unusable.
I get this error all of the time it's ot funny anymore.
Is this because it's **free RPG or .....???

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.