rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
I have a requirement to count the correct number records present in my file excluding HEADER.
I have used below sort card which gives me RECORD count including HEADER --
Code: |
//STEP45 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT.DS,DISP=SHR
//SORTOUT DD DSN=OUTPUT.DS,
// DISP=(NEW,CATLG,DELETE),DATACLAS=DSIZE50,
// RECFM=FB,LRECL=1200
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
TRAILER1=(1:'999999',7:'99999999',15:COUNT=(M11,LENGTH=8))
/*
|
As my input file already has HEADER record and 99 actual data records, so i used the above step to count the number records. But as expected, it gave me count of the actual data records + one count for HEADER record.
Means, it is giving me one count extra. I want to reduce this extra one count while writing trailer record in to the output file. Can i achieve this in the same control card or do i need to write one more extra step ?
P.S. : HEADER record does not have any identifier flag |
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try
Code: |
TRAILER1=(1:'999999',7:'99999999',15:COUNT-1=(M11,LENGTH=8))
|
Gerry |
|