|
Thanks Jon. I am pretty sure the offsets are valid, but you are right. I thought I would shortcut the comparison of each field by using a subset data structure. It is just weird that the first DS shows up as the correct values, but the second-to-last zero is a block, instead of a zero (which didn't show up in the email I noticed). I verified the offsets using DSPFFD... On Wed, 1 Dec 2004 19:12:58 -0500, Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote: > >> The problem is that the packed numbers look funny in my data structures, > and they don't match what's in the LIKEREC data structures. > > By their very nature, any anomaly in a based DS is created by us - the > programmers <grin> > > It is likely that the offsets you are using are not correct. Why not use > the %Addr of the field itself within the F and D structures to obtain the > address? It is always risky to use hard coded offsets. > > More to the point perhaps, why aren't you just using the field names within > D and F directly when you compare the fields? Is it just because you want > to compare the AgingChk DSs directly and only compare at the field level if > they don't match? > > If you want to compare the "lumps" of data then why not compare substrings > of the F and D DSs. > > This is not tested and I've probably screwed up the math, but you'll get the > idea. > > StartOfString = 1 + (%Addr(D.FirstFieldInBlock) - %Addr(D)); > LengthOfString = %Addr(D.LastFieldInBlock) - %Addr(D.FirstFieldInBlock) + > %Size(D.LastFieldInBlock); > > If %Subst(D: StartOfString: LengthOfString) = ........ > > Jon Paris > Partner400 > www.Partner400.com > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > > -- "Enter any 11-digit prime number to continue..."
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.