I want to count the number of records of several files and generate a file with the output. For example:
File 1:
A
B
File 2:
C
D
E
Output:
File1: 2
File2: 3
I'm doing this:
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=F1,DISP=SHR
//SORTOUT DD DSN=FOUTPUT,
// DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=33,BLKSIZE=0,DSORG=PS),
// SPACE=(CYL,(10,10),RLSE),UNIT=SYSALLDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('F1:',COUNT=(M11,LENGTH=8))
/*
//SORT2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=F2,DISP=SHR
//SORTOUT DD DSN=FOUTPUT,
// DISP=(MOD,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=33,BLKSIZE=0,DSORG=PS),
// SPACE=(CYL,(10,10),RLSE),UNIT=SYSALLDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('F2:',COUNT=(M11,LENGTH=8))
/*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=F1,DISP=SHR
//SORTOUT DD DSN=FOUTPUT,
// DISP=(,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=33,BLKSIZE=0,DSORG=PS),
// SPACE=(CYL,(10,10),RLSE),UNIT=SYSALLDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('F1:',COUNT=(M11,LENGTH=8))
/*
//SORT2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=F2,DISP=SHR
//SORTOUT DD DSN=FOUTPUT,
// DISP=(MOD,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=33,BLKSIZE=0,DSORG=PS),
// SPACE=(CYL,(10,10),RLSE),UNIT=SYSALLDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=('F2:',COUNT=(M11,LENGTH=8))
/*
That is working fine if the files have the same length (33 in this case). But I get the next error when F1 has a length of 33 and F2 has 32:
32 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 33 BYTE LRECL FOR SORTOUT
I also tried deleting "LRECL=33" but the problem is the same. I want to count the number of several records with different lengths and without set the length.
What can I do?
Thanks!