Update comp-field within a char field



IBM's flagship relational database management system

Update comp-field within a char field

Postby slufter » Fri Mar 26, 2021 4:21 pm

Hello !

I will update a substring in a data field with a COMP value:

hex
-+----2---
J08279 ø  
DFFFFF4701
108279000C
 


I want to update 7001C (= 70001) to 21120C :

hex
-+----2---
J08279 ø  
DFFFFF4210
108279012C
 


I will update the field with overlay, but I have no idea how to convert '21120' to the packed value.

Any suggestions?

Greets
Axel
slufter
 
Posts: 1
Joined: Fri Mar 26, 2021 4:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Update comp-field within a char field

Postby sergeyken » Fri Mar 26, 2021 11:59 pm

In your example the value ‘21120’ is presented exactly in IBM packed decimal format. I’m 100% sure of this.

What do you need to convert, from where, and to where?
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 436
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post