× 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 trying to load records into a MODS which I want define as having all
the fields of a particular external file with the addition of a field to
hold the RRN.  I can do this for single-row fetches, but how do I do this
for multiple-row fetches where I need to use a MODS?

<code fragment>

d JPP010        e ds                  qualified
d DS1             ds                  occurs(10)
d   RRN                         10s 0
d   JPPfields                         likeds(JPP010)

c/exec SQL
c+ declare C1 cursor for
c+   select rrn(A), A.*
c+     from JRP010 A
c+    where R1COM = :Company and R1IYR * 100 + R1IWK between
c+                  :FromIYRIWK and :ToIYRIWK
c/end-exec

c/exec SQL
c+ open C1
c/end-exec

c/exec SQL
c+ fetch from C1 for 10 rows into :DS1
c/end-exec

</code fragment>

I'm getting an SQL precompiler error stating "host structure array DS1 not
defined or not usable".  When I bypass the SQL precompiler by using
CRTBNDRPG, I get a little more info:  "LIKEDS keyword is not allowed within
a data structure that is not qualified"  I could try just defining each
field in JPP010 in the data structure, but there a lot of fields to define
and didn't want to make the code more bloated than I had to.

Has anyone tried something like this successfully?  We're on V5R2.


Ben Pforsich
Programmer Analyst
Bob Evans Farms, Inc.
I/S Department
Columbus, Ohio
Ben_Pforsich@xxxxxxxxxxxx


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.