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




Thank you, Scott, your assumptions are right; this is what I was trying
to do (I am not sure I understood exactly your last sentence, though: do
you suggest using a pointer or something?)

I will start studying and using what Birgitta and Jon advised: array DS.
Hopefully I will make it works.


Florin Todor


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Monday, September 27, 2010 1:16 PM
To: RPG programming on the IBM i / System i
Subject: Re: MODS Likerec

Hi Florin,

the problem with LIKEREC is that it implicitly qualifies the fieldnames.

I'm assuming you are doing something like this:

D MyMods ds occurs(9999)
D likerec(myRecFmt:*input)

Therefore, you'll have fields named

MyMods.field1
MyMods.field2
..etc..

And file reads will go into

field1
field2
..etc..

And since these are different field names from the ones in your DS,
there's nothing "automagic" going on. If you want the fields to be the
same, stop using LIKEREC. Alternately, read directly into the DS
instead of expecting the fields to match on the I-spec.



On 9/27/2010 10:26 AM, Florin Todor - YYZ Concord wrote:
Before posting this question I hesitated a lot, because I know it is
something basic for most of you; unfortunately I couldn't find the
answer myself, so please help!

This is the idea: I have a subfile populated by the user. I want to
insert some records between already existed records if some criteria
is
met. My idea was to read the entire subfile and to save it to a MODS
defined with LIKEREC(the subfile record name), clear the subfile and
repopulated it one by one record (reading MODS) and inserting, when
needed, the new subfile records.

My problem is I cannot retrieve the MODS. I do an %OCCUR(mods-name) =
1
and a WRITE the subfile record. In this moment, I thought the subfile
is
automagically populated because they have the same field names... but
it's not!

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.