I have a fairly simple sort process where I want to provide a total record count at report end and later on I want to add a total of the numeric column of data that starts in column 7 of the input file.
When I just sort and reformat the data (input and output files are both RECFM=VB) it works just fine. When I add a TRAILER1 keyword to sum the record count column that is added dynamically in the sort control cards I get this error: WER247A SORTOUT HAS INCOMPATIBLE LRECL Can anyone tell me what I am doing wrong here? Peter Sample data input (note that the actual input file has a header record with binary zeroes in columns 1-3 and a trailer record with X'FFFFFF' in those positions, neither of which is shown here): 084 XB00000000000116900 084 B00000000000116900 084 XS00000000000116900 084 S00000000000116897 084 S00000000371134140 084 S00000000100000000 084 B00000000371134140 235 XB00000000013780560 235 B00000000013780560 235 B00000000013780560 235 XB00000000013780560 235 XB00000000195766224 235 B00000000195766224 235 B00000000195766224 Sample output WITHOUT TRAILER1 keyword (note leading space for ASA CC): 084, ,B,B,00000000002,000000003712510.40 084, ,S,S,00000000003,000000004712510.37 084, ,B,B,00000000001,000000000001169.00 084, ,S,S,00000000001,000000000001169.00 235, ,B,B,00000000004,000000004190935.68 235, ,B,B,00000000003,000000002233273.44 JCL and control cards WITH TRAILER1 keyword: //SUMTRDS EXEC PGM=SORT, // PARM='EQUALS,MSGDD=SORTLIST,VLTEST=2,VLTESTI=2' SYNCSORT //SORTLIST DD SYSOUT=* //SORTIN DD DISP=SHR,DSN=input-VB-file //SORTOUT DD DISP=(,CATLG,CATLG), // DSN=output-VB-file, // UNIT=SYSDA,SPACE=(CYL,(010,010),RLSE), // DSORG=PS,RECFM=VBA,LRECL=045,BLKSIZE=0 //SYSIN DD * SORT FIELDS=(16,03,A,19,3,A),FORMAT=CH SUM FIELDS=(5,11,ZD,22,17,ZD) OMIT COND=(16,03,CH,EQ,X'000000',OR, 16,03,CH,EQ,X'FFFFFF') * ADD FIXED COUNTING NUM BETWEEN RDW AND DATA. INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'00000000001',16:5)) OUTFIL FNAMES=SORTOUT, TRAILER1=(6:C'TOTALS',4X,TOT=(5,11,ZD),23X), BUILD=(1,4,C' ',16,3,C',',19,1,C',',21,1,C',',21,1,C',', 5,11,C',',22,15,C'.',37,2) //* SORT message output with TRAILER1 keyword: SYSIN : SORT FIELDS=(16,03,A,19,3,A),FORMAT=CH SUM FIELDS=(5,11,ZD,22,17,ZD) OMIT COND=(16,02,CH,EQ,X'0000',OR, 16,02,CH,EQ,X'FFFF') * ADD FIXED COUNTING NUM BETWEEN RDW AND DATA. INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'00000000001',16:5)) * FORMAT ONLY CLI/WI/CXL/B/S, COUNT AND NET OUTFIL FNAMES=SORTOUT, TRAILER1=(6:C'TOTALS',4X,TOT=(5,11,ZD),23X), BUILD=(1,4,C' ',16,3,C',',19,1,C',',21,1,C',',21,1,C',', 5,11,C',',22,15,C'.',37,2) WER813I INSTALLATION OPTIONS IN MFX LOAD LIBRARY WILL BE USED WER276B SYSDIAG= 3230061, 11212936, 11212936, 10866125 WER164B 65,540K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED, WER164B 156K BYTES RESERVE REQUESTED, 1,000K BYTES USED WER146B 24K BYTES OF EMERGENCY SPACE ALLOCATED WER108I SORTIN : RECFM=VB ; LRECL= 8004; BLKSIZE= 27998 WER073I SORTIN : DSNAME=input-VB-file WER257I INREC RECORD LENGTH = 8015 WER110I SORTOUT : RECFM=VBA ; LRECL= 45; BLKSIZE= 27998 WER074I SORTOUT : DSNAME=output-VB-file WER247A SORTOUT HAS INCOMPATIBLE LRECL WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000 -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN