Page 1 of 1

DIV giving weird results in SORT

PostPosted: Thu Jan 03, 2019 4:42 pm
by ROHIT5073
Input is:

0200000 0000000 0131500 0019116
(1,7) (8,7) (15,7) (22,7)


//SYSIN    DD *                                                  
 SORT FIELDS=COPY                                                
 OUTREC FIELDS=((8,7,ZD,ADD,15,7,ZD,ADD,22,7,ZD),DIV,(1,7,ZD))


Is giving 0 result. Rather the result should be .75

SORT Gurus, Please help!

Re: DIV giving weird results in SORT

PostPosted: Thu Jan 03, 2019 6:16 pm
by enrico-sorichetti
NO ! ...
it gives exactly what You asked for
DFSORT deals only with INTEGERS, You will have to deal with the decimal part Yourself

for two decimals

multiply the dividend by 100
divide
format the result

Re: DIV giving weird results in SORT

PostPosted: Thu Jan 03, 2019 6:29 pm
by ROHIT5073
Thanks a lot enrico. I got the right result. Appreciate your help!