MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
vkphani Intermediate Joined: 05 Sep 2003 Posts: 483 Topics: 48
Posted: Fri Jun 17, 2005 3:50 am Post subject: Summing and removing duplicates using SORT
My input file looks like this:
Code:
12345 1 2 3
12345 2 3 4
12345 3 4 1
I want the output like this:
Thanks in advance.
Back to top
subhasis_50 Beginner Joined: 17 Jun 2005 Posts: 4 Topics: 3 Location: KOLKATA,India
Posted: Fri Jun 17, 2005 4:59 am Post subject:
Hi,
Use the following
Code:
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=INPUT-FILE NAME
//SORTOUT DD DSN=OUTPUT FILE NAME,
// DCB=*.SORTIN,
// DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(1500,500),RLSE)
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=(7,1,ZD,9,1,ZD,11,1,ZD)
/*
_________________ Thanks & Regards
Subhasis
Back to top
Alain Benveniste Beginner Joined: 04 May 2003 Posts: 92 Topics: 4 Location: Paris, France
Posted: Fri Jun 17, 2005 5:04 am Post subject:
Paneendra,
Here is the jcl
Code:
//STEP0001 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
SORT FROM(IN) TO(OUTX) USING(ICE0)
/*
//IN DD *
12345 1 2 3
12345 2 3 4
12345 3 4 1
/*
//OUTX DD SYSOUT=*
//ICE0CNTL DD *
OPTION ZDPRINT
SORT FIELDS=(1,5,ZD,A)
SUM FIELDS=(7,1,ZD,9,1,ZD,11,1,ZD)
/*
You don't need to post the same thread in several forums. You will find the same persons to answer you in each of them.
Such needs have been answered many times. It could be good to make a search before.
Alain
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Back to top
vkphani Intermediate Joined: 05 Sep 2003 Posts: 483 Topics: 48
Posted: Mon Aug 08, 2005 10:44 pm Post subject:
Hi All,
Thanks for the help.
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum