Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Elimnate the Duplicate and Sum the fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Elimnate the Duplicate and Sum the fields
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Feb 11, 2013 5:02 pm    Post subject: Reply to: Elimnate the Duplicate and Sum the fields
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    Post subject: Reply to: Elimnate the Duplicate and Sum the fields
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Feb 11, 2013 6:02 pm    Post subject: Reply to: Elimnate the Duplicate and Sum the fields
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us