Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT add the values for Decimal using SUM fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
callkris_cit

New User


Joined: 22 Apr 2006
Posts: 44

PostPosted: Sun Oct 21, 2007 12:01 am    Post subject: SYNCSORT add the values for Decimal using SUM fields
Reply with quote

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

dick scherrer

Site Director


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

PostPosted: Sun Oct 21, 2007 1:30 am    Post subject:
Reply with quote

Hello,

The abend is because the "numbers" are not ZonedDecimal.

Instead of ZD, try SFF.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sun Oct 21, 2007 7:58 am    Post subject:
Reply with quote

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

Senior Member


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

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

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

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Mon Oct 22, 2007 12:20 pm    Post subject:
Reply with quote

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

New User


Joined: 22 Apr 2006
Posts: 44

PostPosted: Sun Oct 28, 2007 10:15 am    Post subject:
Reply with quote

I will try and let you know
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us