|
SCarter wrote: > I know this is really long but I wanted to let you know what I am dealing > with here. > I have this very large array it looks like a three level > structure where a > file is read and fills out the top level then each of the FORMATxx fields > are used > to read a different record and fill out the second level and again the > FORMATxx records on this level are used to read the file and fill out the > last level. > What I am trying to see is there a more intuitive way of performing the > same function without getting into things like recursion..... > > D DATA DS > D PARMS DIM(10) > D CO1 580 OVERLAY(PARMS:1 ) > D FSCOA 2 OVERLAY(CO1:1) > D FSCOA# 2 0 OVERLAY(CO1:1) > D FSBRA 1 OVERLAY(CO1:3) > D FSCOBRA# 3 0 OVERLAY(CO1:3) > D FORMATA 10 OVERLAY(CO1:5) Something strange about the defs. above; is the length of FSCOBRA# correct (should it be 2 0?) or is perhaps the OVERLAY start position wrong for that subfield? To the above DS I would add SUBS_Offset 5 0 dim(11) Subs_Count 2 0 dim(11) and define the following "stand-alone" DS > D SUBS > D SUBSCO1 2 OVERLAY(SUBS:1) > D SUBSCO1# 2 0 OVERLAY(SUBS:1) > D SUBSBR1 1 OVERLAY(SUBS:3) > D SUBCBR1 3 OVERLAY(SUBS:1) > D SUBFMT1 10 OVERLAY(SUBS:4 ) Then I would use a pointer to add the content of SUBS to DATA/PARMS before filling the next SUBS entry, updating the SUBS_Offset anf SUBS_Count arrays along the way. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.