|
Just one more little problem. This data structure is part of the *entry parm. The only solution I come up with so far is: D tFecDs DS D tFEC1 LIKE(MYFEC1) D tFEC2 LIKE(MYFEC1) D tFEC3 LIKE(MYFEC1) D tFEC4 LIKE(MYFEC1) etc D tFEC_ARR LIKE(MYFEC1) overlay(fecDS) D DIM(whatever) * loop the file and load the array. C . . . . * create a sub-procedure that basically eval MYFEC1 = tFEC1, ..... Another method is to use QUSLFLD to get the field location and do substring by field name. (A little bit of overkill). -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Barbara Morris Sent: Thursday, November 18, 2004 11:03 AM To: rpg400-l@xxxxxxxxxxxx Subject: Re: Array over fields in a data structure Lim Hock-Chai wrote: > > What if there is no pattern in between each field. ( The actual data > structure has no pattern). > If I change the structure to be as follow: > A R TESTDSFMT > A MYFEC1 3 > A MYOTHER1 9 0 > A MYFEC1OK 1 > A MYFEC2 3 > A MYOTHER2 5 > A MYOTHER3 7 > A MYFEC2OK 1 > A MYFEC3 3 > A MYFEC3OK 1 > A MYFEC4 3 ... To get the MYFEC fields to be contiguous in the program, then instead of using an externally-described DS for this file, define a USROPN F spec for the file, and then define a DS like this (with just the names, no type information): D fecDs DS D MYFEC1 D MYFEC2 D MYFEC3 D MYFEC4 etc D MYFEC_ARR LIKE(MYFEC1) overlay(fecDS) D DIM(whatever)
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.