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
 
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: 7315

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 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
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm

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