Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
Jithucse

New User

Joined: 18 Apr 2008
Posts: 11
Location: Coimbatore

 Posted: Thu Jan 21, 2010 6:47 pm    Post subject: Signed numbers with decimal numbers - sum Hi, I've a requirement like this. I need to get the sum of few numbers which are signed and are decimal numbers. For example, 0314690| 0000001000.10 0314690|-0000002000.80 0314690| 0000000000.00 I need to sum up the amount fields and the result looks like as shown below. 0314690|-0000001000.70 Is there anyway this can be done by sort... Regards, Jithu

Frank Yaeger

DFSORT Moderator

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

 Posted: Thu Jan 21, 2010 10:55 pm    Post subject: Do you want one sum for all of the records? Or do you want a sum of the records for each key in positions 1-7? You only show one value in 1-7 so it's difficult to tell what you really want. A better example and explanation would help. Also, what is the RECFM and LRECL of the input file?
Jithucse

New User

Joined: 18 Apr 2008
Posts: 11
Location: Coimbatore

 Posted: Fri Jan 22, 2010 11:35 am    Post subject: Reply to: Signed numbers with decimal numbers - sum Hi, I want the sum of records based on the value in the key position 1-7. Here is an example to make it clear. My input file is 0314690| 0000001000.10 0314690|-0000002000.80 0314695|-0000000500.50 0314690| 0000000000.00 0314695| 0000000500.50 And the output records looks like this 0314690|-0000001000.70 0314695| 0000000000.00 Also, the record format is FB and the LERCL is 22. Regards, Jithucse
Frank Yaeger

DFSORT Moderator

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

Posted: Fri Jan 22, 2010 9:59 pm    Post subject:

Here's a DFSORT job that will do what you asked for:

 Code: //S1    EXEC  PGM=SORT //SYSOUT    DD  SYSOUT=* //SORTIN DD DSN=...  input file (FB/22) //SORTOUT DD DSN=...  output file (FB/22) //SYSIN    DD    *   OPTION EQUALS   SORT FIELDS=(1,7,CH,A)   OUTFIL REMOVECC,NODETAIL,     SECTIONS=(1,7,       TRAILER3=(1,8,         TOT=(9,14,SFF,EDIT=(STTTTTTTTTT.TT),SIGNS=(,-)))) /*
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm How to group and sum the decimal value sakrat DFSORT/ICETOOL 2 Tue Mar 06, 2018 9:13 pm Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us