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
 

 

Counting registers using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Counting registers using DFSORT
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    Post subject:
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    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 DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


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