IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to count number of records excluding header and trailer


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top