View previous topic :: View next topic
|
Author |
Message |
callkris_cit
New User
Joined: 22 Apr 2006 Posts: 44
|
|
|
|
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 |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
The abend is because the "numbers" are not ZonedDecimal.
Instead of ZD, try SFF. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
callkris_cit
You have shown how the i/p looks like, if need any help also show how the o/p should look like? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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
|
|
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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=(+,-))))
/*
|
|
|
Back to top |
|
|
callkris_cit
New User
Joined: 22 Apr 2006 Posts: 44
|
|
|
|
I will try and let you know |
|
Back to top |
|
|
krunal7757
New User
Joined: 01 Sep 2021 Posts: 6 Location: INdia
|
|
|
|
can you help how to use SUM fiedls for a file having Datatype as S9(8)V99 - also the output file shld maintain the signed bits
my file has below in amount fields
Amount from position 17 Length 10
20210823D0000000000210566HKRUNAL7757
20210823D0000000000177967EKRUNAL7758
20210823D0000000000126824BKRUNAL7757
20210823D0000000000462786IKRUNAL7758
20210823D0000000000642776CKRUNAL7757
Please help this is little urgent
i tried SFF TO ZD but out file does not shows the values same as input file.
Kindly guide if this is possible or i have to use cobol program |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1348 Location: Bamberg, Germany
|
|
|
|
@krunal7757: Do NOT hijack year old posts, start a new topic if needed.
This topic here should be locked. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3077 Location: NYC,USA
|
|
|
|
locked. |
|
Back to top |
|
|
|