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
 

 

Dfsort Question: Want to count the records in this file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Julian

New User


Joined: 27 Jul 2005
Posts: 2
Location: China

PostPosted: Wed Jul 27, 2005 1:12 pm    Post subject: Dfsort Question: Want to count the records in this file
Reply with quote

Assume I have a sequential file as following:
HDR20050710
DTLaaaaaaaa
DTLbbbbbbbb
...
TRL00000000

Now I want to count the records in this file, including HDR, DTL & TRL, and put the result to the last of TRL, for example:
HDR20050710
DTLaaaaaaaa
DTLbbbbbbbb
TRL00000004

Can dfsort achieve it? Anybody can help?
Thanks in advance.
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: Wed Jul 27, 2005 9:05 pm    Post subject:
Reply with quote

You can use the DFSORT job below to do what you asked for. You'll need z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004) in order to use DFSORT's new COUNT+n function. Only DFSORT has this function, so if you don't have DFSORT, you won't be able to use it. If you do have DFSORT, but you don't have the Dec, 2004 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000088

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
HDR20050710
DTLaaaaaaaa
DTLbbbbbbbb
TRL00000000
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
* Remove trailer record.
  OMIT COND=(1,3,CH,EQ,C'TRL')
* Write new trailer record with count of header, data and
* trailer records.
  OUTFIL REMOVECC,TRAILER1=('TRL',COUNT+1=(M11,LENGTH=8))
/*
Back to top
View user's profile Send private message
Julian

New User


Joined: 27 Jul 2005
Posts: 2
Location: China

PostPosted: Thu Jul 28, 2005 6:33 am    Post subject:
Reply with quote

Thank you, Frank.
That's very kind of you :-)
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 3:17 am    Post subject:
Reply with quote

With z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct, 2010), you can now use DFSORT's new IFTRAIL function to update the trailer record directly like this:

Code:

//NEW   EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
HDR20050710
DTLaaaaaaaa
DTLbbbbbbbb
TRL00000000
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL IFTRAIL=(TRLID=(1,3,CH,EQ,C'TRL'),
    TRLUPD=(4:COUNT+1=(M11,LENGTH=8)))
/*


For complete details on the new functions for DFSORT and DFSORT's ICETOOL available with the Oct, 2010 PTF, see:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000242
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 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 Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 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
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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