View previous topic :: View next topic
|
Author |
Message |
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
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 |
|
|
yugendran
New User
Joined: 14 Dec 2007 Posts: 51 Location: indore
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|