Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
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
References
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4579
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:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1