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



moved to RPG400-l.
Please reply to RPG400-L@midrange.com

Gary,  and all,

I was the one who had the array overlay question last week that you
couldn't find in the archives - because it wasn't in midrange-l - it was in
RPG400-l.

I have another question for the group as well.  please read on....

Here is the solution I got from last week that I found seemed to be the way
to go:

 *array overlay for file fields
D $QzAmtBase      S               *   inz(%addr(QZAMT1))
D $QzAmt          S                   like(QZAMT1 ) based($QxAmtBase)
D                                      dim(12)

where QZAMT1 is the first element in the array.  $QzAmt is then your array.

this code is a little different than my example last week.   This brings me
to my question:

the technique I was told about involved having the fields described ONLY in
an external data structure 'D' spec.  I assume that the %addr technique
still works if the data is actually described by the "I"nput specs
generated by an input file?   How 'bout an output only file.  will this
technique work there as well?   if the file is UpdateFull, or IF  with file
Addition, does that create two buffer positions (and %addr) for the same
fields?  or does the RPG program store these fields in one position only,
regardless of thier use.

Thanks all,

Rick

---- original message -----
Subject: How to Define input fields into Array

Hi,

I have a file that is externally describe.  24 of the fields I need to
process
identically and I would like to process them with an array.  The array I
have
setup is:
D MEETINGS        S              5    DIM(24)

Is there an easy way to re-define the input specs to get all the fields
into the
array?  Or do I have to enter them into the array in calcs? I'm using
RPGILE
V4R4.

TIA,

Gary Kuznitz

PS:  I'd appreciate it if you could show me an example in code.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.