Re: CCSID - RPG issues

Gad Miron <[email protected]> Sun, 1 Mar 2026 10:46:46 +0200
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <CAFj_=c3_B4FQVSuBDjT_YSuDtKYro-UU4MJvGM-hkcudgaLATw@mail.gmail.com>
Thanks Barbara

Since you have ascertained that the source value is correct  (Hex wize) .
I have re-tested the update process (with same item but from another source
file)
and recorded (in debug) the Hex values involved.

So:

Target value after initial chain (prior to new assigment)
COMPNY = '053' ;
 CMPTYP = 'ML' ;
 CATTYP = 'W' ;
 CATLOG = 'A4671690282408009OZUjyrCZ_Q' ;
chain (COMPNY:CMPTYP:CATTYP:CATLOG) NMWRKF ds_NMWRKR ;
> EVAL ds_NMWRKR.ITEMNAME8 :x

     00000     20202020 20202020 20202020 20202020   - ................

     00010     20202020 20202020 20202020 20202020   - ................

     00020     20202020 20202020 20202020 20202020   - ................

     00030     20202020 20202020 20202020 20202020   - ................

     00040     20202020 20202020 20202020 20202020   - ................

     00050     20202020 20202020 20202020 20202020   - ................

     00060     20202020 20202020 20202020 20202020   - ................

     00070     20202020 20202020 20202020 20202020   - ................


Source value retrieved after chain to source file.

SRCFILEID = 37106 ;

CATLOG = '9OZUjyrCZ_Q' ;

chain (SRCFILEID : CATLOG) NMMLIMPF ds_NMMLIMP ;

> EVAL ds_NMMLIMP.ITEMNAME :x

     00000     0014C380 206C6120 66696E20 6465206C   - ..C .%/.öù>.ôõ.%

     00010     27C3A974 C3A92020 20202020 20202020   - .Cz Cz..........

     00020     20202020 20202020 20202020 20202020   - ................

     00030     20202020 20202020 20202020 20202020   - ................

     00040     20202020 20202020 20202020 20202020   - ................

     00050     20202020 20202020 20202020 20202020   - ................

     00060     20202020 20202020 20202020 20202020   - ................

     00070     20202020 20202020 20202020 20202020   - ................

     00080     20202020 20202020 20202020 20202020   - ................

     00090     20202020 20202020 20202020 20202020   - ................

     000A0     20202020 20202020 20202020 20202020   - ................

     000B0     20202020 20202020 20202020 20202020   - ................

     000C0     20202020 20202020 20202020 20202020   - ................


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

     00040     C280C280 C280C280 C280C280 C280C280   - B B B B B B B B

     00050     C280C280 C280C280 C280C280 C280C280   - B B B B B B B B

     00060     C280C280 C280C280 C280C280 C280C280   - B B B B B B B B

     00070     C280C280 C280C280 C280C280 C280C280   - B B B B B B B B



This is weird,  value "Garbled"

Assignment error?


Can you make sense of it?


Gad






> date: Sat, 28 Feb 2026 08:47:23 -0500
> from: Barbara Morris <[email protected]>
> subject: Re: CCSID - RPG issues
>
> On 2026-02-28 4:20 a.m., Gad Miron wrote:
> > I guess I was not too clear
> >
> > Source AND target fields as CCSID(1208)
> >
> > ...
> >>
> >> On 2026-02-26 7:01 a.m., Gad Miron wrote:
> >>> ...
> >>> UTF8 Hebrew presents no problem since it translates , in the built-in
> RPG
> >>> conversion,
> >>> to CCSID(424) without issues.
> >>>
> >>> The problem lies with Spanish, French, Chinese,Russian, Greek, Arabic
> >> etc.
> >...
>
> In another message, you said
> > The value in debug is
> > 00000     0036932F F0F5F3D4 D3E6F9D6 E9E491A8
> > 00010     99C3E96D D8404040 40404040 40404040
> > 00020     40404040 40404040 40400014 C380206C
> > 00030     61206669 6E206465 206C27C3 A974C3A9
> > 00040     20202020 20202020 20202020 20202020
> >
> > The Hex value in the file is
> > 349848894884973A3444444444444444
> > F031069504503DF3F000000000000000
> >
> > Value of select HEX(ITEMNAME) from NMMLIMP2 is
> > C380206C612066696E206465206C27C3A974C3A9
>
> And in a different message, you said you did the CHAIN like this:
>             SRCFILEID = 36932 ;
>             CATLOG = '9OZUjyrCZ_Q' ;
>             chain (SRCFILEID : CATLOG) NMMLIMPF ds_NMMLIMP ;
>
> The value in debug looks like the value of the whole data structure.
> - The first 0036932F is the packed value 36932 for SRCFILEID
> - F9D6E9E4 91A899C3 E96DD8 is '9OZUjyrCZ_Q' for CATLOG.
>
> The UTF-8 data for the French data "? la fin de l'?t?" is at the end of
> the value in debug (starting at 0014 which is the varying-length 20).
> That debug value starts with what looks like EBCDIC data,
> "l?053MLW9OZUjyrCZ_Q".
>
> Assuming you did this in the debugger, I think the CHAIN got the correct
> value.
> ===> eval ds_NMMLIMP:x
>
> If you do this in the debugger, I think you would see the correct hex
> value of ITEMNAME, starting with x'0014' for the varying length prefix:
> ===> eval ds_NMMLIMP.ITEMNAME:x
>
>
> --
> Barbara
>
>
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact [email protected] for any subscription related questions.