× 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.



You decide:-)

Option 1: create an array of datastructures.

D CITEMSTR        DS                 QUALIFIED DIM(25)
D  MCN2                         15
D  MSN                           5I 0
D  MACOD                        10
D  MQTY1                         5I 0
D  MPRICE1                      12  2
D  MAMOUNT1                     12  2

Refer to an element as CITEMSTR(x).MCN2.


Option 2: use a dummy field as array and let the fields overlay the dummy 
field. The fields automatically become arrays as well.

D CITEMSTR        DS
D  dummy                             DIM(25)
D  MCN2                         15   OVERLAY(dummy:*NEXT)
D  MSN                           5I 0OVERLAY(dummy:*NEXT)
D  MACOD                        10   OVERLAY(dummy:*NEXT)
D  MQTY1                         5I 0OVERLAY(dummy:*NEXT)
D  MPRICE1                      12  2OVERLAY(dummy:*NEXT)
D  MAMOUNT1                     12  2OVERLAY(dummy:*NEXT)

Refer to an element as MCN2(x).

Option 3: define the individual fields as arrays.


Joep Beckeringh



>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.
>
>0032.00 D CITEMSTR        DS
>0033.00 DMCN2                           15
>0034.00 DMSN                             5I 0
>0035.00 DMACODE1                        10
>0036.00 DMQTY1                           5I 0
>0037.00 DMPRICE1                        12  2
>0038.00 DMAMOUNT1                       12  2
>
>Best Regards,
>
>Luqman

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.