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
 

 

how to count number of records excluding header and trailer

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

New User


Joined: 21 Sep 2010
Posts: 17
Location: India

PostPosted: Thu Feb 24, 2011 9:38 pm    Post subject: how to count number of records excluding header and trailer
Reply with quote

Anbody please help me on this.

I have a file (FB) of length 100 as below.


Code:
INPUT FILE:

HDR HEADER
DTL DETAIL 1
DTL DETAIL 2
DTL DETAIL 3
DTL DETAIL 4
DTL DETAIL 5
TLR TRAILER


I need to write the count of only the details records in an output file(FB, length=50) as below

Code:
OUTPUT FILE

COUNT = 000000000000005


I have the following scenarios on the input file.

1. Input file can have header and trailer(as shown above)
2. Input file missing header
3. Input file missing trailer

Please do help me to achieve using sort.

Thanks in advance
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Feb 24, 2011 11:15 pm    Post subject: Reply to: how to count number of records excluding header an
Reply with quote

use the following DFSORT JCL

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=your input file FB 100 file,DISP=SHR         
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  OMIT COND=(1,3,SS,EQ,C'HDR,TLR')                             
  SORT FIELDS=COPY                                             
  OUTFIL REMOVECC,NODETAIL,BUILD=(50X),                         
  TRAILER1=('OUTPUT FILE',/,/,'COUNT = ',COUNT=(M11,LENGTH=15))
//*
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 add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 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