Page 1 of 1

Comp-3 conversion using Sort giving error

PostPosted: Wed Jul 22, 2009 4:18 pm
by bhigi
Hi,

I am trying to compress signed number to comp-3 format using IBM sort

The input data is

+00000000000.04
+00000000000.05
+00000000000.06
+00000000000005

and cntl card is

OUTFIL FNAMES=SORTOF7,FTOV,VLTRIM=X'40',
INCLUDE=(1,3,CH,EQ,C'D06'),
OUTREC=(1,28,
29,15,SFF,TO=PD,LENGTH=8)

In the output file , all the numbers comes correctly except the ones ending with 5 .

0.04

0.06


When try to see hex value it gives as given below

44000000044
000000000C0
-----------

44000000044
00000000000
-----------
%
44000000064
000000000C0

Please help me understand what is special about 5 and why is it not getting converted to packed format using sort.

Re: Comp-3 conversion using Sort giving error

PostPosted: Wed Jul 22, 2009 8:51 pm
by Frank Yaeger
Your input doesn't seem to match your control statements. Since you have an INCLUDE for 'D06', I would expect you to have 'D06' in positions 1-3. And since you have 29,15,SFF,... I would expect you to have the amount starting in position 29. So the input would really look something like this:

----+----1----+----2----+----3----+----4----+-
D06                         +00000000000.04   
D06                         +00000000000.05   
D06                         +00000000000.06   
D06                         +00000000000005   


When I run your DFSORT control statements against that input, I get the correct PD values in the output starting in position 33 (29+4 for the RDW you added). Here's what I get in hex:

0000000000000004C
0000000000000005C
0000000000000006C
0000000000000005C


So either you're specifying the positions wrong or your input doesn't match your control statements or you're not checking the correct positions in the output or there's something else you're not doing or explaining correctly.