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

JCL Program required for the below requirement


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

New User


Joined: 16 Oct 2007
Posts: 15
Location: bangalore

PostPosted: Tue Apr 15, 2008 3:15 pm
Reply with quote

The requirement is given below.......

I have a file, It has some records with columns department and amount....

department is repeated multiple times... as like this

department amount

100 10
200 10
100 20
300 20
100 20
200 10
100 20
300 30


I need the output like this

department amount

100 70
200 20
300 50


can any one provide the JCL for this.......?


thanks in advance
sreeni
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Apr 15, 2008 3:28 pm
Reply with quote

You want the sort parms to sum amount by department?

if you would provide the DCB parms for the file and the positions of the FIELDS within the records someone will provide the SORT parms necessary.

Which sort do you have? Syncsort or DFSORT?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 15, 2008 3:29 pm
Reply with quote

Or you could search for examples in the SORT forum.
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Tue Apr 15, 2008 3:42 pm
Reply with quote

Code:

//STEP1    EXEC PGM=SORT
//SORTIN DD *
100 10
200 10
100 20
300 20
100 20
200 10
100 20
300 30
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
  SORT FIELDS=(1,3,CH,A)
  OPTION ZDPRINT
  SUM FIELDS=(5,2,ZD)
/*
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 Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top