Joined: 15 Feb 2005 Posts: 7130 Location: San Jose, CA

Posted: Wed Feb 10, 2010 2:30 am Post subject:

You're using 158,9,ZD and you show you have PIC S9(07)V99 which is 9 ZD digits, but then you show your input as:

Code:

{00000027M
{00001680B

which is 10 characters, not 9. If the { starts in positions 158, then the values are interpreted as:

Code:

{00000027 = 27
{00001680 = 1680

so the total is 1707 and DFSORT gives the following output:

Code:

TOTAL=+0000017.07

On the other hand, if 158 starts at the position after the { then the values are interpreted as:

Code:

00000027M = -274
00001680B = 16802

so the total is 16528 and DFSORT gives the following output:

Code:

TOTAL=+0000165.28

Since you say you got:

Code:

TOTAL=+0000000.01

I can take an educated guess that you're using a RECFM=VB input file, but you didn't account for the RDW in positions 1-4. In that case, you should be using 162 as the starting position rather than 158.