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



Maybe I'm just lazy (oh yeah, I am), but I don't type all of that. Rather:


D myDS DS
D POQ1WB D POQ2WB D POQ3WB
D POQ LIKE(POQ1WB) overlay(myDS) D DIM(10)


Maybe putting the array definition after the individual fields makes a difference; I doubt it, but I've never run a test on that hypothesis. Assuming (for purposes of illustration) that the POQxWB fields are 1 A, then the array POQ will contain a total of 10 characters. Since the fields are defined elsewhere, POQ2WB will occupy position 2 in the data structure. By overlaying the array on top of myDS, POQ(2) contains the same value as POQ2WB.


Defining the data structure and array without length and type values is, by the way, good programming. If it is ever necessary to change the definition of the POQxWB fields, re-compiling the program (at least as regards the array definition; logic considerations may require other changes) is all that is necessary.


* Jerry C. Adams
*IBM System i5/iSeries Programmer/Analyst
B&W Wholesale Distributors, Inc.* *
voice
615.995.7024
fax
615.995.1201
email
jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx>



Scott Klement wrote:
Hi Joe,

Your fields aren't overlaying each other... so they're all in the same DS, but they're separate fields in that DS.

Try using the OVERLAY keyword.

D myDS DS
D POQ LIKE(POQ1WB) overlay(myDS:1)
D DIM(10)
D POQ1WB overlay(myDS:1)
D POQ2WB overlay(myDS:*next)
D POQ3WB overlay(myDS:*next)
D POQ4WB overlay(myDS:*next)
D POQ5WB overlay(myDS:*next)
D POQ6WB overlay(myDS:*next)
D POQ7WB overlay(myDS:*next)
D POQ8WB overlay(myDS:*next)
D POQ9WB overlay(myDS:*next)
D POQ0WB overlay(myDS:*next)


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.