|
D ArSfl ds
D ARRAY DIM(300)
D ArField1 like(Field1) OVERLAY(ARRAY:1)
D ArField2 like(Field2) OVERLAY(ARRAY:*NEXT)
D ArField3 like(Field3) OVERLAY(ARRAY:*NEXT)
D ArField4 like(Field4) OVERLAY(ARRAY:*NEXT)
D ArField5 like(Field5) OVERLAY(ARRAY:*NEXT)
D ArField6 like(Field6) OVERLAY(ARRAY:*NEXT)
D ArField7 like(Field7) OVERLAY(ARRAY:*NEXT)
I understand and use this form of sorting data (from the reference
manual):
*...1....+....2....+....3....+....4....+....5....+....6....+....7...+....
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++
* In this example, the base array has the values aa44 bb33 cc22 dd11
* so the overlaid array ARRO has the values 44 33 22 11.
*D DS
D ARR 4 DIM(4) ASCEND
D ARRO 2 OVERLAY(ARR:3)
D*
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
C====
* After the SORTA operation, the base array has the values
* dd11 cc22 bb33 aa44
*C
C SORTA ARRO*
===========================================================================
list
But I am thinking I should be learning about Qualified data structures.
D ArSfl ds qualified
D ArField1 like(Field1) dim(300)
D ArField2 like(Field2) dim(300)
D ArField3 like(Field3) dim(300)
D ArField4 like(Field4) dim(300)
D ArField5 like(Field5) dim(300)
D ArField6 like(Field6) dim(300)
D ArField7 like(Field7) dim(300)
If I do:
sorta ArSfl.ArField4
will the other 6 fields be sorted too, and not corrupt my data?
(Any other comments about this are more than welcome. Something is
making me think I am wandering too far astray.)
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
Geen virus gevonden in het binnenkomende-bericht.
Gecontroleerd door AVG - www.avg.com
Versie: 9.0.851 / Virusdatabase: 271.1.1/3064 - datum van uitgifte:
08/11/10 08:34:00
As an Amazon Associate we earn from qualifying purchases.
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.