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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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