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




On 10/08/2010, at 2:27 PM, Booth Martin wrote:

FFILEA if e k disk
D RecordDS ds LikeRec(FILEAF)

Good grief, I hate to embarrass myself this way, but I will ask. Better
to learn, I guess.

I read a record from FILEA. In debug the record's fields are populated
with data. How do I get the data into RecordDS so I can use it? I
just assumed it would be there automagically, but that was a bad assumption.

I wasn't going to respond to this because I saw later appends that seemed to answer it ... but since then I've seen some that just confused the issue ... or are in the class of "I do this and it works but I don't know why" which are basically a waste of space.

Anyway, your problem is that LIKEREC creates a qualified data structure thus the names in the data structure are different from the names in the file. Therefore RPG does not automatically populate the DS.

You have two solutions:

1) Read the file **INTO** that data structure if you are on a release that supports that ability for an externally-described file.

2) Ensure the DS field names match the file field names. There are a number of ways to do this:

a) Use an externally described data structure (E DS plus EXTNAME)
b) Creative use of PREFIX on the F-spec

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




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.