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



Vern -

Good point, and I generally agree with the statement you made below, but in this case I know that the client will never upgrade their JDE software to a newer version, and these fields have always been contiguous within the F0902 record, so I'm not concerned about any file changes. We are currently in the process of converting everything to SAP...

-sjl


"Vernon Hamberg" wrote in message news:mailman.18042.1363104039.10847.rpg400-l@xxxxxxxxxxxx...

Hi Steve

I had used this approach - basing an array on a pointer to the first of
several fields.

However, I've gone away from that. Apparently, there is no guarantee
that the fields will be in the order you expect. So IF it has worked,
this is an accident.

Another DS with the field names in the order you want, and with the
array overlaying them, and no data definitions, forces the fields to be
contiguous, so far as RPG is concerned.

Now maybe the LIKEREC also takes care of this.

I'm doing this from foggy memory, BTW - I think Jon Paris has some
articles on this.

HTH
Vern

On 3/12/2013 10:35 AM, TheBorg wrote:
This is not posed as a question which *I* need to have answered; Instead,
it is posed as a way of sharing techniques with one another.

There are several ways for defining an array over a a group of fields coming
from a file. Which one do *you* use?

Example below...

-sjl


Example:

*----------------------------------
* Excerpt from F0902 DDS:
*----------------------------------

A R I0902
[...]
A GBAN01 R REFFLD(AN01 F98FRFA)
A GBAN02 R REFFLD(AN02 F98FRFA)
A GBAN03 R REFFLD(AN03 F98FRFA)
A GBAN04 R REFFLD(AN04 F98FRFA)
A GBAN05 R REFFLD(AN05 F98FRFA)
A GBAN06 R REFFLD(AN06 F98FRFA)
A GBAN07 R REFFLD(AN07 F98FRFA)
A GBAN08 R REFFLD(AN08 F98FRFA)
A GBAN09 R REFFLD(AN09 F98FRFA)
A GBAN10 R REFFLD(AN10 F98FRFA)
A GBAN11 R REFFLD(AN11 F98FRFA)
A GBAN12 R REFFLD(AN12 F98FRFA)
A GBAN13 R REFFLD(AN13 F98FRFA)
A GBAN14 R REFFLD(AN14 F98FRFA)
[...]

// Program Code snippet...



FF0902 IF E K DISK USROPN



D ds0902in ds likerec( I0902 : *INPUT )

d GBAN s like( ds0902in.GBAN01 )

d dim( 14 )

d Based( ptrGBAN )

d ptrGBAN...

d s * inz (%Addr(
ds0902in.gban01 ))

/Free



Open F0902;

Read I0902 DS0902in;

Close F0902;



*INLR = *On;

Return;



/End-Free;







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.