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



At first guess, Greg, I don't think you can compare them just by name, if that is what you are doing. There are X number of subfields in onw, 3*X in the other. Do you get a message that some things are being dropped from the array? LIke this?


RNF5343


Array has too many omitted indexes; specification is ignored.


I think you can compare the single DS to each array element in turn.

Cheers
Vern


On Mon, 15 Apr, 2024 at 3:53 PM, Greg Wilburn <gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:


To: rpg400-l@xxxxxxxxxxxxxxxxxx

I'm at my wits end...

I am trying to compare two address data structures to see if they are different. BOTH are defined "like" a template ds, however one is dimensional (3).

Can anyone point out what I may be missing??

TIA
Greg

Code:

dcl-ds upsAddr_t qualified template;
name varchar(40);
street varchar(50);
street2 varchar(50);
street3 varchar(50);
city varchar(30);
state varchar(30);
zipcode varchar(10);
cntry varchar(2);
end-ds;

dcl-ds ups likeds(upsAddr_t) inz;
dcl-ds upsSugg likeds(upsAddr_t) dim(3) inz;


if ups.name<http://ups.name> <> upsSugg(x).name;
diff = *on;
endif;
if ups.street <> upsSugg(x).street;
diff = *on;
endif;
if ups.street2 <> upsSugg(x).street2;
diff = *on;
endif;
if ups.street3 <> upsSugg(x).street3;
diff = *on;
endif;
if ups.city <> upsSugg(x).city;
diff = *on;
endif;
if ups.state <> upsSugg(x).state;
diff = *on;
endif;
if ups.zipcode <> upsSugg(x).zipcode;
diff = *on;
endif;
if ups.cntry <> upsSugg(x).cntry;
diff = *on;
endif;

// In Debug... diff is still *OFF at this point

// In this expression.. DIFF turns ON
if ups <> upsSugg(x);
diff = *on;
endif;

[Logo]<https://www.totalbizfulfillment.com/><https://www.totalbizfulfillment.com/>> Greg Wilburn
Director of IT
301.895.3792 ext. 1231
301.895.3895 direct
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx><mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx<mailto:gwilburn@xxxxxxxxxxxxxxxxxxxxxxx>>
1 Corporate Dr
Grantsville, MD 21536
www.totalbizfulfillment.com<http://www.totalbizfulfillment.com><http://www.totalbizfulfillment.com<http://www.totalbizfulfillment.com>>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.