Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
count the number of records and displaying at the end

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: count the number of records and displaying at the end
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 Moderator


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

PostPosted: Sat Nov 20, 2010 12:51 am    Post subject:
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    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 How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm
No new posts Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am
No new posts MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us