how to round signed packed decimal using icetool



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

how to round signed packed decimal using icetool

Postby B1CV8HH » Sun Oct 03, 2010 8:46 pm

input
char format  hex format
input        pic s9(05)v9(04) comp-3


char format   hex format
-00000.0490  000000490D
-00000.0495  000000495D
-00000.2990  000002990D
-00000.4490  000004490D
-00000.4995  000004995D
-00000.2135  000002135D


output after rounding
-00000.0500  000000500D
-00000.0500  000000500D
-00000.3000  000003000D
-00000.4500  000004500D
-00000.5000  000005000D
-00000.2100  000002100D
B1CV8HH
 
Posts: 1
Joined: Sun Oct 03, 2010 8:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to round signed packed decimal using icetool

Postby Frank Yaeger » Mon Oct 04, 2010 2:01 am

You can use these DFSORT control statements to do what you asked for. I assumed that your 5-byte PD field starts in position 1. You only showed negative values, so that's all I coded for.

  OPTION COPY
  INREC BUILD=(((1,5,PD,ADD,-50),DIV,+100),MUL,+100,
    TO=PD,LENGTH=5)
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post