Update comp-field within a char field

IBM's flagship relational database management system
slufter
Posts: 1
Joined: Fri Mar 26, 2021 4:01 pm
Skillset: cobol
Referer: google

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:

Code: Select all


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


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

Code: Select all


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

User avatar
sergeyken
Posts: 458
Joined: Wed Jul 24, 2019 10:12 pm
Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
Referer: Internet search

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.


  • Similar Topics
    Replies
    Views
    Last post