<pre>
Farry1 it f 13 disk
Darray1 s 13a dim(6) fromfile(arry1)
Dparray s * inz(%addr(array1))
Darrds ds dim(6) based(parray) qualified
Dnum 5p 0
Dchar 10a
Di s 1p 0 inz(1)
D wrkNum s 5p 0
D wrkChar s 10a
C 1 do 6 i
C eval wrkNum = arrds(i).num
C eval wrkChar = arrds(i).char
C wrkNum dsply
C wrkChar dsply
C enddo
C
C eval *inlr = *on </pre>
1. The way you handled counting i attempted to display (0) — arrays in RPG begin with 1
so I changed the counting loop to go from 1 to 6 populating i as it counts
2. Apparently fixed format dsply – cannot handle the qualified, array, subfield — dsply is rarely used as a production command
3. If something doesn’t work find a work around .. like the use of the WRK fields in above code.
3. Free format dsply works just fine.
<pre>
/free
dsply arrds(i).num;
/end-free
</pre>
Discuss This Question: 24  Replies