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
 

 

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 Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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