|
How can I covert this DS to an Array of 25 Elements each. Do I have to define DIM() on each field or only on 1st line.
D CITEMSTR DS qualified dim(25) D MCN2 15 D MSN 5I 0 D MACODE1 10 D MQTY1 5I 0 D MPRICE1 12 2 D MAMOUNT1 12 2
Then you reference it in your code as:
citemstr(x).msn = 123
D CITEMSTR DS occurs(25) D MCN2 15 D MSN 5I 0 D MACODE1 10 D MQTY1 5I 0 D MPRICE1 12 2 D MAMOUNT1 12 2
%occur(CITEMSTR) = x; msn = 123
D CITEMSTR ds D group dim(25) D MCN2 15 overlay(group:*next) D MSN 5I 0 overlay(group:*next) D MACODE1 10 overlay(group:*next) D MQTY1 5I 0 overlay(group:*next) D MPRICE1 12 2 overlay(group:*next) D MAMOUNT1 12 2 overlay(group:*next)
Now you can reference each field in the DS as an array, if you like:
MSN(x) = 123;
Good luck
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.