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

Trailer count is 1 less than actual no. of records.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yugendran

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Tue Jan 17, 2012 5:40 pm
Reply with quote

Hi,

I have used below sysin card to count the no. of records per type in infile.

//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
SECTIONS=(1,2,
TRAILER3=(1,255,X,COUNT=(M11,LENGTH=5)))

output:

05 abcd
05 abcd
05 abcd 02
06 1bcd
06 1bcd 01

I need like this
05 abcd
05 abcd
05 abcd 03
06 1bcd
06 1bcd 02

actual count is 3 rec on 05 type and 2 rec in 06 type.. i think it considers first rec on each type as header. Pls help me in resolving this.
Back to top
View user's profile Send private message
yugendran

New User


Joined: 14 Dec 2007
Posts: 51
Location: indore

PostPosted: Tue Jan 17, 2012 5:46 pm
Reply with quote

Hi,

I have used below sysin and it gives the correct count. But i am curious to know why the count is 1 less than the actual record.. It is right to say that it considers 1 record as header for each type?

OPTION COPY
OUTFIL REMOVECC,
SECTIONS=(1,2,
TRAILER3=(1,255,X,COUNT+1=(M11,LENGTH=5)))

Thanks,
Yuge
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jan 17, 2012 5:57 pm
Reply with quote

You haven't shown your input file, so I'm going to have to guess you have no trailers on that, and no headers.

You are not generating a header.

The SECTIONS processing is going to count all the records for that level of "break". You are generating a trailer record, with the count of the detail records. If you want to include the trailer record in the count of records on the trailer, you have to do what you have done.

So, no, in no way is the first detail record being considered a header. You have confused yourself by expecting that the trailer would be automatically counted.
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 -> JCL & VSAM

 


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 To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top