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

count the number of records and displaying at the end


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

New User


Joined: 15 Sep 2010
Posts: 17
Location: india

PostPosted: Fri Nov 19, 2010 6:50 pm
Reply with quote

Hi,

I have a problem as mentioned below:

Input File:

1111 AAA A12
1111 AAA A12
1111 AAA A13
1122 AAB B11
1123 BBB C11
1123 BBB C11

Output:

1111 AAA A12 0002
1111 AAA A13 0001
1122 AAB B11 0001
1123 BBB C11 0002
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Nov 20, 2010 12:51 am
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT                               
//SYSOUT DD SYSOUT=*                             
//SORTIN DD *                                     
1111 AAA A12                                     
1111 AAA A12                                     
1111 AAA A13                                     
1122 AAB B11                                     
1123 BBB C11                                     
1123 BBB C11                                     
//SORTOUT DD SYSOUT=*                             
//SYSIN DD *                                     
  SORT FIELDS=(1,12,CH,A)                         
  OUTFIL REMOVECC,NODETAIL,                       
    SECTIONS=(1,12,                               
      TRAILER3=(1,12,X,COUNT=(EDIT=(TTTT))))     
/*


If the records are already in sorted order as shown in your example, using:

Code:

  OPTION COPY


instead of:

Code:

    SORT FIELDS=(...)


would be more efficient.
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 To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts To get the count of rows for every 1 ... DB2 3
Search our Forums:

Back to Top