Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us