The answer is yes and quite easy. Read this from Jon Paris and Susan Gartner. http://168.215.71.17/ME2/Audiences/d...A9843497F7FDB7
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Sort Array in RPG
Collapse
X
-
Sort Array in RPG
sanjivtannu1 wrote: > > In my RPG program I am creating 2 array, one with Code value (4 char) and another corresponding array with counts/totals for these Codes. > > I use lookup & add to elements of these arrays. With this the Code values are NOT in sorted order. > > Is there a way I can have these Codes sorted, and there corresponding array element move likewise ? > Define the arrays like this: D DS D info dim(100) D codes 4A overlay(info:*next) D counts 7P 3 overlay(info:*next) Now, codes and counts are both arrays. Since they both overlay the "info" array, if you sort one of them (say codes) it will cause the other array (counts) to also get sorted the same. * sort codes and counts by the order of codes c sorta codes * sort codes and counts by the order of counts c sorta counts
Comment
-
Sort Array in RPG
Friends, Please help me in this. In my RPG program I am creating 2 array, one with Code value (4 char) and another corresponding array with counts/totals for these Codes. I use lookup & add to elements of these arrays. With this the Code values are NOT in sorted order. Is there a way I can have these Codes sorted, and there corresponding array element move likewise ? Thanks,
Comment
Comment