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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Trailer count is 1 less than actual no. of records.
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    Post subject: Reply to: Trailer count is 1 less than actual no. of records
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Tue Jan 17, 2012 5:57 pm    Post subject: Reply to: Trailer count is 1 less than actual no. of records
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us