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