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



I'm having one of those day where embedded sql just does not want to
work.

I'm getting the SQL0420 error and not able to figure out what is causing
the problem. I copy the code to a test program and it works just fine.
But in the actual program it is failing with SQL0420. Any help would be
appreciated.

below are relevent variables and SQL statements:
D processThisAsgnKey...
D DS qualified
D format like(ECFMTC)
D freq like(ECFREQ)
D baud like(ECBAUD)

D mergedFileRcd...
D DS qualified
D frmCC like(PSNStr)
D toCC like(PSNEnd)
D fileType 10
D recordType 10
D lastChange 14
D rrn 15p 0

C/exec sql
C+ declare mergedFileCursor scroll cursor for
C+ select
C+ PSNStr as CCStr,
C+ PSNEnd as CCEnd,
C+ cast('CCM ' as char(10)) as fileType,
C+ cast(
C+ (case PSULJB
C+ when :@pgmNM then 'BOSS'
C+ else 'CCM'
C+ end
C+ )
C+ as char(10)) as recordType,
C+ cast(
C+ digits(PSULCY)||digits(PSULYR)||
C+ digits(PSULMO)||digits(PSULDY)||
C+ digits(PSULTM)
C+ as char(14)) as lasChange,
C+ RRN(BLCAPASPF) as "rrn"
C+
C+ from BLCAPASPF
C+
C+ where PSFreq = :processThisAsgnKey.freq and
C+ PSBaud = :processThisAsgnKey.Baud and
C+ PSNEnd >= PSNStr
C+
C+ union all
C+ select
C+ ECCPCDFrm as CCStr,
C+ ECCPCDTo as CCEnd,
C+ cast('BOSS' as char(10)) as fileType,
C+ cast('BOSS' as char(10)) as recordType,
C+ cast(
C+ replace(char(curdate(), iso), '-', '') ||
C+ replace(char(curtime(), iso), '.', '')
C+ as char(14)) as lasChange,
C+ RRN(BLCCMBPF) as "rrn"
C+
C+ from BLCCMBPF
C+
C+ where ECFreq = :processThisAsgnKey.freq and
C+ ECBaud = :processThisAsgnKey.Baud and
C+ ECCPCDTo >= ECCPCDFrm
C+
C+ order by
C+ CCStr, CCEnd

. . .
P getNextmergedFileRcd...
P B
D pi n
D piMergedFileRcd...
D likeds(mergedFileRcd)

C/exec sql
C+ fetch from mergedFileCursor
C+ into :piMergedFileRcd
C/end-exec

. . .




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.