×
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.
On 1/13/2017 4:46 PM, Jeff Young wrote:
Does anyone have an RPGLE example of processing this type of a list where
there can be multiple entries?
Using the exact CMD given earlier, this is my test RPG program. I did
it in old style because I wasn't sure if you could compile fully free.
It took a while to remember which columns were special :-)
h* Test lists within lists in commands
h/copy qprotosrc,stdhspec
d list pr extpgm('LIST')
d in_parm likeds(in)
*entry plist
d list pi
d in_parm likeds(in)
* fixed portion of the input
din ds
d input 512a
d listCount 5i 0 overlay(input)
d elementOffsets 5i 0 overlay(input: *next) dim(10)
// matches CMD MAX()
* individual inner list elements
dbox ds qualified based(box_ptr)
d count 5i 0
d id 20a
d type 1a
d qty 9a
d term 1a
d i s 10i 0
eval in = in_parm;
for i = 1 to listCount;
// slide the DS describing the individual (inner list) elements
through memory
box_ptr = %addr(in) + elementOffsets(i);
dsply i;
dsply box.id;
endfor;
*inlr = *on;
LIST BOXING((12345678901234567890 A 100000000)
(AAAAAAAAAAAAAAAAAAAA B 200000000)
(ZZZZZZZZZZZZZZZZZZZZ @ 300000000))
DSPLY 1
DSPLY 12345678901234567890
DSPLY 2
DSPLY AAAAAAAAAAAAAAAAAAAA
DSPLY 3
DSPLY ZZZZZZZZZZZZZZZZZZZZ
As an Amazon Associate we earn from qualifying purchases.