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
 

 

Compare with the same dataset and use add operation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shamsundar_mk

New User


Joined: 18 May 2007
Posts: 30
Location: CHENNAI

PostPosted: Thu May 03, 2012 1:02 pm    Post subject: Compare with the same dataset and use add operation
Reply with quote

Hi,
Could you please help me!

I have a input file as below.


Code:
hdr this is header record       
det spart1                   10
det spart1                   10
det spart2                   05
det spart2                   11
det spart1                   12
det spart2                   15
trl this is trailer record   


my output file should remove the duplicates in detail record (det) and add the count as below

Code:
hdr this is header record       
det spart1                   32
det spart2                   31
trl this is trailer record
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7309

PostPosted: Thu May 03, 2012 1:05 pm    Post subject: Reply to: Compare with the same dataset and use add operatio
Reply with quote

So you need to SUM the values, excluding the header and trailer. Do you need any changes to the header/trailer?
Back to top
View user's profile Send private message
shamsundar_mk

New User


Joined: 18 May 2007
Posts: 30
Location: CHENNAI

PostPosted: Thu May 03, 2012 1:12 pm    Post subject: Reply to: Compare with the same dataset and use add operatio
Reply with quote

No! I need the header and trailer as it is in input file.
and the sum of the duplicates as said above.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7309

PostPosted: Thu May 03, 2012 1:50 pm    Post subject: Reply to: Compare with the same dataset and use add operatio
Reply with quote

Hey, what is all the "shrieking" about? I just asked a question.

There are manuals for DFSORT/ICETOOL, links in this forum, links at the top of the page. Your task is absurdly easy, and I apologise for assuming that there must be something else to it for you not to be able to achieve the results without asking here.

For me, you are on your own with this one. Should take all of five minutes.

!
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Thu May 03, 2012 8:24 pm    Post subject:
Reply with quote

shamsundar_mk,
Here is a job from Smart DFSORT Tricks.... I modified to add sum fields statement... Keep in mind, if your total is likely to go beyond 99, you will need to handle that.

Code:
//S1       EXEC PGM=ICETOOL                         
//TOOLMSG  DD SYSOUT=*                               
//DFSMSG   DD SYSOUT=*                               
//IN DD *                                           
HDR THIS IS HEADER RECORD                           
DET SPART1                   10                     
DET SPART1                   10                     
DET SPART2                   05                     
DET SPART2                   11                     
DET SPART1                   12                     
DET SPART2                   15                     
TRL THIS IS TRAILER RECORD                           
/*                                                   
//OUT DD SYSOUT=*                                   
//TOOLIN DD *                                       
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
//CTL1CNTL DD *                                     
 SORT FIELDS=(1,3,CH,A,5,6,CH,A)                     
 SUM FIELDS=(30,2,ZD)                               
/*                                                   

OUTPUT
Code:

HDR THIS IS HEADER RECORD     
DET SPART1                   32
DET SPART2                   31
TRL THIS IS TRAILER RECORD     

Thanks,
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 fuzzy compare Martylin JCL & VSAM 6 Thu Mar 30, 2017 2:45 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm


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