Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Dfsort to Sum Total - HELP!!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
newbie

New User


Joined: 05 Nov 2005
Posts: 12

PostPosted: Wed Feb 10, 2010 1:19 am    Post subject: Dfsort to Sum Total - HELP!!!
Reply with quote

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
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Feb 10, 2010 2:30 am    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
newbie

New User


Joined: 05 Nov 2005
Posts: 12

PostPosted: Wed Feb 10, 2010 3:18 am    Post subject:
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Feb 10, 2010 3:36 am    Post subject:
Reply with quote

An all too common mistake. Glad I could help.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us