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 DFSORT to add 6 hours to time(tdate-t... DFSORT/ICETOOL 16
No new posts SOC7 error with DFSORT DFSORT/ICETOOL 9
No new posts Join lines with dfsort DFSORT/ICETOOL 5
No new posts TM and Registers PL/I & Assembler 6
No new posts Covert k to 1000 / m to 1000000 using... DFSORT/ICETOOL 5
Search our Forums:

Back to Top