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



Thanks Dennis, I am trying that right now...


Florin Todor



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dennis Lovelady
Sent: Monday, September 27, 2010 2:43 PM
To: 'RPG programming on the IBM i / System i'
Subject: RE: MODS Likerec

You get that error when your input and output fields don't match each other,
and/or you try to use the *INPUT DS with an output operation, et cetera.

If you are at 6.1 or greater, eval-cor may provide your easiest solution, if
not the most favorable.

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
Light travels faster than sound. This is why some people appear bright until
you hear them speak.


Tried that, Stu, it doesn't work; the compiler coughs:

"*RNF7701 20 1 The data structure is not allowed for the
operation."




Thank you


Florin Todor



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

Dang, just re-looked at your source.

When you read the subfile, you are reading it directly to the mods
structure
(see Chain).

When you write it, you ought to do the same thing, as in:

write R010D02 ds_det;

Stu


On Mon, Sep 27, 2010 at 12:09, Stuart Rowe <rowestu@xxxxxxxxx> wrote:


The issue arises from using likerec(). That keyword always qualifies
all
subfield names, that's why it's not "automagical". Screen field
FIELD1 is
not the same as ds_det.FIELD1.

I'd think the easiest for you to do is hand-code a DS with the screen
field
names (do NOT use likerec for this), then repeatedly move the "input"
data
structure (whatever you end up using, mods or array data structure)
to the
structure with the screen fields in it.

screenStructure = ds_det;

or

screenStructure = ds_det( index );

Or something like that. Perhaps someone has a slicker method, but
this'll
work. I can't remember if you could "prefix" the screen field names
with
"ds_det." and make them match. Not near a compiler.


Stu





On Mon, Sep 27, 2010 at 11:27, Florin Todor - YYZ Concord <
ftodor@xxxxxxxxxxxxxxxx> wrote:

Birgitta, I can do that but does this solve my problem? Because, at
first
sight, the only difference is I will use an array index instead
of %occur
BIF to retrieve the DS values; under the covers, is it not the same
idea
like MODS?


Thank you


Florin Todor



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx]
On Behalf Of Birgitta Hauser
Sent: Monday, September 27, 2010 12:13 PM
To: 'RPG programming on the IBM i / System i'
Subject: AW: MODS Likerec

Why do you want to use a MODS, why not defining an Array Data
Structure?

D MYDS DS Dim(12345)
D MyRec LikeRec(MyRecord)

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars."
(Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not
training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx]
Im
Auftrag von Tom Huff
Gesendet: Monday, 27. September 2010 18:02
An: 'RPG programming on the IBM i / System i'
Betreff: RE: MODS Likerec

Try creating another subfile and read from one and write to another
and
then
back to the original with the records inserted on one of the passes.

Tom

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx
]
On Behalf Of Florin Todor - YYZ Concord
Sent: Monday, September 27, 2010 10:26 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: MODS Likerec

Hello everyone,



Before posting this question I hesitated a lot, because I know it is
something basic for most of you; unfortunatelly 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!





Thank you





Florin Todor



<mailto:ftodor@xxxxxxxxxxxxxxxx>



--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.