IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Elimnate the Duplicate and Sum the fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Mon Feb 11, 2013 4:48 pm
Reply with quote

Hi,

I need to remove the duplicate and sum the fields based on the key fields.

For eg:
Input File:
Code:

00023 0994
00024-0023
00023-1000
00024 0025

Expected Output File:
Code:

00023-0006
00024 0002


I have tried below sort card. its not working..

Code:

SORT FIELDS=(1,5,CH,A)                           
SUM FIELDS=(7,4,ZD)                               
OUTREC OVERLAY=(6:7,4,ZD,EDIT=(STTTT),SIGNS=(,-))


Output is:
Code:

00023 1994
00024 0048


For my Sort card just adding the rows based on the key.
Please advise!!!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 11, 2013 5:02 pm
Reply with quote

You field is not ZD, it has a physical "-". Try with FS instead of ZD.
Back to top
View user's profile Send private message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Mon Feb 11, 2013 5:40 pm
Reply with quote

Hi Bill,
You field is not ZD, it has a physical "-".

Data values having negative values.

That's why i am stuck up. Please provide the sort card..
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Feb 11, 2013 6:02 pm
Reply with quote

If you read the first sentence, did you read, and act on, the second?
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Feb 11, 2013 10:34 pm
Reply with quote

use the following DFSORT JCL which will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD *                                                     
00023 0994                                                           
00024-0023                                                           
00023-1000                                                           
00024 0025                                                           
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  SORT FIELDS=(1,5,CH,A)                                             
  OUTFIL REMOVECC,NODETAIL,                                         
  SECTIONS=(1,5,TRAILER3=(1,5,TOT=(6,5,SFF,EDIT=(STTTT),SIGNS=(,-))))
//* 
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Duplicate data in PUT CONTAINER using... CICS 4
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
Search our Forums:

Back to Top