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

Author Message
callkris_cit

New User

Joined: 22 Apr 2006
Posts: 44

 Posted: Sun Oct 21, 2007 12:01 am    Post subject: SYNCSORT add the values for Decimal using SUM fields Hi Guys,= I have a input file Name Points Krishnan -20.22 Krishnan -20.24 kanthan +20.44 I want to add the points if names are same, so i tried with below option SORT FIELDS=(1,8,CH,A) SUM FIELDS=(9,6,ZD) But i am getting the abend. Please let me know what i need to specified instead of ZD

dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Sun Oct 21, 2007 1:30 am    Post subject: Hello, The abend is because the "numbers" are not ZonedDecimal. Instead of ZD, try SFF.
krisprems

Active Member

Joined: 27 Nov 2006
Posts: 649
Location: India

 Posted: Sun Oct 21, 2007 7:58 am    Post subject: callkris_cit You have shown how the i/p looks like, if need any help also show how the o/p should look like?
Aaru

Senior Member

Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

Posted: Mon Oct 22, 2007 11:42 am    Post subject: Reply to: SYNCSORT add the values for Decimal using SUM fiel

callkris_cit,

Use this JCL for your requirement

 Code: // EXEC PGM=ICEMAN                                                    //SORTIN DD *                                                        KRISHNAN -20.22                                                      KRISHNAN -20.24                                                      KANTHAN  +20.44                                                      /*                                                                    //SORTOUT DD SYSOUT=*                                                //SYSOUT DD SYSOUT=*                                                  //SYSIN DD *                                                           INREC OVERLAY=(10:10,6,SFF,TO=ZD,LENGTH=6)                           SORT FIELDS=(1,8,CH,A)                                               SUM FIELDS=(10,6,ZD)                                                 OUTREC OVERLAY=(10:10,6,ZD,EDIT=(STTT.TT),SIGNS=(,-))                /*

output:

 Code: KANTHAN   020.44 KRISHNAN -040.46
krisprems

Active Member

Joined: 27 Nov 2006
Posts: 649
Location: India

Posted: Mon Oct 22, 2007 12:20 pm    Post subject:

callkris_cit
Also you could do the same using sections, like this:
 Code: //********************************************************************  //S1       EXEC  PGM=ICEMAN                                              //SYSOUT   DD  SYSOUT=*                                                  //SORTIN   DD *                                                          KRISHNAN  -20.22                                                        KRISHNAN  -20.24                                                        ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-- KANTHAN   +20.44                                                        /*                                                                      //SORTOUT  DD SYSOUT=*                                                  //SYSIN    DD    *                                                        SORT FIELDS=(1,10,CH,A)                                                  OUTFIL REMOVECC,NODETAIL,                                                  SECTIONS=(1,10,                                                            TRAILER3=(1,10,11:TOT=(11,6,SFF,EDIT=(STTT.TT),SIGNS=(+,-))))      /*
callkris_cit

New User

Joined: 22 Apr 2006
Posts: 44

 Posted: Sun Oct 28, 2007 10:15 am    Post subject: I will try and let you know
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

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