View previous topic :: View next topic
|
Author |
Message |
newbie
New User
Joined: 05 Nov 2005 Posts: 12
|
|
|
|
PIC S9(07)V99
Code: |
{00000027M
{00001680B |
I'm trying to sum up the amount but kept getting my output as:
TOTAL=+0000000.01
Here's my JCL:
Code: |
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('TOTAL=',TOT=(158,09,ZD,EDIT=(STTTTTTT.TT),SIGNS=(+,-))) |
What am I doing wrong?
Thanks in advance! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
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:
Since you say you got:
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. |
|
Back to top |
|
|
newbie
New User
Joined: 05 Nov 2005 Posts: 12
|
|
|
|
OMG!!! I was going crazy. I didn't realize that my file was VB.
The code was working for me 2 weeks ago, but today was not a good day. The file I was using before was a FB.
Thanks so much!!!.
Btw, my input was this:
00000027M = -274
00001680B = 16802
Once again...thanks Frank!!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
An all too common mistake. Glad I could help. |
|
Back to top |
|
|
|