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



Wim,

Will the following code accomplish what you are looking for? I have
changed the data structures to not be defined as arrays and the subfields
to be defined as arrays which then allows you to compare the data
structures.

Best Regards,
Mike Garrison


d ds01 ds qualified
d fld01 5a dim(100) inz
d fld02 5a dim(100) inz
d ds02 ds likeds(ds01)
d difference s n inz
/free

ds01.fld01(1) = 'abcde' ;
ds01.fld02(1) = 'fghij' ;
ds01.fld01(2) = '12345' ;
ds01.fld02(2) = '67890' ;

// ok
d ds01 ds qualified ds02 = ds01 ;

// not ok
if (ds01 = ds02) ;
difference = *on ;
else ;
difference = *off ;
Endif ;

*inlr = *on;
/end-free



Wim Vandepoel wrote on 01/04/2012 07:44:51 AM:

From: Wim_Vandepoel@xxxxxxx
To: rpg400-l@xxxxxxxxxxxx
Date: 01/04/2012 07:47 AM
Subject: Qualified ds index - RNF5343
Sent by: rpg400-l-bounces@xxxxxxxxxxxx

HN all

I'm getting a compile error for the code below.
Why is the -eval- statement ok, but the -if- statement not?
Could someone point me in the right direction?
Thanks!


d ds01 ds qualified
d dim(100)
d fld01 5a
d fld02 5a
d ds02 ds likeds(ds01)
d dim(100)
/free

ds01(1).fld01 = 'abcde' ;
ds01(1).fld02 = 'fghij' ;
ds01(2).fld01 = '12345' ;
ds01(2).fld02 = '67890' ;

// ok
ds02 = ds01 ;

// not ok
if (ds01 = ds02) ;
RNF5343: Array has too many omitted indexes; specification is ignored.
Endif ;

*inlr = *on;
/end-free


We are at V5R4

Rest Begards
Wim
--

--
This is the RPG programming on the IBM i / System i (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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.