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

Counting registers using DFSORT


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

New User


Joined: 07 Jun 2007
Posts: 31
Location: Spain

PostPosted: Tue May 20, 2008 8:40 pm
Reply with quote

Input format:

01 reg.
05 code pic x(4).
05 amount pic 9(5).

Input example:
0001 00005
0001 00006
0002 00001
0003 00008
0006 00004
0006 00001

Output format:
01 reg.
05 code pic x(4).
05 amount pic 9(5).
05 num-reg pic 9(3).

Output example:
0001 00011 002
0002 00001 001
0003 00008 001
0006 00005 002

I need to sum the fields of the amount value, and also count the number of different reg codes I had on the entry.

Thanks for the help.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue May 20, 2008 9:11 pm
Reply with quote

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                                         
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
0001 00005                                                         
0001 00006                                                         
0002 00001                                                         
0003 00008                                                         
0006 00004                                                         
0006 00001                                                         
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  SORT FIELDS=(1,4,CH,A)                                           
  OUTFIL REMOVECC,NODETAIL,                                       
  SECTIONS=(1,4,                                                   
  TRAILER3=(1,5,TOT=(6,5,ZD,M11,LENGTH=5),X,COUNT=(M11,LENGTH=3)))
//*                                                               


Hope this helps..

cheers
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top