Working /correctly/ as coded; thus probably a .feeture. ;-) Whether that is working-as-designed is moot, after having always functioned that way... since the S/38, I believe. The value passed on the INCREL parameter has an actual or effective length attribute [ELEM TYPE(*X) I believe; someone could use their version of a RTVCMDSRC to validate that], and the /field/ being compared against the specified /value/ elment is compared only up to the length of the literal value that was specified. Thus the comparison is effectively the following predicate [as expressed using SQL; e.g. as a predicate in a WHERE clause]:
left(LMLL, length('BR_T')) = 'BR_T'

At the command line [i.e. a command string without a CL variable for the /value/ element of the Include Relationship], to copy just the one row with the value 'BR_T', use the following specification:
INCREL((*IF LMLL *EQ 'BR_T '))

Or similarly, as I had explained here:
http://archive.midrange.com/midrange-l/201107/msg00408.html

Regards, Chuck

On 07 May 2013 15:05, Steve Landess wrote:

After working on this platform for 30 years, I can't believe that I
have not previously encountered this issue.

(tested on V5R4 and IBM i 7.1)

In an RUNSQLSTM script, do this:

CREATE TABLE QTEMP/XXXX
( LMLL CHAR (10 ) NOT NULL WITH DEFAULT
, LLNAME CHAR (30 ) NOT NULL WITH DEFAULT
)
;

Insert into qtemp/XXXX Values
('BR_T' ,'Brazil test')
,('BR_T1','Brazil test')
,('BR_T2','Brazil test')
,('BR_T3','Brazil test')
,('BR_T4','Brazil test')
,('BR_X' ,'Brazil test')
;

Now issue the following CPYF command:

CPYF FROMFILE(QTEMP/XXXX) TOFILE(QTEMP/XXXX1) MBROPT(*ADD)
CRTFILE(*YES) INCREL((*IF LMLL *EQ 'BR_T'))

<<SNIP what describes effect as copying all but the last row>>

So, Is this a feature or a bug?

(tested on V5R4 and IBM i 7.1)

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.