I want to use operation 'lookup' for lookup table 1 and 2. I will code the table at the bottom of RGPLE source as sample below:
How do I code the Table1 and Table2 in D Spec?
This is an example using compile time array(s)
Code:*==================================== * *==================================== d CODE s 2 DIM(8) CTDATA PERRCD(4) d DESC s 10 DIM(4) CTDATA PERRCD(1) d x s 3 0 d INCODE s 2 d OUTDSC s 10 * c eval x = 1 c INCODE LOOKUP CODE(x) 99 c if %Found c eval OUTDSC = %trim(DESC(X)) c endif * c *entry plist c parm INCODE c parm OUTDSC * C eval *INLR = *on *==================================== ** A1A2A3A4 ** Import Local Production Return
hope that helps
All my answers were extracted from the "Big Dummy's Guide to the As400"
and I take no responsibility for any of them.
You need to define an alternating table (or array)
D Table1 S 2A DIM(10) PERRCD(1) CTDATA
D Table2 S 10A DIM(10) ALT(Table1)
The table elements should be next to each other, i.e.
without the space between them, unless the first element is a 3 pos field, or you want the 2nd element to start with a space.