# Question to NAT3413

**URL:** <https://techcommunity.softwareag.com/t/question-to-nat3413/101948>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [December 12, 2012, 4:36pm UTC](https://techcommunity.softwareag.com/t/question-to-nat3413/101948 "2012-12-12T16:36:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 12, 2012, 4:36pm UTC](https://techcommunity.softwareag.com/t/question-to-nat3413/101948/1 "2012-12-12T16:36:57Z")

</div>

Hello all,

please run the following program. It tries to Convert a sting from UNICODE to my local codepage “win-1252”. One of the Unicode-Characters (i.e. UH’010D’ = C+caron) is non-existant in my local codepage. So a NAT3413 occurs.

```auto
define data local
01 #u10 (U10) init <UH'00410042010D0044'> /* A B C+caron D
01 #a10 (A10)
01 #usr2030
  02 #usr2030-ERR-PARM (A253/1:9)
  02 #usr2030-OCC (N01) /* Number of occurences
  02 #usr2030-RESPONSECODE (N04) /* Error code, not used
end-define
on error
  if *ERROR-NR = 3413
    write 'Codepage-Transformation error'
    write '=' #a10 (EM=H(10))
    callnat 'USR2030N' #usr2030
    write '=' #usr2030-OCC
    write '=' #usr2030-ERR-PARM(1) (AL=70)
  end-if
end-error
write '=' *CODEPAGE
#a10 := #u10 /* unicode --> win-1252 /* NAT3413 here
end
```

The documentation of NAT3414 says:

> [@](#):
>
> NAT3413 Conversion error, at least 1 code point not translated. H’:1:’  
> […]  
> The first failed code point of the source string is displayed in  
> hexadecimal format at the end of the message.

So I would expect to get the “bad” character in :1:… But it doesn’t work.

The output of the program above is as follows:

```auto
CODEPAGE: windows-1252
Codepage-Transformation error
#A10: 41421A44202020202020
#USR2030-OCC: 0
#USR2030-ERR-PARM:
```

Any ideas? My Natural-Version is 6.3.9@Solaris.

Regards

Matthias

---

<div class="post-metadata">

**Author:** ![Eva\_Grill](https://avatars.discourse-cdn.com/v4/letter/e/ed8c4c/32.png) [@Eva\_Grill](https://techcommunity.softwareag.com/u/Eva_Grill)\
**Post date:** [December 13, 2012, 9:12am UTC](https://techcommunity.softwareag.com/t/question-to-nat3413/101948/2 "2012-12-13T09:12:42Z")

</div>

Hello Matthias,

I experienced the same; we are on Nat 6.3.12 .

In order to avoid runtime errors in case of conversion errors, I mostly use the  
‘Move encoded’… (e.g. a binary xml input with data) to … (alphanumeric variable) 'giving #move-encoded-error" (#move-encoded-error is my variable for error code).  
If #move-encoded-error is 0, everything is ok; if not, I know I have to handle the input in another way and can’t just convert it into a string in the default codepage.  
But I also would like to know more exactly which character causes the problem.

Kind regards  
Eva

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [December 13, 2012, 10:08am UTC](https://techcommunity.softwareag.com/t/question-to-nat3413/101948/3 "2012-12-13T10:08:16Z")

</div>

Hello Eva Grill,

thanks for your answer.  
Of course we can do a workaround like the following:

```auto
define data local
01 #u10 (U10) init <UH'00410042010D010E'> /* A B C+caron D+caron
01 #a10 (A10)
01 #u10b (U10)
01 #u1a (U1)
01 #u1b (U1)
01 #i4 (I4)
01 #usr2030
  02 #usr2030-ERR-PARM (A253/1:9)
  02 #usr2030-OCC (N01) /* Number of occurences
  02 #usr2030-RESPONSECODE (N04) /* Error code, not used
end-define
on error
  if *ERROR-NR = 3413
    write 'Codepage-Transformation error'
    write '=' #a10 (EM=H(10))
    callnat 'USR2030N' #usr2030
    write '=' #usr2030-OCC
    write '=' #usr2030-ERR-PARM(1) (AL=70)
    #u10b:= #a10 /* back to unicode to find out bad chars
    for #i4 = 1 to 10
      #u1a:= substr(#u10,#i4,1)
      #u1b:= substr(#u10b,#i4,1)
      if #u1a ne #u1b
        write 'bad char' #u1a (EM=HH) 'on pos' #i4
      end-if
    end-for
  end-if
end-error
write '=' *CODEPAGE
#a10 := #u10 /* unicode --> win-1252 /* NAT3413 here
end
```

But if I understand the documentation correctly I think Natural should do this job for me…

Matthias

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [December 13, 2012, 1:12pm UTC](https://techcommunity.softwareag.com/t/question-to-nat3413/101948/4 "2012-12-13T13:12:57Z")

</div>

Hi Matthias,

I think you’re right. I’ve tried to run your example on z/OS and the result is:

```auto
Page 1 12-12-13 14:05:11
                                                                               
CODEPAGE: IBM01143 
Codepage-Transformation error 
A10: C1C23FC4404040404040
USR2030-OCC: 1
USR2030-ERR-PARM:
010D

NAT3413 Conversion error, at least 1 code point not translated. H'010D'
```

I suggest you open a support request for Open Systems.

Best regards,  
Mogens

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [January 7, 2013, 12:15pm UTC](https://techcommunity.softwareag.com/t/question-to-nat3413/101948/5 "2013-01-07T12:15:12Z")

</div>

Hello Mogens,

thanks for trying it out on your z/OS.

I’ve just opened up a support request…

Matthias

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:02pm UTC](https://techcommunity.softwareag.com/t/question-to-nat3413/101948/6 "2021-04-02T15:02:41Z")

</div>


