On 2026-03-01 3:46 a.m., Gad Miron wrote:
...
EVAL ds_NMMLIMP.ITEMNAME :x
00000 0014C380 206C6120 66696E20 6465206C - ..C .%/.öù>.ôõ.%
...

Target value after assignment

ds_NMWRKR.ITEMNAME8 = %subst(ds_NMMLIMP.ITEMNAME :1 : 128 : *NATURAL) ;

EVAL ds_NMWRKR.ITEMNAME8 :x

00000 00C29D43 1AC28025 2FC280D7 A5D7A4C2 - .B,â.B ..B PvPuB
00010 803CD7A9 D7A6C280 251B437A C2A0437A - .PzPwB ..â:Bµâ:
00020 C280C280 C280C280 C280C280 C280C280 - B B B B B B B B
...
00030 C280C280 C280C280 C280C280 C280C280 - B B B B B B B B



I can't guess why it is not getting an exception for the %SUBST with a length of 128. The first 2 bytes of ds_NMWRKR.ITEMNAME8 are x'0014' which means the current length is 20. Any length for %SUBST greater than 20 should fail with RNX0100.

What happens if you just assign ds_NMMLIMP.ITEMNAME ds_NMWRKR.ITEMNAME8 without %SUBST?

If you don't have CHARCOUNT(*NATURAL) in your control options, you need to use the /CHARCOUNT directive to get the data truncated correctly if the right-hand-size of the assignment is longer than the left-hand-size.

/charcount NATURAL
ds_NMWRKR.ITEMNAME8 = ds_NMMLIMP.ITEMNAME;
/charcount STDCHARSIZE


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.